Well, I got signals to work on the first pass, minus the stupid typo that
kept it from compiling at all. I'm sure something is #%!@!ing stupid in
it, but you can now attach lisp callbacks to GTK widgets, and they are done
appropriately.
If anyone wants to play around with it, please check out the latest CVS
version. This test app should get you going.
Another sick & twisted thing you might want to try is using:
(setq box (frame-property (selected-frame) 'container-widget))
(setq widget (... muck with other widgets here ...))
(gtk-box-pack-start box widget nil t 5)
(gtk-widget-show-all widget)
That should stick whatever widgets you want at the top of the screen. I
think it is doable to implement menus and toolbars using this instead of C
code.
There are a few functions that are not currently implemented... I'm not
sure how to deal with functions that return things via pointers (some
functions in GTK even return SINGLE values (integers even!) like this -
lame!) I'm going to take a look at guile-gtk to see how they fixed that,
but they have taken a fundamentally different approach and have a defs file
that generates gobs of C code that you then compile, instead of calling the
functions from the DLL directly. hrm.
-Bill P.
(load-library "gtk")
(let ((win (gtk-window-new GTK_WINDOW_TOPLEVEL))
(vpane (gtk-vpaned-new))
(hpane (gtk-hpaned-new))
(clist (gtk-clist-new 5))
(box (gtk-hbutton-box-new))
(calendar (gtk-calendar-new))
(frame (gtk-frame-new "Combo box test"))
(combo (gtk-combo-new))
(button nil)
(ctr 0))
(gtk-container-add win vpane)
(gtk-paned-add1 vpane hpane)
(gtk-paned-add2 vpane box)
(gtk-paned-add1 hpane calendar)
(gtk-paned-add2 hpane clist)
(gtk-clist-column-titles-show clist)
(while (/= ctr 5)
(gtk-clist-set-column-title clist ctr (format "Test row #%d" ctr))
(setq button (funcall
(if (/= 0 (% ctr 2))
'gtk-button-new-with-label
'gtk-check-button-new-with-label)
(format "Test button #%d" ctr)))
(gtk-container-add box button)
(gtk-signal-connect-internal button 'clicked
`(lambda ()
(message ,(format "Hello from button #%d" ctr))))
(setq ctr (1+ ctr)))
(gtk-widget-show-all win))
Show replies by date