|
From: Kevin A. <al...@se...> - 2007-06-30 06:40:52
|
There are a couple of issues to deal with. Normally, you need to have
your event handler finish before wx is going to process the next
event. Since you want to change the component size during the select,
the event for that would occur after your handler finishes. On some
platforms the resize of the component is probably deselecting the
list, though this might be a bug, I'm not sure. I don't have your
specific code, but you probably just want to call the redraw() method
which is defined for all components to force an update after you
change the component size. The method as defined in widget.py looks
like this:
def redraw(self):
"""Force an immediate redraw without waiting for an event
handler to finish."""
self.Refresh()
self.Update()
You would make a call such as...
event.target.redraw()
If you're losing the selection after the redraw you might be able to
do just redo the selection...
temp = event.target.selection
# resize
# redraw
event.target.selection = temp
something like that. Depending on the platform, it might be necessary
to do some other tweaks.
ka
On Jun 29, 2007, at 5:58 PM, John Henry wrote:
> Hi list,
>
> After I'm done with an event and I wish PythonCard to
> continue processing that event, don't I have to stuff
> the event back onto the event queue?
>
> For instance, let say I wish to change the width of a
> combo box when the user click on the selection list.
> I need to do this at run time because there is no
> space for the field at design time. So, I set up a
> event handler for the "select" event and change the
> width. But then if I don't do anything, the list
> won't even open right. If I do a event.skip(), the
> field gets wider, but then I have to click on the
> selection again. So, it appears that I need to
> redispatch the "select" event after I'm done with it.
>
> At least that's what one has to do in native Windows
> programming.
>
> Anybody knows?
>
> Regards,
>
>
>
>
> --
> John Henry
|