Can FindReplace dialog have accelerator key?

jeremy alexander jccfifkf at yahoo.com
Sat Sep 2 19:03:55 PDT 2006


Hi,

I'm trying to add an accelerator key to a findReplace
dialog.  The reason is that the find operation can
take a long time and I'd like to give users a shortcut
key to abort the find operation.  Is this possible?

An example of what I tried is in a code snippet below.
 It basically creates the findReplace dialog and then
creates an accelerator table.  The entry in the table
specifies a menu id from a parent window.
I didn't get any errors  running the application but
the accelerator key did not work.

I'm using Python 2.4.3, wxPython 2.6.3.2, Windows XP
SP2.

Thanks,

Jeremy.
==================================

    def OnFind(self, event) :
        # find button pressed
        dlg =
wx.FindReplaceDialog(self.masterpanel.listmaxpanel,
                           
self.masterpanel.listmaxpanel.finddata, "Find",
style=wx.FR_NOWHOLEWORD)


        # shortcut for escape
        accelrow =
wx.AcceleratorEntry(wx.ACCEL_NORMAL, wx.WXK_ESCAPE,
gui.root.menuparameters[gui.root.ESCAPE_INDEX] \
                                   
[gui.root.MENUGUI_ID_INDEX])
        accelentrylist.append(accelrow)

        acceltable =
wx.AcceleratorTable(accelentrylist)
        dlg.SetAcceleratorTable(acceltable)

        ...



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the wxpython-users mailing list