[wxPython-users] Activating a clas from __init__ (without using
wx.EVT_KEY_DOWN)
Walter Igo
walterigo at yahoo.com
Wed Jul 19 11:48:33 PDT 2006
Thanks that is the command I was looking for. This group is a great help to me. I am making progress every day. sometimes not as much as I like, but progress never the less.
----- Original Message ----
From: Josiah Carlson <jcarlson at uci.edu>
To: Walter Igo <walterigo at yahoo.com>; wxPython Suport list. <wxpython-users at lists.wxwidgets.org>
Sent: Tuesday, July 18, 2006 11:57:41 PM
Subject: Re: [wxPython-users] Activating a clas from __init__ (without using wx.EVT_KEY_DOWN)
Walter Igo <walterigo at yahoo.com> wrote:
> I want to actavte the OnAutoFill Class so it will look at the
> StyledTextCtrl to autocomplete the word (not implemented yet) I have
> tried wx.EVT_Key_down, but this has led to problems. I just want it to
> repeat the OnAutoFill activated message.
You could use the stc.EVT_STC_CHARADDED event...
> class MySTC(stc.StyledTextCtrl):
> def __init__(self, parent, size=wx.DefaultSize, style=0):
> stc.StyledTextCtrl.__init__(self, parent, size=size, style=style)
self.Bind(stc.EVT_STC_CHARADDED, self.OnAutoFill)
>
> def OnAutoFill(self,event):
> print "OnAutoFill Activated"
p = self.GetCurrentPos()
st = self.WordStartPosition(p, 1)
en = self.WordEndPosition(p, 1)
#The current "word" is self.GetTextRange(st,en)
[snip]
- Josiah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20060719/e642af09/attachment.htm
More information about the wxpython-users
mailing list