[haiku-development] Re: Proper method to dynamically update tool tips

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 10 Aug 2009 18:29:20 -0400

On Mon, Aug 10, 2009 at 6:09 PM, Ryan Leavengood<leavengood@xxxxxxxxx> wrote:
>
> So I don't know how usable the BTextToolTip class is like this. If
> there is a certain locking strategy that should be used here, let me
> know.

Well as usual a little Be Book reading provided a workable solution:

        if (ToolTip()->View()->LockLooper()) {
                dynamic_cast<BTextToolTip*>(ToolTip())->SetText(text);
                ToolTip()->View()->UnlockLooper();
        }

But this results in some weird behavior: the tool tip starts off empty
(maybe because the first call fails for a lack of a looper?) Then when
it is updated it is too narrow and never gets wide enough to show all
the text. Plus while the tool tip is showing the updating of the alpha
slider flickers a lot.

So I guess a better solution is needed, or bug fixes in the tool tip class.

-- 
Regards,
Ryan

Other related posts: