[wxPython-users] Can FindReplace dialog have accelerator key?
jeremy alexander
jccfifkf at yahoo.com
Sun Sep 3 22:43:00 PDT 2006
Hi Josiah,
Thanks for the tip about PyPE but I don't think it
applies to what I am trying.
I'm using the standard wxFindReplaceDialog widget
(pyPE doesn't seem to use the FindReplace dialog box).
The find loop in my application is using wxYield to
allow window updates. The dialog has a cancel button
which when pressed kills the dialog. I am trying to
also implement an abort feature in which the find is
stopped but the dialog remains. The plan was to use
an accelerator key (like 'Escape') which would result
in an abort flag being set; the find loop would then
monitor the flag.
Jeremy.
--- Josiah Carlson <jcarlson at uci.edu> wrote:
>
> jeremy alexander <jccfifkf at yahoo.com> wrote:
> >
> > 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?
>
> It is only really possible if your find/replace
> operation can be
> cancelled. What is more likely than not is that
> your find/replace is
> occurring in the same thread as all of your GUI
> handling code; and this
> is likely going to be the case if you are
> finding/replacing inside some
> text control.
>
> What I have personally done in PyPE is to only
> find/replace up to 10
> items at a time, then use wx.FutureCall(1, ...) to
> schedule another call
> to handle 10 more items in 1 ms. This allows the
> GUI to be redrawn, etc.
>
> Alternatively, in the find case, I have put a call
> to wx.Yield() in the
> main loop of a 'find all' command, and checked the
> status of a button
> that determines whether the search should stop or
> not.
>
> The details of each of these are in findbar.py and
> findinfiles.py inside
> the PyPE source distribution available from
> http://pype.sf.net .
>
> - Josiah
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail:
> wxPython-users-help at lists.wxwidgets.org
>
>
__________________________________________________
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