[GRASS5] New gui.tcl

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

Cedric,

I'm still trying to digest all of this. Does this mean that there are new
options I can invoke when launching modules from the gis.m menu?

Thanks for this great piece of work.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Cedric Shock <cedricgrass@shockfamily.net>
Date: Thu, 16 Mar 2006 20:14:52 -0800
To: <grass5@grass.itc.it>
Subject: [GRASS5] New gui.tcl

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

Michael,

I'm still trying to digest all of this. Does this mean that there are new
options I can invoke when launching modules from the gis.m menu?

Mostly it means the modules, when you launch them are prettier. It also means
that, if you wanted to do something fancy with them, you could pretty simply.
I'm going to make a few examples some time soon.

--Cedric

good stuff.

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)

Nice to have this back (clearly). It is something I missed from the
GRASS 5 GUI. Problem: I can see it in xclipboard, and ^V pastes it in
nedit, but middle-click to paste in doesn't work?

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.

Could this work for the vertical as well? (within reason, e.g. d.vect)

Will our 640x480 friends complain?

Hamish

Hamish wrote:

> 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)

Nice to have this back (clearly). It is something I missed from the
GRASS 5 GUI. Problem: I can see it in xclipboard, and ^V pastes it in
nedit, but middle-click to paste in doesn't work?

Ctrl-V (or Shift-Insert) usually pastes the clipboard, while the
middle mouse button usually pastes the primary selection.

For xterm, you can change the behaviour with e.g.

*vt100.translations: #override \n\
  ~Ctrl ~Meta <Btn2Up>: insert-selection(CLIPBOARD, PRIMARY, CUT_BUFFER0)

This will cause it to prefer the clipboard over the primary selection.

Tk supports setting the primary selection, but it's a bit more work
than using the clipboard (and, nowadays, probably less useful).

--
Glynn Clements <glynn@gclements.plus.com>

On Sun, 19 Mar 2006 20:06:50 +0000
Glynn Clements <glynn@gclements.plus.com> wrote:

This will cause it to prefer the clipboard over the primary selection.

Tk supports setting the primary selection, but it's a bit more work
than using the clipboard (and, nowadays, probably less useful).

At least for me I find it most annoying when I come across an
application where the middle click doesn't work for pasting. It is a
very useful and superior feature that should not be lost if
possible.

T
--
Trevor Wiens
twiens@interbaun.com

The significant problems that we face cannot be solved at the same
level of thinking we were at when we created them.
(Albert Einstein)