[GRASS5] a question about grass 5 tcltk interface

Glynn Clements glynn.clements at virgin.net
Sat Nov 22 18:04:03 EST 2003


Michael Barton wrote:

> This is probably a trivial question, but is something that can get 
> annoying. It seems that every time I open the grass tcltk interface all 
> the windows get larger vertically by some amount. If I don't do a
> 
>  >config>module windows>automatic size for all active windows
> 
> just about every time I run grass, the tcltk module windows grow right 
> off the screen. It doesn't matter if I try to save config. In the next 
> session, they begin to grow again.
> 
> It seems like there is some kind of window size variable that is 
> automatically incrementing in the y-dimension every time grass is 
> initialized. Am I the only person with this strange behavior? Is there 
> some way to stop the growing windows in one of the tcltk files?

I don't know if you're the only person, but I can't reproduce it.

However, I can see a plausible explanation. tcltkgrass records the
geometry of each module window. When it creates the window, it uses
the stored geometry (if present). When it receives a Configure event
(indicating that the window has been created or resized), it updates
the stored geometry.

If the WM makes the window larger than requested, the enlarged size
will be stored and used for the next window, which presumably will be
enlarged even more, and so on. I'm not sure that there's any way that
tcltkgrass can avoid this (other than by simply not attempting to
store the geometry); if a window is enlarged, it can't tell whether
this occurred due to user interaction or due to the WM's automatic
behaviour.

In any case, there doesn't appear to be an option to disable storing
the geometry. To do that, you would need to remove the following code
fragments from tcltkgrass/main/gui.tcl:

    bind $path <Configure> {
        if [regexp {^\.([^.]+)$} %W buffer array] {
            set ${array}(window_geometry) [wm geometry %W]
        }
    }

and/or:

    bind $name <Configure> {
        if [regexp {^\.([^.]+).print$} %W buffer array] {
            set ${array}(result_geometry) [wm geometry %W]
        }
    }

[Search for <Configure> in gui.tcl.]

Note: window_geometry corresponds to the dialog into which the options
are entered, while result_geometry corresponds to the text window
which displays the results.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list