Disable/Enable inhibits further clicks on same button
Marco Cavallini
koansoftware at gmail.com
Mon May 12 01:31:32 PDT 2008
Steven Van Ingelgem ha scritto:
> 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 :)
Thank you for answering.
Do you mean into DlgTest::OnBitmapbutton1Click below ?
Actually I don't understand what do you mean with "next_time_to_click"
could you please explain?
>> 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();
>> }
More information about the wx-users
mailing list