Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9502 closed enhancement (fixed)

Utilize the SetToolTip(const char*) version

Reported by: mmadia Owned by: axeld
Priority: normal Milestone: R1
Component: Preferences/Time & Date Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

As part of the feedback on hrev45330:

f0e995c: Create TimeZoneListView class and move GetToolTipAt into it, fixes #7726 + if (fToolTip != NULL) + fToolTip->ReleaseReference(); + fToolTip = new (std::nothrow) BTextToolTip(toolTip.String()); + if (fToolTip == NULL) + return false;

There is a SetToolTip(const char*) version that could be used instead of doing it the complicated way.

Change History (2)

comment:1 by leavengood, 12 years ago

Resolution: fixed
Status: newclosed

Actually from what I can tell the way this is done is pretty smart, because GetToolTipAt is only called when the mouse is idle. To use the SetToolTip(const char*) version would require constantly setting the tool tip when the mouse is moving, which is much less efficient.

What I decided to do instead is make use of the BTextToolTip's SetText method to just update the text of the existing tool tip if it already exists, and creating it otherwise. That doesn't change the above code much, but it saves constantly recreating the tool tip for no reason.

Fixed in hrev45347.

comment:2 by leavengood, 12 years ago

On second thought this code is more or less reproducing what is inside BView's SetToolTip(const char*), so I've ACTUALLY fixed this ticket now in hrev45348.

Note: See TracTickets for help on using tickets.