[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gEDA: Attributes
On Wed, 19 Apr 2000, Ales Hvezda wrote:
> >In my experimental version of gwave, I made menus configurable from guile
> >by evicting the entire menu-building code out of C and into scheme, and
> >using guile-gtk to build the menus themselves. Constructing Gtk+ menus is
> >much easier when you build a few little helper function anyway (whether in
> >C or guile), so I would imagine that a suitable guile function could
> >construct and attach a menu item, and also bind a keystroke to the same
> >action procedure.
>
>
> Hmmm.. that is a thought. I do have a question about this. Did
> you init gtk from the C or guile side? I've long since thought about
> having the ability to create windows from the guile side but I want to
> do all the setup and real work from the C side. Maybe I should get off of
> my lazy butt and try it. :)
That is essentialy what I did. The C side starts up Gtk+, and creates the
basic framework of the application. As it starts up guile and loads the
startup files, they can set guile hooks (essentialy lists of procedures)
that get called later from C when particular events happen.
There's a new-window-hook called as each type of application window (there
are only really two at the moment) is created. Its main job is creating
the menus.
I wanted to leave the application core in C for efficiency of redraws. Of
course, the other way to do this would be to turn the interesting parts of
the app into Gtk+ widgets in their own right, and lash them together
either from C or guile. Now there's a radical idea - a schematic-editing
widget, embeddable in any number of applications!
Steve
--
Steve Tell | tell@cs.unc.edu | http://www.cs.unc.edu/~tell | KF4ZPF
On Leave from UNC working at Chip2Chip, Inc. tell@chip2chip.com/919-929-0991