[GUI] Setting properties of a widget

Krasimir Angelov ka2_mail@yahoo.com
Tue, 1 Apr 2003 01:05:27 -0800 (PST)


--- Krasimir Angelov <ka2_mail@yahoo.com> wrote:
> The "on" function in the GIO doesn't mean write-only
> attribute. The "on" function converts Event to Attr
> 
> on :: Event w a -> Attr w a
> 
> The returned attribute is read/write. The following
> example explains this:
> 
> oldhanlder <- get button (on click)
> set button [on click =: f >> oldhandler]
> 
> or
> 
> set button [on click ~: \oldhandler -> f >>
> oldhandler]
> 

I forget to note that the Events in the lates GIO
version are optimised and in addition we have "off"
function:

off :: Event w a -> Prop w

The following example unregister handler to the
"click" event:

set button [off click]

This is equivalent to:

set button [on click =: return ()]

but under X and events like "mouse" and "keyboard" is
more effective because the "off" function unregisters
handlers in the X.

Krasimir

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://platinum.yahoo.com