>> I'd like to know from some of the more experienced users how they
>> usually go about updating the children Widgets of a Window.
>
> Sorry if I wasn't clear.  By update, I mean modify, like calling
> the child Widget's deactivate/activate/show/hide members.
>
> I'd like a simple way to choose a widget and call one of its members.
> Putting the Widget's name in user_data and cycling through all the
> widgets of a Window to find the one I want works, [...]

It seems to me that you are making it more complicated than needed.

The usual way of attacking this problem means that you either declare
global variables corresponding the the widgets you are interested in,
or you declare them as member variables of your own classes. Then
you pass the pointer to the widget as the user data to the callback
and then access the other widgets via the global variables, or you
pass the _this_ pointer of the class as the user data to the callback
and use this pointer in the callback to access the member widgets.

You can also provide functions or member functions to get/set/update
individual widgets or groups of related widgets.

I'm afraid that I don't have time at the moment to provide an example
but label.cxx, output.cxx and pixmap.cxx in the fltk-1.3/src/test
directory use global variables for access to widgets. That might help.

Cheers
Duncan
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to