From AlphaWiki

Main: New dialogs

Over the last few years the 'new dialogs' code has been started (by Vince) vastly improved by Lars, and now become quite mature. Sadly it hasn't actually been used that widely in AlphaTcl, but that is now changing. All of the standard prefs dialogs (with the exception of menus/features selection at present) now use the new code. The new code basically corresponds to dialog::make]] and [[dialog::make_paged which are 100s of times better than the crufty old stuff.

Now that this new code is being heavily used, it may be time to note down any limitations which are discovered, and approaches to resolving them. Note: try to distinguish between issues which are limitations of the dialogsNew.tcl library and issues which are simply due to inadequate usage of that library (typically procs in dialogs.tcl).

We would like to keep as many special cases out of dialogsNew as possible. It's a very nice, clean library at present -- let's keep it that way!

Known issues in dialogsNew.tcl:

Proposed solution: allow large text items to break across multiple pages -- details to be specified (Lars?)

Proposed solution: Reducing the overall width of the dialogs would help. We could also define a new preference type named "var-short", which would only offer a text-edit field that is 1/3 of the normal var type. Perhaps a better solution is to define a type "numeric" (possibly with other attributes, which could even be used for validation), and have those treated differently.

Known issues in usage:

Proposed solution: Reduce the ambitions of dialog::setDefaultGeometry. Including 3 columns of 'flag' preferences is a noble goal, but it makes for a crowded dialog/screen. If we only tried to include 2 columns, then the default 'PrefWidth' variable could be reduced as well. Even fancier versions would make some reasonable calculation based on the global 'screenWidth' variable, setting an arbitrary maximum of 65% of the screen, or whatever is aesthetically pleasing.

Note that on Windows with Alphatk the current sizing works very well for Vince's machine with 4 or even 5 columns of flags!

Fixed issues:

Implemented solution: when giving -cancel {} the code should remove the button rather than display a small button with no contents.

Implemented solution: Not a bug, rather we need to fix the documentation to say that 'discretionary' items will create page breaks even if there are no items to follow, and therefore discretionary items should only be used _before_ known items, not after. Then any other bad use of discretionary needs fixing.

Implemented solution: pop-up menu width is explicitly calculated in dialog::makeMenuItem.

Implemented solution: fixed this bug by handling the single->multipage transition more intelligently.

Retrieved from
Page last modified on January 23, 2006, at 10:42 PM