>> 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
> [..]

        Right, I think I posted an example that hopefully helps show
        how widgets can access each other via pointers within the class,
        and the callbacks can get 'this' via w->window(), leaving userdata()
        available for other info if needed.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to