Hello,

I am attempting to create a "smart" Fl_Choice. What makes it "smart" (be it
debatable) is that if the selected item's text is longer than the width of
the width (minus the arrows), the widget's tooltip is set to be the item's
text.

The result is hovering over a Fl_Choice with partially visible text will
display a tooltip with the full text.

Having examined Fl_Choice.cxx::handle() it appears that picked() will be
called when an item is selected. In fact, picked() is called for all the
cases of how an item can be selected (FL_PUSH, shortcut, keyboard, etc.).

The problem I am having is my picked() is not being called. Instead, to get
this feature to work I had to put it in the handle(). This is ok in a
pinch, but as you can see from the test program attached, the
tooltipification logic is executed way too often. It really should only
executed when an item is selected which is why I first tried to override
picked().

I'd really appreciated it if someone could take a look at the test program
attached and see what I am doing wrong?

Thanks,

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

Reply via email to