Re: How to temporarily disable an event handler

Igor Korot <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <CA+FnnTwqNkOawdmZsodSMN19sG+gr2aZACONZSsq8SS0idnc-Q@mail.gmail.com>
Hi,

On Tue, Aug 29, 2023 at 2:51 PM Andreas Falkenhahn
<[email protected]> wrote:
>
> I'm listening to wxEVT_LIST_ITEM_SELECTED for my wxListCtrl. That event also triggers when my app calls the Select() method to select an item. What is the typical way to prevent Select() from firing the event? Should I simply unbind and then bind again or how is this typically done? E.g. should I do something like this: (pseudo-code)
>
>     lv->Unbind(wxEVT_LIST_ITEM_SELECTED);
>     lv->Select(item);
>     lv->Bind(wxEVT_LIST_ITEM_SELECTED);

This should work just fine.
Do you have any issues with that?

Thank you.

>
> What's the recommended way to temporarily disable event handlers like wxEVT_LIST_ITEM_SELECTED?
>
> --
> Best regards,
>  Andreas Falkenhahn                          mailto:[email protected]
>
> --
> Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
> ---
> You received this message because you are subscribed to the Google Groups "wx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/539402955.20230829215214%40falkenhahn.com.

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/CA%2BFnnTwqNkOawdmZsodSMN19sG%2Bgr2aZACONZSsq8SS0idnc-Q%40mail.gmail.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.