Disable/Enable inhibits further clicks on same button

Steven Van Ingelgem steven at vaningelgem.be
Sun May 11 12:10:46 PDT 2008


What I did is to set a "next_time_to_click" in the click handler
function, and give it a timeout of like 150ms or so... Worked fine :)

2008/5/11 Marco Cavallini <koansoftware at gmail.com>:
> Using wxGTK-2.8.6, I need to avoid repeated clicks on a button during some
> operation execution, and possibly to disable widgets in a window during
> operations, so I used  Disable() - Enable() (see code below).
>
> Unfortunately I stopped dealing with a strange problem, because after
> Disable() - Enable() all repeated clicks on the same button don't work.
> I have to click on another part of the window or on another button before
> being able to click to the same button again.
>
> So I wonder if this is known behaviour or a possible bug.
> In any case I would be grateful if someone could give me a hint about what
> could be a valid workaround.
>
> TIA
>
>
> EVT_BUTTON( ID_BITMAPBUTTON1, DlgTest::OnBitmapbutton1Click )
> ...
> void DlgTest::OnBitmapbutton1Click( wxCommandEvent& event )
> {
>        Disable() ;
>        m_txtctrl->AppendText("do something\n");
>        Enable() ;
>
>        event.Skip();
> }
>
> --
> /marco
> _______________________________________________
> wx-users mailing list
> wx-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users
>


More information about the wx-users mailing list