[vox-tech] gtk question - gtk notebook page creation from a callback

Gabriel Rosa vox-tech@lists.lugod.org
Thu, 23 May 2002 20:52:49 -0700 (PDT)


On Thu, 23 May 2002, Peter Jay Salzman wrote:

> doesn't that _basically_ amount to making all the widgets global?

No, because you can obfusc^Wprotect your widgets with a class interface :)

What it ammount to is saying (within maybe your iface constructor):

   widget->callback(function, this);

your interface class can be inside the scope of a function, and your callbacks
can be outside (or "inside", if they are static) of your interface class.

of course, this is all blatantly C++.

>
> i use the same technique with ncurses/cdk (with structs, not classes, of
> course), but then again, i learned GUI programming from man pages.  i
> never really read a book on it.
>
> how would donald knuth approach GUI programming?  :-)
>

He'd pay people $2.46 for every line of elegant GUI code they produced ;)

-Gabe