Push on - push off
Hi Lispers!I would like to have a button which toggles between a normal and a pressed state when clicked. As far as I can tell, this is not possible with CAPI (pity!)
But is there some workaround, platform-specific or otherwise?
One way to create the button in Cocoa is something like
(make-instance 'capi:cocoa-view-pane
:visible-min-width 70 ; size needs to be specified explicitly
:visible-min-height 30
:view-class "NSButton"
:init-function #'(lambda (pane view)
(setq view (objc:invoke view "init"))
(objc:invoke view "setButtonType:" 1)
(objc:invoke view "setTitle:" "Button title")
(objc:invoke view "setBezelStyle:" 1)
view))
But then I can't (easily at least) catch click events to the button (is it even possible to do it from LW?).
Any ideas?
Regards
Erik