« Return to Thread: What the usage of tryHandle and handle

Re: What the usage of tryHandle and handle

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View in Thread

On Tuesday 23 June 2009, Feng Feng wrote:

> Hello Lyle,
>
> Thank you for your excellent explanation for what the difference is.
>
> Now, I have one more question related to the usage of the function,
>
> For the code,
> sender->handle(this,FXSEL(SEL_COMMAND,ID_HIDE),NULL);
>
> Does it mean the following?
>
> Use sender's handle to deliver the message SEL_COMMAND to object which is created with ID_HIDE.
>
> If
> FXMAPFUNC(SEL_COMMAND, XXX::ID_HIDE, XXX::onHide),
>
> Then the function onHide will be called.
>
> Is this correct?

Yes, that's correct.

All widgets support a few standard messages, like ID_HIDE, ID_SHOW, ID_ENABLE, ID_DISABLE.

These messages can be sent back from SEL_UPDATE handlers.

Valuator controls like FXSlider also understand messages like ID_INTVALUE, etc. which
allows setting value from SEL_UPDATE handlers and FXDataTarget.

This is a neat feature because the update handler code doesn't know what kind of widget
invoked the handler.  Thus, different widget types may get updated by the same handler
code.

This is basically how FXDataTarget works.



                        - Jeroen

------------------------------------------------------------------------------
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

 « Return to Thread: What the usage of tryHandle and handle