--
You received this message because you are subscribed to a topic in the Google Groups "wxPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/Rs0ASUzidGk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wxpython-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
What I actually want is for the TextCtrl widget itself to scroll up while displaying.I am not interested in animating the text in the TextCtrl. I want to animate the TextCtrl widget to appear gradually from bottom to top.
self.gTextCtrl = tc = wx.TextCtrl(self, wx.ID_ANY, '',
style=wx.BORDER_SUNKEN |
wx.TE_MULTILINE |
wx.TE_NOHIDESEL |
wx.TE_RICH2 | wx.TE_AUTO_URL |
wx.TE_READONLY
)
# In case user for example creates the dialog then sets the font
# on the dialog or the textctrl(maybe the user needs a mono font...)
# we need to update the message so the auto url shows up and works right.
# so we will override SetFont.
tc.SetFont = self.SetFont
tc.SetValue(message) # Update AutoURL after creation.
tc.Bind(wx.EVT_TEXT_URL, self.OnTextURL)
tc.SetHelpText(_(u'This is the scrolled message dialog text.'))
def SetFont(self, font):
"""
Sets the font for this window.
SetFont(self, Font font) -> bool
:param `font`:
:type `font`: `wx.Font`
:returns: Whether the font was successfully set.
:rtype: bool
"""
print(self)
boolean = super(wx.TextCtrl, self.gTextCtrl).SetFont(font)
self.gTextCtrl.SetValue(self.gTextCtrl.GetValue())
return boolean
def OnTextURL(self, event):
"""
Handles the ``wx.EVT_TEXT_URL`` event for :attr:`gTextCtrl`
:param `event`: A `wx.TextURLEvent` to be processed.
:type `event`: `wx.TextURLEvent`
"""
mouseEvent = event.GetMouseEvent()
if mouseEvent.LeftDClick():
urlStart = event.GetURLStart()
urlEnd = event.GetURLEnd()
url = self.gTextCtrl.GetRange(urlStart, urlEnd)
webbrowser.open_new_tab(url)