push button with callback as pressed?
Unable to parse email body. Email id is 4223
Unable to parse email body. Email id is 4223
On July 26, 2005 12:14 pm, Nick Levine wrote: > I want to give a push-button a callback when it is pressed, in > addition to the :selection-callback which is invoked when the button > is released. Am I dreaming or is this possible? > > (capi:contain (make-instance 'capi:push-button :text "Frob" > > :selection-callback (lambda (&rest x) (print x > : #.*standard-output*)))) > > - nick > > (lww 4.4.5 in case that matters) The capi ref for class button says :callback Called when the button is pressed. :selection-callback Called when the button is selected. :retract-callback Called when the button is deselected. Looks to me like you want :callback. pt
Unable to parse email body. Email id is 4226
Unable to parse email body. Email id is 4230
Unable to parse email body. Email id is 4238
Nick Levine wrote: > (capi:contain (make-instance 'capi:push-button :text "Frob" > :selection-callback (lambda (&rest x) (print x #.*standard-output*)))) I know this is probably not related to your question, but isn't using #.*standard-output* in this way a very dangerous thing to do? The stream that *standard-output* is bound to at read-time may not even exist at load-time, I would think. Or it may exist in your development image but not in a delivered application. Or am I missing something? Arthur