SuperToolTip - is it still maintained?

Hi,

I stumbled upon super tooltip while browsing wxPython docs&demos and wanted to use it in my app.

Since then I'm becoming more and more surprised with its code. So I just wanted to ask if the code is still maintained and considered 'live', so I could create a patch and send it (where?), hoping it will be included in future release, or should I just modify code in place because noone really cares about it anymore (in which case it should be marked as deprecated perhaps).

Issues I found so far:

1. Shadows and rounded corners are available on windows later than XP, so checking for an exact OS version restricts tooltip too much

2. Formatting of main body text is poor - only full text can be bolded, or link can be included at the beginning of line.

3. CalculateBestSize is almost a copy of OnPaint - a tiny change to the latter can make CalculcateBestSize fit within 2 lines instead of ~80.

4. Speaking about OnPaint - it's a terrible spaghetti code, spanning over 150 lines and taking care of text formatting (among other tasks), so if you want to change text formatting behaviour in a subclass, you need to copy full method to a subclass and change just relevant part of it.

5. Trick with enabling tooltip globally (by storing an attribute in wx.App) is nice, but that attribute is not checked when tooltip is shown, so if we disable tooltip while timer is running, it won't prevent it from being displayed. And since there's no 'legal' access to that attribute from outside the SuperToolTip class it's quite annoying.

6. There's a method 'DoShowNow()' for instant display of tooltip, but there's no 'DoHide()' nor 'Close()' method for instant closing it.

7. Tooltip window is actually being recreated each time it's being displayed, which (at first glance) looks like a waste - each time we need to recompute all formatting, best size & position, while it's rather unusual that tooltip instances change their contents (message & images).

I already coped with following points:
1., 3., 6. and partially with 2. (code now supports <b></b> and <i></i> tags, but I didn't take care about escaping the '<' character in any way so it can't be a part of tooltip).

Now I need to cope with 5. so I'm going to repeat myself - is there a need for improving SuperToolTip, or is BalloonTip or wx.TipWindow considered so much better that noone wants to spend his time on SuperToolTip anymore?

Best regards,

Adam Bielański.

Hi Adam,

···

On Tuesday, August 21, 2012 9:17:36 AM UTC-5, Adam Bielański wrote:

Hi,

I stumbled upon super tooltip while browsing wxPython docs&demos and wanted to
use it in my app.

Since then I’m becoming more and more surprised with its code. So I just wanted
to ask if the code is still maintained and considered ‘live’, so I could create
a patch and send it (where?), hoping it will be included in future release, or
should I just modify code in place because noone really cares about it anymore
(in which case it should be marked as deprecated perhaps).

Go to the wxPython website and you’ll see a link under the Community section on the left called “Submit a patch” which will take you to Trac. Here’s the page you probably want to read: http://trac.wxwidgets.org/wiki/HowToSubmitPatches

As I recall, SuperToolTip is a part of agw, so I’m guessing it’s still used. The author is on this list and is quite receptive to patches and feature requests.

  • Mike

Hi,

Hi,

I stumbled upon super tooltip while browsing wxPython docs&demos and wanted
to use it in my app.

Since then I'm becoming more and more surprised with its code. So I just
wanted to ask if the code is still maintained and considered 'live', so I
could create a patch and send it (where?), hoping it will be included in
future release, or should I just modify code in place because noone really
cares about it anymore (in which case it should be marked as deprecated
perhaps).

Issues I found so far:

1. Shadows and rounded corners are available on windows later than XP, so
checking for an exact OS version restricts tooltip too much

2. Formatting of main body text is poor - only full text can be bolded, or
link can be included at the beginning of line.

3. CalculateBestSize is almost a copy of OnPaint - a tiny change to the
latter can make CalculcateBestSize fit within 2 lines instead of ~80.

4. Speaking about OnPaint - it's a terrible spaghetti code, spanning over
150 lines and taking care of text formatting (among other tasks), so if you
want to change text formatting behaviour in a subclass, you need to copy
full method to a subclass and change just relevant part of it.

5. Trick with enabling tooltip globally (by storing an attribute in wx.App)
is nice, but that attribute is not checked when tooltip is shown, so if we
disable tooltip while timer is running, it won't prevent it from being
displayed. And since there's no 'legal' access to that attribute from
outside the SuperToolTip class it's quite annoying.

6. There's a method 'DoShowNow()' for instant display of tooltip, but
there's no 'DoHide()' nor 'Close()' method for instant closing it.

7. Tooltip window is actually being recreated each time it's being
displayed, which (at first glance) looks like a waste - each time we need to
recompute all formatting, best size & position, while it's rather unusual
that tooltip instances change their contents (message & images).

