From AlphaWiki

Development: A new [dialog] command

The ancient 'dialog' command needs an overhaul. It has served us well, and, with the wonders of 'dialog::make' and 'dialog::make_paged', can be made to do amazing things. However:

What do we want a new dialog command to do:

Let's try to be simple with this (NOTE: none of this is supposed to be any kind of final design, just some thoughts to experiment with):

dialog {item list}

is about as simple as it can get, where each item may itself be an item list. An item is presumably either a dialog-control of some kind or a group of further items. Let's say, then that each item has a type (the first element of the list), and then:

dialog {{button ...} {group {{button ..} {button ..}}} {button ..}}

would give a simple example of a dialog with one button, a group of two buttons and another button. What if the contents of a group is supposed to be dynamically generated? Then we'd use:

dialog {{button ...} {group -callback generate} {button ..}}

Where proc generate {} { return list {button ..} {button ..} } would make this code do exactly the same thing. We could then have a multi-page dialog with something like:

dialog {{type -pages {list of item lists, one for each page}} {button ..}}

Where type could be any dialog type which has multiple possible values (or, for consistency, I suppose even an item which takes one value like a label could be used if there is only one page in the dialog). So, a listbox or a tab or a popup could control the given list of pages, or a checkbox could control just two pages.

We'd presumably want the ability for the list of pages to be calculated on the fly, or to be given and fixed, and the page contents to be calculated on the fly, or given and fixed.


Category.Development

Retrieved from http://alphatcl.sourceforge.net/wiki/pmwiki.php/Development/ANewDialogCommand
Page last modified on July 20, 2006, at 03:41 PM