> On 19.08.2011 02:18, Csaba Biegl wrote:
> > Consider a fluid class containing an Fl_Input_Choice 
> widget. If this widget has Fl_Menu_Item-s that have their own 
> callbacks then these will crash the program.
> >
> > Reason is that Fl_Input_Choice itself is a group containing 
> an FL_Input and a Fl_Menu_Button. It is the latter component 
> that executes its menu item callbacks on their behalf.
> >
> > Fluid generated callbacks find their class instance using 
> repeated "->parent()" calls. Because Fl_Input_Choice adds an 
> other group to the hierarchy, the fluid generated callback 
> will access the wrong object.
> 
> Good catch - that sounds plausible (although I'm not very 
> familiar with
> fluid code).
> 
> > I can post a patch to fix this, but we need to decide where 
> to fix it.
> 
> Thanks for the offer!
> 
> > Option 1: Fix it in fluid so that for Fl_Input_Choice menu 
> item callbacks it adds one more "->parent()".
> 
> Advantage: This fix would be "local" to fluid.
> Drawback: special handling in fluid.
> 
> > Option 2: Fix it in Fl_Input_Choice so that its own 
> subclassed version of Fl_Menu_Button passes up menu item 
> callbacks to its parent.
> 
> This is what I'd prefer on a first thought. But then there is the
> possibility that this would break user code that handled this
> correctly (code *not* generated by fluid).
> 
> Just my 2 ct; I'll leave the final decision to others...

I'm not keen on special handling in fluid - though that might be most
compatible. So changing Fl_Input_Choice seems favourite, but...

If we do change the "structure" of Fl_Input_Choice that may have to be
deferred to "1.4" as it'll be a breaker I guess?




SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to