Re: trouble creating tooltips using Wx in Tk canvas



On Jul 6, 1:32 pm, Ian Kelly <ian.g.ke...@xxxxxxxxx> wrote:
On Wed, Jul 6, 2011 at 9:12 AM, Ravikanth <vvnrk.vanapa...@xxxxxxxxx> wrote:
Hi all,
Hi all,

I am having a trouble creating tooltips. I am trying to embed a
matplotlib graph inside  a 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  the 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):
 File "U:\graphing_tool\plotinsideTkInter\plotInTk.py", line 12, in
<module>
   tooltip = wx.ToolTip(tip='tip with a long %s line and a newline\n'
% (' '*100)) # needs to be added to getover the bug with tooltip.
 File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py",
line 771, in __init__
   _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

Thank you Ian for your insights to me on this.
I will migrate to wxPython to achieve the functionality.
.



Relevant Pages

  • Re: trouble creating tooltips using Wx in Tk canvas
    ... I am having a trouble creating tooltips. ... matplotlib graph inside  a TkInter canvas. ... That's pretty much what I would expect, since wxPython and Tkinter are ...
    (comp.lang.python)
  • Re: WxPython versus Tkinter.
    ... who shares my in-depth knowledge of Tkinter. ... that mirrors the wxPython ListCtrl in functionality. ... Only that tkinter has widgets wxPython does not. ... toolkits have strengths and weaknesses, ...
    (comp.lang.python)
  • Re: Tkinter: The good, the bad, and the ugly!
    ... appreciate and use Tkinter extensively and your input is most welcome ... button) that wrap native widgets in a manner similar to wxPython. ... packages that are not dependent on binary Tk extensions, ...
    (comp.lang.python)
  • Re: Tkinter vs. wxPython?
    ... wxPython will not "replace" Tkinter ) if you mean that Tkinter will ... such as Pmw and is still the most extensively documented Python GUI. ... many more resources than I could find for wxPython. ... via TCP/IP to that "app" from my Tkinter app with print instructions and the ...
    (comp.lang.python)
  • RE: Tkinter vs. wxPython?
    ... I wrote a small application in wxPython, ... I found Tkinter, ... La información contenida en este mensaje y cualquier archivo anexo al mismo, ... en cualquier medio magnético) que pueda haber realizado del mismo. ...
    (comp.lang.python)