[lazarus] Tab generates error

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Sep 23 04:04:18 EDT 2003

On Tue, 23 Sep 2003 00:50:54 -0500
Tony <tony at maro.net> wrote:

> This is odd...
> Doubleclicking a control generates three events in this order:
> WMLMButtonUp
> WMLMButtonDblClk
> WMLMButtonUp
> This causes me grief because if I use setfocus during the dblclk event, 
> the next buttonup event will set the focus to NO control, 

I don't know, what control you mean, but that's probably done by the gtk.

> despite the 
> fact that I'm not setting focus within the event handler.  What then 
> happens is that if you hit tab after a doubleclick on the TCheckbook 
> control, the program crashes saying that you can't focus an invisible 
> control.  The crash is generated by the TControl.Tabhandler or something 
> like that... not by my code directly.

Can you send a backtrace?

> I've added a workaround to detect if I'm getting the duplicate buttonup 
> message immediately following the doubleclick, and set a focus within 
> that event to the control I want.

I hope focussing will work better in the gtk2.


More information about the Lazarus mailing list