[GRASSLIST:301] Re: gui.tcl
Glynn Clements
glynn.clements at virgin.net
Thu Jun 5 20:20:47 EDT 2003
Erika K. Crosse wrote:
> I'd like to ask for your indulgence at little here. A while back I
> downloaded and installed the binaries for GRASS 5.0.2 on OS X.2.6. I'm
> now getting around to working with GRASS again but found tcltkgrass was
> crashing as soon as I selected my location from the gui menu. I was
> getting error message:
> ...
> "scan [exec xwininfo -id [winfo id .w_g] | grep -i Corners] {%*s %d%d}
> dx dy"
> (file "/usr/local/grass5/tcltkgrass/main/gui.tcl" line 1887)
> ...
>
> I compared my old gui.tcl from GRASS 5.0.1 and found that equivalent
> line was commented out and 2 other lines inserted to set dx and dy.
That would probably be the OpenOSX patches; the original gui.tcl is
identical in 5.0.0, 5.0.1 and 5.0.2.
> I've changed current gui.tcl to match but now find that the gui doesn't
> launch automatically even to select location which I'm now forced to do
> from the command line--not really a problem.
Sometimes, problems with tcltkgrass result in an invalid state file
(~/.tcltkgrass) being written; try deleting or renaming this file.
> Also, the configuration of menu bar once I launch the gui is now
> horizontal rather than vertical as it was in my 5.0.1 configuration.
Again, that would be the OpenOSX patches. The original tcltkgrass uses
a horizontal menu bar.
> This last also is not a biggy
> except in that the new menu bar uses up more horizontal screen real
> estate than I have--my monitor is only 1152X870. Now my questions:
> 1) If this script only works with that line commented out what is its
> purpose in being there at all.
tcltkgrass was written for the Unix/X11 version of Tcl/Tk, and will
need modifications to work on other versions of Tcl/Tk (e.g. a native
Mac version).
Apparently, the folks at OpenOSX have made such changes; however, they
don't seem particularly interested in coordinating their work with the
GRASS developers.
> 2) Can someone explain 'wm geometry .w_g 50X50+10+100' and 'set dx
> 100' (or 'set dy 100')--I'm assuming both relate to window size and
> position. Perhaps there is a reference that explains these (and other)
> parameters?
This is described in the "wm" manual page, which should come with
Tcl/Tk. The syntax originates with X, and represents WxH+X+Y; i.e.
50x50+10+100 means a 50x50 pixel window with its top-left corner 10
pixels from the left edge and 100 pixels from the top of the screen.
The original code which generates the error uses "winfo id" to get the
window ID, then passes this to the "xwininfo" program to obtain the
dimensions of the window. However, xwininfo is an X program, and
expects to be passed an X window ID; this is what "winfo id" returns
for a Unix/X11 version of Tcl/Tk, but not for a Mac version:
winfo id window
Returns a hexadecimal string giving a low-level |
platform-specific identifier for window. On Unix |
platforms, this is the X window identifier. Under |
Windows, this is the Windows HWND. On the Macin |
tosh the value has no meaning outside Tk.
The bottom line here is that, currently, none of the active GRASS
developers have Macs, so Mac support relies upon the fact that MacOSX
is (or, rather, can be made to be) sufficiently Unix-compatible to run
GRASS.
However, for maximum compatibility, you need to use X; for tcltkgrass,
this means that you need an X version of Tcl/Tk rather than a native
Mac version. This goes double for NVIZ; you need to use the X versions
of both Tcl/Tk and OpenGL.
This will only change if and when someone with a Mac gets involved
with GRASS development. FWIW, the necessary changes to tcltkgrass are
probably trivial; NVIZ would be more work, as the Togl (OpenGL canvas
for Tcl/Tk) widget doesn't yet have native Mac support.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-user
mailing list