|
From: Joe E. <jen...@fl...> - 2005-07-20 21:24:14
|
New in CVS: [ttk::dialog]. Documentation here:
<URL: http://tktable.sourceforge.net/tile/doc/dialog.html >
Please review.
This is similar to [tk_messageBox], with a few notable differences:
+ [ttk::dialog $dlg ...] constructs the dialog $dlg, maps it,
and returns immediately; [tk_messageDialog ...] blocks until
the dialog is dismissed.
+ [tk_messageDialog] returns the button name to the caller
after dismissing the dialog; [ttk::dialog] passes the button
name to a callback procedure specified by the -command option.
(Rationale: it's easy to build a blocking API on top of a
nonbocking one, but not the other way around. I haven't done
the blocking API yet.)
+ There is no -parent option; instead, [ttk::dialog]s are
made transient for the nearest [toplevel] ancestor widget.
+ [ttk::dialog]s are nonmodal.
+ [ttk::dialog]s use the KDE / Win2K / XP layout style
instead of the older Motif/Windows 3.1/CUA style.
Gnome / Aqua - style button layouts are not (yet) supported.
[ttk::dialog] supports the same set of predefined dialog '-type's [*],
but also allows an arbitrary user-specified list of '-button's
It also provides a "client frame" where the caller can add additional
widgets for further customization. There (will also be) a mechanism
(undocumented, not fully worked out) for defining new '-icon's
or theme/application-specific versions of the built-in ones.
I've been using this interface for a while and am fairly happy
with it; a few things that should probably be changed though:
+ [ttk::dialog]s are "self-destructing" -- when the user
presses a command button, the dialog is destroyed. It
might be preferable to withdraw the window instead.
+ There should be an option to make [ttk::dialog]s modal.
(I don't think this should be the default, though, mostly
because of the all-around evilness of [grab].)
+ Possibly: an option for persistent dialogs, i.e.,
ones that don't automatically dismiss themselves when
a command button is pressed.
Other missing features/possible enhancements are listed in TODO
notes at the top of library/dialog.tcl.
--Joe English
jen...@fl...
[*] Except for '-type abortretryignore', which has been omitted
for obvious reasons.
|