I have a wx.Slider representing the a media item's currently playing position.
I've coded the slider so that clicking it will jump the media file to the point that you clicked on (e.g. clicking halfway across the slider jumps you halfway through the video).
I'd like to now have the tooltip show the video position of where clicking will take you to, so I need to update that tooltip dynamically on hover.
You can call SetToolTipString with the new text, and then when the tooltip is shown the next time it will show the new text. I don't think it will update if the tooltip is already shown however, which is probably what you want it to do.
Another possibility would be to use wx.TipWindow, or you could create your own tip class if you need even more control.
···
On 11/26/12 10:49 AM, Steven Sproat wrote:
Hi all,
I have a wx.Slider representing the a media item's currently playing
position.
I've coded the slider so that clicking it will jump the media file to
the point that you clicked on (e.g. clicking halfway across the slider
jumps you halfway through the video).
I'd like to now have the tooltip show the video position of where
clicking will take you to, so I need to update that tooltip dynamically
on hover.
So I guess there's no event to hook into for before the tooltip is displayed / on hover? I'd need to call some function before displaying the tooltip to calculate what position in the audio file that slider's position will jump you to
···
On 26/11/2012 20:44, Robin Dunn wrote:
On 11/26/12 10:49 AM, Steven Sproat wrote:
Hi all,
I have a wx.Slider representing the a media item's currently playing
position.
I've coded the slider so that clicking it will jump the media file to
the point that you clicked on (e.g. clicking halfway across the slider
jumps you halfway through the video).
I'd like to now have the tooltip show the video position of where
clicking will take you to, so I need to update that tooltip dynamically
on hover.
Is there a way to do this?
You can call SetToolTipString with the new text, and then when the tooltip is shown the next time it will show the new text. I don't think it will update if the tooltip is already shown however, which is probably what you want it to do.
Another possibility would be to use wx.TipWindow, or you could create your own tip class if you need even more control.
Not directly but you can probably do something like that yourself. For example you could restart a timer for every mouse motion event, or stop it when the mouse leaves the widget. Then if/when the timer expires (in other words, the mouse has not left nor moved for N milliseconds) you can do your calculation and then set the tooltip text.
···
On 11/26/12 5:28 PM, Steven Sproat wrote:
Hi Robin,
So I guess there's no event to hook into for before the tooltip is
displayed / on hover? I'd need to call some function before displaying
the tooltip to calculate what position in the audio file that slider's
position will jump you to