[wxPython-users] Re: STC: events & deleting

Robin Dunn robin at alldunn.com
Thu Dec 6 09:51:48 PST 2007


Ivan Voras wrote:
> Ivan Voras wrote:
> 
>> ...but it doesn't work. It's like the mask is getting ignored: if I try
>> your lines (with the mistake of not including INSERTTEXT), it still
>> generates insert events AND it generates them from calling InsertText()
> 
> It definitely looks like SetModEventMask doesn't work:
> modif: UserFlag B4-Insert  (1040), pos: 0, text: u'a\x00b', mask: 17
> modif: InsertText UserFlag  (17), pos: 0, text: u'abc', mask: 17
> modif: UserFlag B4-Delete  (2064), pos: 1, text: u'', mask: 17
> modif: DeleteText UserFlag  (18), pos: 1, text: u'b', mask: 17
> 
> The only event I should have received is the second one, 

Where are you calling SetModEventMask from?  Perhaps the STC is already 
in the process of calling the code that will send the event at the time 
you try to set the mask.


> and that would
> also be wrong since it's generated by InsertText().

Scintilla doesn't differentiate between sending events only for user 
actions and not programatic ones like wx usually does.  You'll need to 
put a guard in your event handler if you don't want to respond to 
programatic changes.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list