Choice and Modal Dialog

Hello,

I have a strange issue if open a modal dialog from a choice option and the choice do not skip KILL_FOCUS event.

I attach a sample: Click on 'Advanced Options..' then the modal dialog show, but the choice popup is not closed and remains active.

NOTE: In the real life the choice is derived from a more complex widget that also capture the kill_focus event. In this case when the user press the option 3 i need stop the event to prevent its propagation to the main class.

System: Windows XP
WxPython version: 2.8.10.1 (msw-unicode)
Python: 2.5.4

¿Is there any way to close the Choice popup whithout skip kill focus event?

Thanks,

choice+modal.py (1.48 KB)

···

--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.

Hello,

···

2009/6/22 Oswaldo Hernández <listas@soft-com.es>:

Hello,

I have a strange issue if open a modal dialog from a choice option and the choice do not skip
KILL_FOCUS event.

I attach a sample: Click on 'Advanced Options..' then the modal dialog show, but the choice popup is
not closed and remains active.

NOTE: In the real life the choice is derived from a more complex widget that also capture the
kill_focus event. In this case when the user press the option 3 i need stop the event to prevent its
propagation to the main class.

System: Windows XP
WxPython version: 2.8.10.1 (msw-unicode)
Python: 2.5.4

¿Is there any way to close the Choice popup whithout skip kill focus event?

Use CallAfter to do the ShowModal so that it is done on the next
iteration of the event loop, that way the choice handler will finish
(and dismiss the listbox popup) before showing your modal dialog.

wx.CallAfter(dlg.ShowModal)

Cody

Cody Precord escribió:

Hello,

Hello,

I have a strange issue if open a modal dialog from a choice option and the choice do not skip
KILL_FOCUS event.

I attach a sample: Click on 'Advanced Options..' then the modal dialog show, but the choice popup is
not closed and remains active.

NOTE: In the real life the choice is derived from a more complex widget that also capture the
kill_focus event. In this case when the user press the option 3 i need stop the event to prevent its
propagation to the main class.

System: Windows XP
WxPython version: 2.8.10.1 (msw-unicode)
Python: 2.5.4

¿Is there any way to close the Choice popup whithout skip kill focus event?

Use CallAfter to do the ShowModal so that it is done on the next
iteration of the event loop, that way the choice handler will finish
(and dismiss the listbox popup) before showing your modal dialog.

wx.CallAfter(dlg.ShowModal)

wx.CallAfter(dlg.ShowModal) close de popup and shows the modal dialog, but i need read the dialog values before destroy it.

But working in that way, i found a solution: a method that make all the job and call it with CallAfter:

     def OnChoice(self, evt):
         ....
         wx.CallAfter(self.ShowAdvancedProps)

     def ShowAdvancedProps(self):
         dlg = mDialog(self, -1)
         dlg.ShowModal()
         # >> Read Dialog data
         dlg.Destroy()

Thanks Cody,

···

2009/6/22 Oswaldo Hernández <listas@soft-com.es>:

--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.