[GRASS-dev] trying to compile wxPython NVIZ

Glynn Clements glynn at gclements.plus.com
Thu Jul 17 11:15:06 EDT 2008


Michael Barton wrote:

> >> I checked and these header ARE present, at least for OS X 10.5.4 and
> >> TclTk 8.5. They are in the PrivateHeaders folder. So maybe it is just
> >> necessary to build TOGL 2.0 against the PrivateHeaders in 8.5 for  
> >> this.
> >
> > Note: NVIZ uses Togl 1.7.
> 
> Would it work with 2.0?

It can't just be dropped in. 2.0 has some interface changes, to make
it possible to use it from Tcl without needing C "glue" code. 
Specifically, the Togl_{Create,Reshape,Display}Func() functions no
longer exist. The callbacks are normal Tk configuration options, whose
values are arbitrary Tcl code.

	http://togl.sourceforge.net/upgrading.html

So, the {create,reshape,display}_cb() functions (in togl_cb.c) would
need to be converted to named Tcl commands which can then be specified
as the values of the configuration options.

Also, note that Togl isn't an external library; the source files are
included in GRASS, at visualization/nviz/src/togl.[ch].

IIRC, they're only trivially modified compared to the Togl 1.7
distribution. Primarily, the references to tkWinInt.h have been
removed (this file is only needed if you want Togl's font support,
which NVIZ doesn't use).

Also, togl_ws.h (which selects the platform) has been replaced with a
version which uses the macros from the GRASS build system. The stock
version is generated from togl_ws.h.in by Togl's own configure script.

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


More information about the grass-dev mailing list