[wxPython-users] info bubble and annotation over grid cell UPDATED

Robin Dunn robin at alldunn.com
Sat Nov 4 22:05:00 PST 2006


Timothy Smith wrote:
> Robin Dunn wrote:
> 
>> Timothy Smith wrote:
>>
>>> ok after some playing around i've found the problem lies with using 
>>> the transient window, it grabs focus and won't let go. so i've 
>>> decieded to go with making my own custom frame and drawing my info on 
>>> it. that way i get exactly what i want.
>>> i'm still stumped on why i can't edit my timectrl's inside the cell 
>>> though...
>>
>>
>> When the cell editor is created you push a new wx.EvtHandler onto the 
>> widget's event handler chain.  This wx.EvtHandler has an event binding 
>> for EVT_KILL_FOCUS such that when the widget loses focus it calls grid 
>> methods that complete the edit session and hide the editor.  (It 
>> assumes that if some other widget is getting focus then you are done 
>> editing.) Since your control has child controls, then it loses the 
>> focus as soon as you try to activate the child.  So you can avoid this 
>> behavior by not calling PushEventHandler, but you'll also lose the 
>> other built-in functionality of handling the Enter or ESC keys, but 
>> you can probably take care of those yourself without too much hassle.
>>
>>
> ahh yes it works. i'm not concerned about enter or esc keys really. if 
> it's needed i can add it later.
> i commented out
> #if evtHandler:
>        #    self._tc.PushEventHandler(evtHandler)
> 
> from my edit control, i can edit the cell however now when i close the 
> app i get a seg fault? not when i edit, but when i close the app.

The grid probably expects that there is an wx.EvtHandler pushed onto the 
control and is trying to pop it and delete it.  Try pushing a dummy 
instance on instead.


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





More information about the wxpython-users mailing list