Display tooltip on a disabled button

188 views
Skip to first unread message

Larry Martell

unread,
Feb 9, 2015, 4:40:56 PM2/9/15
to wxpytho...@googlegroups.com
Is there a way to display a tooltip on a disabled button? I am doing this:

btn.SetToolTip(wx.ToolTip("My hovercraft is full of eels'))

When the button is enable the tooltip is shown, but I would also like
to have to shown when the button is disabled. Is that possible.

This is on wx version 2.8.

Nathan McCorkle

unread,
Feb 9, 2015, 7:52:42 PM2/9/15
to wxpytho...@googlegroups.com
I didn't like how ToolTip worked, SuperToolTip was the easiest to get working for me, though it doesn't look exactly 'native'. If you use it, make sure to manually indent like 319 in the source file, according to this bug report I made a few months back:

Larry Martell

unread,
Feb 9, 2015, 8:32:02 PM2/9/15
to wxpytho...@googlegroups.com
Does it display on a disabled button?  

Bzzzz

unread,
Feb 9, 2015, 11:15:15 PM2/9/15
to wxpytho...@googlegroups.com
On Mon, 9 Feb 2015 16:40:53 -0500
Larry Martell <larry....@gmail.com> wrote:

> When the button is enable the tooltip is shown, but I would also like
> to have to shown when the button is disabled. Is that possible.
>
> This is on wx version 2.8.

Here (debian sid) with 2.8, it's working on a disabled stock button.

Larry Martell

unread,
Feb 10, 2015, 9:32:40 AM2/10/15
to wxpytho...@googlegroups.com
That's very odd that I have a different behaviour. I assume you're
disabling the button with btn.Enable(False) ?

Werner

unread,
Feb 10, 2015, 9:55:49 AM2/10/15
to wxpytho...@googlegroups.com
Maybe platform specific?

Werner

Larry Martell

unread,
Feb 10, 2015, 9:59:43 AM2/10/15
to wxpytho...@googlegroups.com
I am on CentOS 5.8

Werner

unread,
Feb 10, 2015, 10:07:26 AM2/10/15
to wxpytho...@googlegroups.com
Could it be the GTK version you use?

Just tried on Windows 8 with wxPython-Phoenix and tooltips are not shown
on stock button if it is disabled.

Werner

Anders Munch

unread,
Feb 11, 2015, 7:51:04 AM2/11/15
to wxpytho...@googlegroups.com, Larry Martell
Larry Martell:
> Is there a way to display a tooltip on a disabled button?

Place the button on a panel by itself, and set the tooltip on the panel as well.
No guarantees that this will work on all platforms, but I just tried it successfully on Win7 (msw 3.0.2 classic).

regards, Anders


********************************************************************************
Denne mail er blevet scannet af http://www.comendo.com og indeholder ikke virus!
********************************************************************************

Larry Martell

unread,
Feb 13, 2015, 1:23:03 PM2/13/15
to wxpytho...@googlegroups.com
On Wed, Feb 11, 2015 at 7:50 AM, Anders Munch <a...@flonidan.dk> wrote:
> Larry Martell:
>> Is there a way to display a tooltip on a disabled button?
>
> Place the button on a panel by itself, and set the tooltip on the panel as well.
> No guarantees that this will work on all platforms, but I just tried it successfully on Win7 (msw 3.0.2 classic).

Thanks, I'll give that a try.
Reply all
Reply to author
Forward
0 new messages