Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'bug': 0.02; 'subject:using': 0.04; 'wxpython': 0.07; 'googling': 0.09; 'graph': 0.09; 'libraries.': 0.09; 'loop.': 0.09; 'reason.': 0.09; 'says,': 0.09; 'skip:" 60': 0.09; 'subject:canvas': 0.09; 'subject:trouble': 0.09; 'tkinter': 0.09; 'wed,': 0.12; 'am,': 0.13; 'gui': 0.13; 'wrote:': 0.15; '__init__': 0.16; 'canvas.': 0.16; 'embed': 0.16; 'matplotlib': 0.16; 'skip:\xa0 50': 0.16; 'subject:creating': 0.16; 'skip:" 40': 0.16; 'cc:addr:python- list': 0.16; 'cheers,': 0.19; "haven't": 0.21; 'figure': 0.21; 'java': 0.21; '(most': 0.21; 'cc:2**0': 0.21; 'loop': 0.22; 'maybe': 0.22; 'cc:no real name:2**0': 0.22; 'header:In-Reply- To:1': 0.22; 'code.': 0.22; 'trying': 0.23; 'creating': 0.24; 'traceback': 0.25; 'function': 0.26; 'work.': 0.28; '.net': 0.28; 'bit': 0.28; 'all,': 0.28; 'message-id:@mail.gmail.com': 0.28; 'object': 0.30; 'cc:addr:python.org': 0.30; 'error': 0.31; 'rather': 0.33; 'possible,': 0.34; 'couple': 0.34; 'last):': 0.35; 'pretty': 0.35; 'running': 0.35; 'trouble': 0.37; 'some': 0.37; 'but': 0.37; 'could': 0.37; 'using': 0.37; 'getting': 0.38; 'received:google.com': 0.38; 'received:209.85.161': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'created': 0.38; 'should': 0.39; 'correctly': 0.39; 'event': 0.39; 'received:209': 0.40; 'your': 0.60; 'below.': 0.65; 'displayed.': 0.84; 'net,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=3E7QtcwSDowNvHIq5jq30aa86icQzBqbxx71ItN4fSw=; b=wBjfVehEiExm+dbpmbxFFH1/LF8pNabY9+XLkTkhBk42ddDLMztazMiI37KyFX0Olw uRDwXlyclaPkpv8UlYruhwPOgTOfzOWPIYJY6XQ9hkWvx0Xf+271hNbMba8PcDiNxTXz Hy01IJB9S+hWeLzXI0WhELRsJIgBbRslzwH8k= MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Wed, 6 Jul 2011 12:32:59 -0600 Subject: Re: trouble creating tooltips using Wx in Tk canvas To: Ravikanth Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1309977210 news.xs4all.nl 21794 [2001:888:2000:d::a6]:33877 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8969 On Wed, Jul 6, 2011 at 9:12 AM, Ravikanth wrote= : > Hi all, > Hi all, > > I am having a trouble creating tooltips. I am trying to embed a > matplotlib graph inside =A0a TkInter canvas. After some search over the > net, I found out a way to create tooltips using the WXbackend. > But when I embed my matplotlib figure inside a Tk and =A0the tooltips > are not getting displayed. That's pretty much what I would expect, since wxPython and Tkinter are completely different GUI libraries. Trying to use them together is a bit like trying to call a .NET function from Java -- maybe possible, but it's going to take a lot of work. > The error I am getting is below. > > Traceback (most recent call last): > =A0File "U:\graphing_tool\plotinsideTkInter\plotInTk.py", line 12, in > > =A0 =A0tooltip =3D wx.ToolTip(tip=3D'tip with a long %s line and a newlin= e\n' > % (' '*100)) # needs to be added to getover the bug with tooltip. > =A0File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py", > line 771, in __init__ > =A0 =A0_misc_.ToolTip_swiginit(self,_misc_.new_ToolTip(*args, **kwargs)) > PyNoAppError: The wx.App object must be created first! > > I am not able to figure out the reason. As it says, you haven't created the wx.App object necessary for pretty much all wxPython code. You could create one, but your tooltip still would not work correctly because you would be running the Tkinter event loop rather than the wxPython event loop. If you want to use the wxToolTip widget, then you should write your program to use wxPython only. Alternatively, googling for "tkinter tooltip" turns up a couple of recipes; you could try one of those. Cheers, Ian