1 libgui - Handy GUI code
3 This module has various pieces of code that are useful for a GUI. For
4 the most part, they are Tcl/Tk-related.
7 - bitmaps and canvas code are duplicated in S-N; should look into
9 - tkTreeTable taken from S-N but modified; should use the same
10 version in both places. Better yet, replace this widget with
13 Here's a brief runthrough:
19 Tcl code to implement balloon help (aka tooltips)
21 Primary interface is the "balloon" command. See last function in
22 file for details on usage
25 Provides bind_widget_after_class proc; rearranges bindtags in
26 a frequently-useful way.
29 Tcl procs relating to canvas widgets
31 set_scroll_region canvas
32 Set the scroll region on CANVAS to include all items in the
33 canvas. Most easily used when bound to <Configure> on the
40 Define a global array named NAME. VALUE, if present, is the
41 initial value. VALUE is in the format expected by "array
45 Define a new global variable named NAME.
48 Provides the proc "gensym", which generates new symbol names.
51 Defines the stub proc "gettext", used for looking up text in a
52 localization database.
55 Provides procs for handling hooks (lists of functions that
56 should be run when something happens).
59 Provides the Labelledframe widget -- a frame with a groove and
63 Defines useful list procs. Some of these are Tcl versions of C
66 lvarpush listvar element ?index?
67 Insert ELEMENT into list stored in LISTVAR (a variable).
68 Element is inserted at INDEXth position. INDEX defaults to
71 lvarpop listvar ?index?
72 Remove INDEXth element from list stored in LISTVAR (a
73 variable). Returns the removed element. INDEX defaults to
77 Assign successive elements from LIST to variables named in
78 ARGS. If LIST is longer than ARGS, assign a list of remaining
79 elements to last variable.
82 Remove duplicates and sort list. ARGS, if specified, are
86 Return list created by removing the first item `ELEMENT'
89 Procs for handling monochrome displays or colorblind users
92 Application preference code. This will probably vanish at some
93 point, once we figure out how we really want to do this. I just
94 had this code lying around, and it was useful to me, so I included
97 Defines a single interface, "preference", which has several
100 preference define name default docstring ?handler?
101 Define a new preference. HANDLER, if specified, is a proc
102 to run whenever the preference's value changes.
105 Return value of preference.
107 preference documentation name
108 Return doc string of preference
110 preference varname name
111 Return name of variable representing named preference. This
112 can be used eg as the -variable of a radiobutton.
114 preference set name value
117 preference get_commands
118 Return text of commands which, when evalled, will restore
119 the current state of all defined preferences.
122 The sendpr widget; a GUI for send-pr.
125 Code for bindings on toplevels.
127 bind_for_toplevel_only toplevel sequence script
128 Put a binding on window TOPLEVEL for event SEQUENCE. When the
129 event is seen, SCRIPT will run. This proc adds a new bindtag
130 to the toplevel to avoid the problems associated with putting
131 bindings directly on toplevels.
134 Attempt to make setting the -underline option easier. This is
135 particular good when using gettext. Unfortunately the interface
136 is hard to use; it should be changed.
138 extract_label_info option label
139 Extract underline and label info from descriptor string LABEL.
140 Any underline in LABEL is extracted, and the next character's
141 index is used as the -underline value. There must be only one
142 underline in LABEL. This proc returns a list of the form:
144 OPTION NEWLABEL -underline INDEX
146 Eg: extract_label_info -text _File
147 -> {-text File -underline 0}
150 Directory of C code. This is all put into libide.a.
153 Useful startup code that all applications should run.
155 int ide_initialize (Tcl_Interp *interp, char *appname);
158 - Sets the global Tcl variable ide_application_name to APPNAME.
159 - Searches the filesystem for the libide Tcl code, and sets
160 up the auto_path appropriately. The IDE_LIBRARY environment
161 variable can override the searching.
162 - Sets up the auto_path to include the application's Tcl library
163 as well (if possible). Applications should install their Tcl
164 code in $(datadir)/APPNAME/
165 - Runs the application's startup file - $(datadir)/APPNAME/APPNAME.tcl
166 - Sets these entries in the global array Paths:
167 Paths(bitmapdir) Location of libide bitmaps
168 Paths(appdir) Location of application's scripts
170 This function returns TCL_OK on success, and something else on
174 Makes it easy to write commands which are split into a number of
175 subcommands (eg, like the Tcl "file" command).
177 int create_command_with_subcommands (Tcl_interp *interp, char *name,
178 struct subcommand_table *table)
180 Create a new Tcl command name NAME. TABLE describes the
181 subcommands; see subcommand.h for details. Returns TCL_OK on
182 success, TCL_ERROR on failure.
184 tkCanvEdge.c, tkCanvLayout.c, tkCanvLayout.h, tkCanvas.c, tkCanvas.h
185 Patched versions (ugh) of the corresponding Tk files, and some new
186 files. These files implement graph layout for canvases.