Appendix B. Missing Functionality
The following statements (they're a result of grepping 'sprintf' and 'eval'
on the aws' *.cpp files) suggest some sort of possible implementation of the
missing commands.
Missing WM methods
These are the WM commands used in AWS
- sprintf(buf, "wm withdraw %s", path());
- AWS uses wm withdraw to temporarily hide the aws_combobox'
popup-listbox and to hide the aws_balloons popup-toplevel
- sprintf(buf, "wm overrideredirect %s 1", path());
- This causes the window to be ignored by the windowmanager, so it won't
appear in iconlists, etc.
- sprintf(buf, "wm deiconify %s;raise %s",
- This is used to make a window re-appear in it's normal form, i.e. after
it's been withdrawn.
- sprintf(buf, "wm resizable %s false false", path());
- This disables the possibility to resize awsDialog windows.
Of course, users of the Hush toolkit might also need to use any
of the other wm
commands.
These commands could be best implemented in the toplevel widget, as they
always operate on toplevel windows.
Missing WINFO methods
- sprintf(buf, "winfo rootx %s", cbEntry->path());
- This is used to determine a widgets X position.
- sprintf(buf, "winfo rooty %s", cbEntry->path());
- This is used to determine a widgets Y position.
- sprintf(buf, "winfo height %s", cbEntry->path());
- This is used to determine a widgets height.
- sprintf(buf, "winfo width %s", cbEntry->path());
- This is used to determine a widgets width.
Of course, users of the Hush toolkit might also need to use any
of the other
winfo commands.
These commands could be best implemented in the widget-class, as they
can operate on any widget.
Missing GRAB methods
- sprintf(buf, "grab -global %s", path());
- sprintf(buf, "grab release %s", path());
- Hush provides a grab() method in the kit-class, but it doesn't
accept a parameter, so these grabs are always local and not global
(which was definately required for the aws_combobox)
- currentGrab = tk->evaluate("grab current");
- statusGrab = tk->evaluate("grab status " + currentGrab);
- Hush also does not provide a way to query the current grab
status, which is required when a grabbing awsDialog wants opens a
new awsDialog (that will take over this grab) (i.e. when a Help button
is pressed), or if an awsDialog has an aws_combobox as internal widget,
which also grabs the cursor.
Grabbing is totally unsupported in Hush, eventhough it can be very
usefull if the user has to choose (i.e. in a dialog) before continuing.
The grab statement should probably be implemented as part of the kit-class,
as it doesn't operate on a specific widget.
Missing Misc. methods
- sprintf(buf, "%s activate 0", cbListbox->path());
- Hush doesn't provide a way to activate a specific listboxentry.
- sprintf(buf, "%s curselection", cbListbox->path());
- Hush does provide a listbox::selection(), but it doesn't return
a special value (i.e. -1) if no selection is made.
- sprintf(buf, "tkwait variable %s", dialogVar);
- sprintf(buf, "set %s 1;wm withdraw %s", dialogVar, path());
- Hush provides a wait() method in the kit-class, but it doesn't
accept a parameter, so the window is always until a window is destroyed.
Sometimes you only want to withdraw the window (so it's childwidgets aren't
immediately destroyed), and use tkwait with a variable.
(which was definately required for the aws_combobox)
- sprintf(buf, "after 500 {wm deiconify %s;raise %s}", path(), path());
- tk->eval("after cancel " + after_id);
- Hush does provide a kit::after, but it doesn't return a timer-id.
AWS requires this Id to be able to cancle the after-timer (in this
specific case, when the mouse leaves a widget before the timer expired
to show the aws_balloon-tip)
<< [Prev]
[Top]
[Next] >>