[GRASS5] New gui.tcl

Cedric Shock cedricgrass at shockfamily.net
Thu Mar 16 23:14:52 EST 2006


Fellow developers,

There is a new gui.tcl in CVS, along with associated icons, and much more 
extensive documentation. The new version was submitted in two steps, the 
first of which was posted in the thread "New gui.tcl generic user interface". 
This is to make the changes between versions clearer.


There are changes that would affect programs "subclassing" or overriding 
gui.tcl procs:

The programming interface for overriding pieces of gui.tcl has changed. I 
don't believe anyone was doing this, but if you were check out 
grass6/lib/gis/README.GUI. It includes migrating instructions.

The layout has been abstracted out of the rest of the program. This would 
allow it to be overridden easily.


The following programming side (d.m, gis.m) changes have been made. I plan on 
making small examples of how to use these.

The arrangement of components, like buttons and progress bar and command label 
etc are all separated into different procs. This makes it very easy to get a 
dialog without these features instead of very difficult. (Before it was 
necessary to reimplement other parts of the program logic)

A program sourcing gui.tcl can use dialog_get_command $dlg and 
dialog_set_command $dlg $cmd to get and set the command being edited in the 
dialog. The command is set and retrieved in tcl argv style list form.

It is now able to make dialogs in containers that aren't toplevel windows.


The following cosmetic or user side changes have been made:

Icons all come from etc/gui/icon (no more bwidgets folder). It doesn't crash 
when core icons are missing. Icons have been added to the output to indicate 
success / failure of the run command

The run button is disabled while a command is running.

The answer provided for flags is used to set whether they are on or off.


What we can do with this:
Have multiple different layouts for user interfaces to programs and user 
choice as to what to use (currently there is only one)

Use these created dialogs inside panes in gis.m or d.m

Start setting guisections on other modules to get more elaborate layouts.



The current version also includes all of these changes (which occurred 
immediately before):

Options and Output are now displayed in tabs instead of panes

There is a new command label which shows the current command as it is edited.
It has a button for copying the command to the clipboard. (Might be worth
noting in wish 2074)

Programs reporting guisections will have a tab made for options in each
toplevel section. Finer section grouping is obeyed, but no labels are created
or displayed.

The options frames scroll with the mouse wheel.

If possible the window opens wide enough to display its contents. This is
accomplished by adding a binding to the scrolled frames which report their
widths to their parent frames.

Programs using the label and description attributes on options or tabs will
now have the description displayed as balloon help.

The help button is not enabled if no help file exists for the program. (closes
wish 3799)

The type and required text for options is displayed right justified.

Module information is displayed differently. Both the label and description
are displayed if available. Module is displayed with an icon if a matching
one can be found in $(GISBASE)/etc/icons. See /gui/icons/README for more
information.

Buttons for file selection are displayed with an open file icon.

--Cedric Shock




More information about the grass-dev mailing list