Lazarus

Programming => Widgetset => GTK => Topic started by: kapibara on January 27, 2022, 11:49:54 am

Title: Toolbar button not returning from pressed state.
Post by: kapibara on January 27, 2022, 11:49:54 am
Toolbar buttons appear as not returned to "unpressed" state after clicking them to show a messagedialog and dialog has gone away.  When mouse pointer is moved inside main form, the toolbutton reacts and appears without the "pressed" frame around it.

Is there a workaround for this? Is it a bug?

Small demo of the problem attached.
Title: Re: Toolbar button not returning from pressed state.
Post by: trev on January 27, 2022, 11:52:39 am
I'm assuming Linux, but which widget set and window manager?
Title: Re: Toolbar button not returning from pressed state.
Post by: Zvoni on January 27, 2022, 12:01:10 pm
at a guess: you're in the Click-Event calling a modal MessageDlg, which stops execution of code as long the Dialog is not answered.
Have you tried using the MouseUp-Event instead of Click?
Title: Re: Toolbar button not returning from pressed state.
Post by: kapibara on January 27, 2022, 12:05:54 pm
Widgetset is GTK2. Window manager is KWin. (KDE Plasma default)

Title: Re: Toolbar button not returning from pressed state.
Post by: kapibara on January 27, 2022, 12:10:02 pm
@Zvoni: this remains after the message dialog has gone away.

I tried putting the code for the dialog in the MouseUp event, but same thing happens.

Moving the mouse a little returns the button to normal.
Title: Re: Toolbar button not returning from pressed state.
Post by: Zvoni on January 27, 2022, 01:22:07 pm
So, something in the MouseOver-Event of the Widget-Source itself changes the "Bitmap" of the Button/changes the "status" of the button (from "pressed" to "unpressed")

Maybe a Refresh (Validate or something)?
Title: Re: Toolbar button not returning from pressed state.
Post by: kapibara on January 27, 2022, 03:21:10 pm
Tried that plus many other things, but the button stays "down" anyway, until mouse is moved. Went through the sources of TForm, its anscestors, TToolBar and TToolButton but didn't become any wiser.  :)
Title: Re: Toolbar button not returning from pressed state.
Post by: zeljko on January 28, 2022, 11:12:21 am
That can be caused by theme drawer in LCL
TinyPortal © 2005-2018