issue on RichTextCtrl

Hi all. About RichTextCtrl i 'd put tooltip when mouse over url text.
I thought there was a SetToolTipString method in wx.richtext but there isn’t.

I googled but i do not found anything. Is it possible?

···


Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:

www.sqliteroot.com

Hi,

Hi all. About RichTextCtrl i 'd put tooltip when mouse over url text.
I thought there was a SetToolTipString method in wx.richtext but there
isn't.
I googled but i do not found anything. Is it possible?

import wx.richtext
help(wx.richtext.RichTextCtrl.SetToolTipString)

Help on method SetToolTipString in module wx._core:

SetToolTipString(*args, **kwargs) unbound wx.richtext.RichTextCtrl method
    SetToolTipString(self, String tip)

    Attach a tooltip to the window.

help(wx.richtext.RichTextCtrl.SetToolTip)

Help on method SetToolTip in module wx._core:

SetToolTip(*args, **kwargs) unbound wx.richtext.RichTextCtrl method
    SetToolTip(self, ToolTip tip)

    Attach a tooltip to the window.

Andrea.

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

···

On 8 March 2012 13:03, Fabio Spadaro wrote:

Hi,

import wx.richtext

help(wx.richtext.RichTextCtrl.SetToolTipString)

Help on method SetToolTipString in module wx._core:

SetToolTipString(*args, **kwargs) unbound wx.richtext.RichTextCtrl method

SetToolTipString(self, String tip)



Attach a tooltip to the window.

But I want to associate the tooltip a particular text

of the window rather than the whole window:

self.rtc.BeginStyle(urlStyle)

self.rtc.BeginURL(“http://wxPython.org/”)

self.rtc.WriteText(“The wxPython Web Site”)

#i 'd put tooltip when mouse over “The wxPython Web Site” text above

self.rtc.SetToolTipString(‘Hello’) #??? it is associated at window

self.rtc.EndURL();

self.rtc.EndStyle();

···

Il giorno 08 marzo 2012 13:43, Andrea Gavana andrea.gavana@gmail.com ha scritto:

Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:

www.sqliteroot.com

Then I guess you will have to roll out your own approach, maybe using
the RichTextCtrl HitTest method inside a wx.EVT_MOTION event handler
to see where the mouse is and placing the appropriate tooltip.

Andrea.

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

···

On 8 March 2012 14:32, Fabio Spadaro wrote:

Hi,

Il giorno 08 marzo 2012 13:43, Andrea Gavana <andrea.gavana@gmail.com> ha
scritto:

>>> import wx.richtext
>>> help(wx.richtext.RichTextCtrl.SetToolTipString)

Help on method SetToolTipString in module wx._core:

SetToolTipString(*args, **kwargs) unbound wx.richtext.RichTextCtrl method
SetToolTipString(self, String tip)

Attach a tooltip to the window.

But I want to associate the tooltip a particular text
of the window rather than the whole window:

    self\.rtc\.BeginStyle\(urlStyle\)
    self\.rtc\.BeginURL\(&quot;http://wxPython.org/&quot;\)
    self\.rtc\.WriteText\(&quot;The wxPython Web Site&quot;\)
    \#i &#39;d put tooltip when mouse over &quot;The wxPython Web Site&quot;  text

above
self.rtc.SetToolTipString('Hello') #??? it is associated at window
self.rtc.EndURL();
self.rtc.EndStyle();

The wx.TipWindow is one way that you can make your own tooltip-like feature.

···

On 3/8/12 5:46 AM, Andrea Gavana wrote:

On 8 March 2012 14:32, Fabio Spadaro wrote:

Hi,

Il giorno 08 marzo 2012 13:43, Andrea Gavana<andrea.gavana@gmail.com> ha
scritto:

import wx.richtext
help(wx.richtext.RichTextCtrl.SetToolTipString)

Help on method SetToolTipString in module wx._core:

SetToolTipString(*args, **kwargs) unbound wx.richtext.RichTextCtrl method
    SetToolTipString(self, String tip)

    Attach a tooltip to the window.

But I want to associate the tooltip a particular text
of the window rather than the whole window:

         self.rtc.BeginStyle(urlStyle)
         self.rtc.BeginURL("http://wxPython.org/&quot;\)
         self.rtc.WriteText("The wxPython Web Site")
         #i 'd put tooltip when mouse over "The wxPython Web Site" text
above
         self.rtc.SetToolTipString('Hello') #??? it is associated at window
         self.rtc.EndURL();
         self.rtc.EndStyle();

Then I guess you will have to roll out your own approach, maybe using
the RichTextCtrl HitTest method inside a wx.EVT_MOTION event handler
to see where the mouse is and placing the appropriate tooltip.

--
Robin Dunn
Software Craftsman