I already coped with following points:
1., 3., 6. and partially with 2. (code now supports <b></b> and <i></i>
tags, but I didn't take care about escaping the '<' character in any way so
it can't be a part of tooltip).

Now I need to cope with 5. so I'm going to repeat myself - is there a need
for improving SuperToolTip, or is BalloonTip or wx.TipWindow considered so
much better that noone wants to spend his time on SuperToolTip anymore?

Its nice to see that someone is still willing to provide patches :slight_smile:

SuperToolTip is part of AGW, and I am the official maintainer of the
library. I don't really think it's deprecated, as I use it all the
time and I know few other people on this list do as well. Anyway, I am
glad you worked around some of the limitations of the widget, and I
will be happy to apply a patch.

you can either upload a patch to wxTrac:

http://trac.wxwidgets.org/

Or send the patch file to me directly and I'll apply it in SVN. If you
go via the wxTrac route, please remember to set the component to AGW
Either way, please make sure that your patch is done against the SVN
copy of AGW.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 21 August 2012 16:17, Adam Bielański wrote:

W dniu 2012-08-21 16:55, Mike Driscoll pisze:

Hi Adam,

    Hi,




    I stumbled upon super tooltip while browsing wxPython

docs&demos and wanted to

    use it in my app.




    Since then I'm becoming more and more surprised with its code.

So I just wanted

    to ask if the code is still maintained and considered 'live', so

I could create

    a patch and send it (where?), hoping it will be included in

future release, or

    should I just modify code in place because noone really cares

about it anymore

    (in which case it should be marked as deprecated perhaps).
    Go to the wxPython website and you'll see a link under the

Community section on the left called “Submit a patch” which will
take you to Trac. Here’s the page you probably want to read:
As I recall, SuperToolTip is a part of agw, so I’m guessing it’s
still used. The author is on this list and is quite receptive to
patches and feature requests.

  • Mike

  To unsubscribe, send email to

or visit

Thanks Mike for prompt answer. Since writing my post, I already

found (another?) bug in code (kill focus event is being bound to
popup, not its parent).

Anyway, the link you've sent takes me to *wxWidgets* Trac, and

supertooltip.py is pure-python module, credited to Mr Andrea Gavana.
Correct me if I’m wrong, but I believe that the whole agw package
(which is great, btw) is wxPython-specific, so should I really send
my patch to wxWidgets guys?

Best Regards,

 Adam Bielański.
···

http://trac.wxwidgets.org/wiki/HowToSubmitPatches

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

Thanks Mike for prompt answer. Since writing my post, I already

found (another?) bug in code (kill focus event is being bound to
popup, not its parent).

Anyway, the link you've sent takes me to *wxWidgets* Trac, and

supertooltip.py is pure-python module, credited to Mr Andrea Gavana.
Correct me if I’m wrong, but I believe that the whole agw package
(which is great, btw) is wxPython-specific, so should I really send
my patch to wxWidgets guys?

Best Regards,



 Adam Bielański.

Yup. The wxPython stuff is actually hosted there too. I think one of the drop-downs in the patch submission page is for wxPython. And as Andrea mentioned, you’ll want to set the component to “AGW” as well. Or you can just submit it directly to him on this list as he mentioned.

  • Mike

Yes. From my point of view wxPython and wxWidgets are not really separate projects, rather wxPython is wxWidgets plus a bit more. So we share resources like the SVN server and Trac and get more done with less effort.

···

On 8/21/12 8:17 AM, Adam Bielański wrote:

Anyway, the link you've sent takes me to *wxWidgets* Trac, and
supertooltip.py is pure-python module, credited to Mr Andrea Gavana.
Correct me if I'm wrong, but I believe that the whole agw package (which
is great, btw) is wxPython-specific, so should I really send my patch to
*wxWidgets* guys?

--
Robin Dunn
Software Craftsman

W dniu 2012-08-21 17:12, Andrea Gavana pisze:

Hi,

Hi,

I stumbled upon super tooltip while browsing wxPython docs&demos and wanted
to use it in my app.

Since then I'm becoming more and more surprised with its code. So I just
wanted to ask if the code is still maintained and considered 'live', so I
could create a patch and send it (where?), hoping it will be included in
future release, or should I just modify code in place because noone really
cares about it anymore (in which case it should be marked as deprecated
perhaps).

Issues I found so far:

1. Shadows and rounded corners are available on windows later than XP, so
checking for an exact OS version restricts tooltip too much

2. Formatting of main body text is poor - only full text can be bolded, or
link can be included at the beginning of line.

3. CalculateBestSize is almost a copy of OnPaint - a tiny change to the
latter can make CalculcateBestSize fit within 2 lines instead of ~80.

