More on tool tips

Larry Bates larry.bates at websafe.com
Wed Nov 21 15:23:29 PST 2007


I know it may not help much, but I'm using the same combination of tools (except 
wxWindows 2.8.4.0) and my tooltips are working fine, even in py2exe "frozen" 
applications.

Can you try making a small change?

     butt = wx.Button(self, -1, "Press me")
     s = "Go ahead, make my day"
     butt.SetToolTipString(s)

At least that is how I set mine and it is worth a try.

-Larry

Paul Cornelius wrote:
> All:
> 
> The following program works as expected in the Python 2.5 environment 
> (i.e., the ToolTip appears when you mouse over the button):
> 
> import wx
> 
> class MainWindow(wx.Frame):
>    def __init__(self):
>        wx.Frame.__init__(self,None,-1,"Test tool tips")
>        butt = wx.Button(self,-1,"Press me")
>        s = "Go ahead, make my day"
>        butt.SetToolTip(wx.ToolTip(s))
>        self.Show(True)
> 
> def runapp():
>    app = wx.PySimpleApp()
>    MainWindow()
>    app.MainLoop()
> 
> runapp()
> 
> I build this program into an executable using the following setup script:
> 
> import py2exe
> from distutils.core import setup
> 
> win0 = {
>    "script" : "tt.py",
> }
> 
>                                setup(version="0.0",
>    description = "Test program for tool tips",
>    windows = [win0],
>    # options = {"py2exe": {"bundle_files" : 1,"optimize" : 
> 2,"compressed" : 1}}
>    )
> 
> I invoke the script with setup py2exe.  The resulting program runs but 
> there is no ToolTip above the button.  Commenting back in the last line 
> of the build script makes no difference.  Changing the main script to 
> butt.SetToolTipString("Go ahead, make my day") instead of having two 
> lines makes no difference.
> 
> How can a py2exe build differ from a .py program?  Does anybody 
> understand what's going on?
> 
> My tools are wxPython 2.8.6.1, Python 2.5.1, py2exe 0.6.6, pywin32 2.10.
> 
> Paul Cornelius





More information about the wxpython-users mailing list