wxPython issues

Francesco scrutinizer at gmx.at
Sun Feb 1 11:46:54 EST 2004


Hello,

I have some questions:

1.
this is in Mainthread:
    def OnOverwriteDlg(self, event):
        print "OnOverwriteDlg"
        dlg = COverwriteDlg ()
        dlg.m_strInfo = g_strTitle
        g_nGuiResult = dlg.ShowModal()
  ???      g_objGUISyncSemaphore.release ()
(not working)

that is in worker thread:
    print "DlgOverwriteThreadsafe"
    g_strTitle = _("Overwrite %s ?") % strFile

    event = wxCommandEvent ()
    event.SetEventType (wxEVT_COMMAND_BUTTON_CLICKED)
    event.SetId (19999)
    pFrm = wxGetApp().GetFrame()
    if(pFrm):
        wxPostEvent(pFrm, event)

    #wxpython: do not use this
    ????#wxYield()
    #//wait for GUI to end with owerwrite dialog

    print "before"
   ???? g_objGUISyncSemaphore.acquire()
    print "after"
    print g_nGuiResult
    return g_nGuiResult

How can I get, that in worker thread on "before" is waiting, until the
dialog in mainthread is finished?


wxYield, Semaphore, Mutex, ... is all a bit strange for me.
Is there any website dedicated to this issues?

2. I want to get a list icons from the windows shell folders and put
it in the wxPython List control. How can I accomplish this?

3. 
  menuAdd(self, pMenuFile, _("Exit") +"\tAlt+F4", _("Exit"),
self.OnClose, wxID_CLOSE)
    def OnClose(self,event):
        #store startup preferences
the onclose is called by ending the program via menu or Alt-F4.
but if i quit the program with the mouse right above, the onclose will
not be called.

Many thanks in advance,


-- 
Francesco



More information about the Python-list mailing list