File: subsection3_7_2.html

package info (click to toggle)
tix 8.4.3-14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,316 kB
  • sloc: ansic: 28,084; tcl: 22,774; python: 7,577; makefile: 333; cs: 253; sh: 210; perl: 128
file content (53 lines) | stat: -rw-r--r-- 3,066 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<HEAD>
<TITLE> Selecting Directories with the TixDirTree and TixDirList Widgets<A NAME=52>&nbsp;</A></TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff" TEXT="#000000" LINK="#0000ff" VLINK="#000080">
<FONT FACE="Tahoma, Arial, Helvetica">
 <HR> <A NAME=tex2html1053 HREF=section3_8.html><IMG ALIGN=MIDDLE SRC="../gif/icons/next_motif.gif"></A> <A NAME=tex2html1051 HREF=section3_7.html><IMG ALIGN=MIDDLE SRC="../gif/icons/up_motif.gif"></A> <A NAME=tex2html1047 HREF=subsubsectionstar3_7_1_5.html><IMG ALIGN=MIDDLE SRC="../gif/icons/previous_motif.gif"></A> <A NAME=tex2html1055 HREF=tableofcontents3_1.html><IMG ALIGN=MIDDLE SRC="../gif/icons/contents_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html1054 HREF=section3_8.html> Tix Object Oriented </A>
<B>Up:</B> <A NAME=tex2html1052 HREF=section3_7.html> Selecting Files and </A>
<B> Previous:</B> <A NAME=tex2html1048 HREF=subsubsectionstar3_7_1_5.html> 5.1.5 The tix </A>
<HR> <P>
<A NAME=Contents>&nbsp;</A><H2><A NAME=SECTION00072000000000000000> Selecting Directories with the TixDirTree and TixDirList Widgets<A NAME=52>&nbsp;</A></A></H2>
<P>
There are two Tix widgets for selecting a directory: TixDirList (figure 5-6
) and TixDirTree (figure 5-6). Both of them
  display the directories in a hierarchical format. The display in the
  TixDirList widget is more compact: it shows only the parent- and
  child-directories of a particular directory. The TixDirTree widget, on
  the other hand, can display the whole tree structure of the file system.
<P>
The programming interface of these two widgets are the same and you can
  choose the which one to use depending on your application. As shown in
  the following example, you can use the <tt>-directory</tt> option of the
  TixDirList widget to specify a directory to display. In the example, we
  set <tt>-directory</tt> to be <tt>/home/ioi/dev</tt>. As a result, the
  TixDirList widget displays all the subdirectories and all the ancestor
  directories of <tt>/home/ioi/dev</tt>. You can use the <tt>-command</tt> and
  <tt>-browsecmd</tt> options to handle the user events: a double click or
  Return key-stroke will trigger the <tt>-command</tt> option and a single
  click or space bar key stroke will trigger the <tt>-browsecmd</tt>
  option. Normally, you would handle both type of events in the same
  manner, as we have done in program 5-5
<P>
<blockquote> <P><tt> tixDirList .d -value /home/ioi/dev <BR>    -command &quot;selectDir&quot; -browsecmd &quot;selectDir&quot;<BR>
pack .d<BR>
<BR>
proc selectDir {dir} {<BR>
    puts &quot;now you select $dir&quot;<BR>
}</tt>
</blockquote>
<P><CENTER>(Figure 5-5) Using the TixDirList widget<A NAME=55>&nbsp;</A>
  </CENTER>
<P>
<blockquote> <P><CENTER><P><IMG ALIGN="LEFT" SRC="../gif/tix/hlist/dirtree.gif"> <IMG ALIGN="LEFT" SRC="../gif/tix/hlist/dirlist.gif"><BR CLEAR=LEFT><CENTER>(Figure 5-6) The DirTree and DirList Widgets<A NAME=56>&nbsp;</A></CENTER><P>
  </CENTER>
</blockquote>
<P>
<HR>

</FONT>
</BODY>
<P><ADDRESS>
<A HREF=http://tix.sourceforge.net>http://tix.sourceforge.net</A><BR>
</ADDRESS>