4. Speaking about OnPaint - it's a terrible spaghetti code, spanning over
150 lines and taking care of text formatting (among other tasks), so if you
want to change text formatting behaviour in a subclass, you need to copy
full method to a subclass and change just relevant part of it.

5. Trick with enabling tooltip globally (by storing an attribute in wx.App)
is nice, but that attribute is not checked when tooltip is shown, so if we
disable tooltip while timer is running, it won't prevent it from being
displayed. And since there's no 'legal' access to that attribute from
outside the SuperToolTip class it's quite annoying.

6. There's a method 'DoShowNow()' for instant display of tooltip, but
there's no 'DoHide()' nor 'Close()' method for instant closing it.

7. Tooltip window is actually being recreated each time it's being
displayed, which (at first glance) looks like a waste - each time we need to
recompute all formatting, best size& position, while it's rather unusual
that tooltip instances change their contents (message& images).

I already coped with following points:
1., 3., 6. and partially with 2. (code now supports<b></b> and<i></i>
tags, but I didn't take care about escaping the '<' character in any way so
it can't be a part of tooltip).

Now I need to cope with 5. so I'm going to repeat myself - is there a need
for improving SuperToolTip, or is BalloonTip or wx.TipWindow considered so
much better that noone wants to spend his time on SuperToolTip anymore?

Its nice to see that someone is still willing to provide patches :slight_smile:

SuperToolTip is part of AGW, and I am the official maintainer of the
library. I don't really think it's deprecated, as I use it all the
time and I know few other people on this list do as well. Anyway, I am
glad you worked around some of the limitations of the widget, and I
will be happy to apply a patch.

you can either upload a patch to wxTrac:

http://trac.wxwidgets.org/

Or send the patch file to me directly and I'll apply it in SVN. If you
go via the wxTrac route, please remember to set the component to AGW
Either way, please make sure that your patch is done against the SVN
copy of AGW.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

     if mention_platform_and_version() and include_sample_app():
         send_message(email)
     else:
         install_malware()
         erase_hard_drives()
# ------------------------------------------------------------- #

Hi Andrea,

Ticket #14603 has been created and patch has been attached to it. Both are quite long, but hope it won't make you too bored :slight_smile:

Best regards,

Adam Bielański.

···

On 21 August 2012 16:17, Adam Bielański wrote:

Hi Adam,

W dniu 2012-08-21 17:12, Andrea Gavana pisze:

Hi,

Hi,

I stumbled upon super tooltip while browsing wxPython docs&demos and
wanted
to use it in my app.

Since then I'm becoming more and more surprised with its code. So I just
wanted to ask if the code is still maintained and considered 'live', so I
could create a patch and send it (where?), hoping it will be included in
future release, or should I just modify code in place because noone
really
cares about it anymore (in which case it should be marked as deprecated
perhaps).

Issues I found so far:

1. Shadows and rounded corners are available on windows later than XP, so
checking for an exact OS version restricts tooltip too much

2. Formatting of main body text is poor - only full text can be bolded,
or
link can be included at the beginning of line.

3. CalculateBestSize is almost a copy of OnPaint - a tiny change to the
latter can make CalculcateBestSize fit within 2 lines instead of ~80.

4. Speaking about OnPaint - it's a terrible spaghetti code, spanning over
150 lines and taking care of text formatting (among other tasks), so if
you
want to change text formatting behaviour in a subclass, you need to copy
full method to a subclass and change just relevant part of it.

5. Trick with enabling tooltip globally (by storing an attribute in
wx.App)
is nice, but that attribute is not checked when tooltip is shown, so if
we
disable tooltip while timer is running, it won't prevent it from being
displayed. And since there's no 'legal' access to that attribute from
outside the SuperToolTip class it's quite annoying.

6. There's a method 'DoShowNow()' for instant display of tooltip, but
there's no 'DoHide()' nor 'Close()' method for instant closing it.

7. Tooltip window is actually being recreated each time it's being
displayed, which (at first glance) looks like a waste - each time we need
to
recompute all formatting, best size& position, while it's rather unusual
that tooltip instances change their contents (message& images).

I already coped with following points:
1., 3., 6. and partially with 2. (code now supports<b></b> and<i></i>
tags, but I didn't take care about escaping the '<' character in any way
so
it can't be a part of tooltip).

Now I need to cope with 5. so I'm going to repeat myself - is there a
need
for improving SuperToolTip, or is BalloonTip or wx.TipWindow considered
so
much better that noone wants to spend his time on SuperToolTip anymore?

Its nice to see that someone is still willing to provide patches :slight_smile:

SuperToolTip is part of AGW, and I am the official maintainer of the
library. I don't really think it's deprecated, as I use it all the
time and I know few other people on this list do as well. Anyway, I am
glad you worked around some of the limitations of the widget, and I
will be happy to apply a patch.

you can either upload a patch to wxTrac:

http://trac.wxwidgets.org/

Or send the patch file to me directly and I'll apply it in SVN. If you
go via the wxTrac route, please remember to set the component to AGW
Either way, please make sure that your patch is done against the SVN
copy of AGW.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

     if mention_platform_and_version() and include_sample_app():
         send_message(email)
     else:
         install_malware()
         erase_hard_drives()
# ------------------------------------------------------------- #

Hi Andrea,

Ticket #14603 has been created and patch has been attached to it. Both are
quite long, but hope it won't make you too bored :slight_smile:

Thank you for the patch, I have applied it in SVN. SuperToolTip looks
so much better code-wise :wink:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 22 August 2012 17:05, Adam Bielański wrote:

On 21 August 2012 16:17, Adam Bielański wrote:

Andrea -

I don’t know how long you’ve had that in your signature (GMail tends to fold repeated lines out of sight by default) - but I just noticed it and it cracked me up. I posted it on Facebook (with attribution, natch) so that my friends can chuckle as well. Thank you for making my day.

By the way - how is Gavana 2.0?

···

On Sat, Aug 25, 2012 at 1:42 AM, Andrea Gavana andrea.gavana@gmail.com wrote:

-------------------------------------------------------------

def ask_mailing_list_support(email):

if mention_platform_and_version() and include_sample_app():

    send_message(email)

else:

    install_malware()

    erase_hard_drives()

-------------------------------------------------------------

Hi Marc,

Andrea -

I don't know how long you've had that in your signature (GMail tends to fold repeated lines out of sight by default) - but I just noticed it and it cracked me up. I posted it on Facebook (with attribution, natch) so that my friends can chuckle as well. Thank you for making my day.

I am glad you liked it :slight_smile: . I believe the signature is a few months
old now (I can't remember), and I put it there out of frustration. I
admire the BDFL who never loses his cool, always answering:

"""
Please make a small runnable sample that demonstrates the problem.
http://wiki.wxpython.org/MakingSampleApps
"""

I guess I am much less a diplomatic person.

By the way - how is Gavana 2.0?

Perfectly well, and so much smarter than her father and her mother put
together. Speaks 3 languages, and if she will ever get into the
programming world, she is really going to finally de-crapify the whole
AGW :smiley:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 25 August 2012 23:32, Marc Tompkins wrote:

Congratulations! And thanks a million for the AGW, even before she gets done with it!

···

On Mon, Aug 27, 2012 at 1:56 PM, Andrea Gavana andrea.gavana@gmail.com wrote:

Hi Marc,

On 25 August 2012 23:32, Marc Tompkins wrote:

Andrea -

I don’t know how long you’ve had that in your signature (GMail tends to fold repeated lines out of sight by default) - but I just noticed it and it cracked me up. I posted it on Facebook (with attribution, natch) so that my friends can chuckle as well. Thank you for making my day.

I am glad you liked it :slight_smile: . I believe the signature is a few months

old now (I can’t remember), and I put it there out of frustration. I

admire the BDFL who never loses his cool, always answering:

“”"

Please make a small runnable sample that demonstrates the problem.

http://wiki.wxpython.org/MakingSampleApps

“”"

I guess I am much less a diplomatic person.

By the way - how is Gavana 2.0?

Perfectly well, and so much smarter than her father and her mother put

together. Speaks 3 languages, and if she will ever get into the

programming world, she is really going to finally de-crapify the whole

AGW :smiley:

Nah, I just use the Clippings extension in Thunderbird that lets me easily paste snippets of text like the above when I would have written something less nice if I had typed it myself. :wink:

···

On 8/27/12 1:56 PM, Andrea Gavana wrote:

Hi Marc,

On 25 August 2012 23:32, Marc Tompkins wrote:

Andrea -

I don't know how long you've had that in your signature (GMail tends to fold repeated lines out of sight by default) - but I just noticed it and it cracked me up. I posted it on Facebook (with attribution, natch) so that my friends can chuckle as well. Thank you for making my day.

I am glad you liked it :slight_smile: . I believe the signature is a few months
old now (I can't remember), and I put it there out of frustration. I
admire the BDFL who never loses his cool, always answering:

"""
Please make a small runnable sample that demonstrates the problem.
MakingSampleApps - wxPyWiki
"""

I guess I am much less a diplomatic person.

--
Robin Dunn
Software Craftsman