Re: Change button color in button-press-event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi gtk@xxxxxxxxxx,

On Sat, 24 Apr 2010 14:02:26 -0400 you wrote:
> 
> This is for an embedded device with touch screen, no mouse.
> If I send activate signal from my code to a button, it turns blue and  
> then back to its initial color, as expected.
> When I press the button with my finger, I do get click event, but  
> button color never changes.
> I noticed that most of the time PRESS is received only when I remove  
> my finger from the button.

That sounds like the touch screen may not be providing the right
signals. If it's trying to distinguish between cursor movement and
clicking, it may be using the removal of the finger to signal both
press and release. If that is so, the "finger on button" condition
probably results in PRELIGHT rather than ACTIVE, but note that you will
not see the signal you're hooking up to set the colour. You could try
adding

     bg[PRELIGHT] = {0, 0, 1.0}

to your ButtonStyle, but the problem with that is the cursor probably
remains over the button after you've pressed it.


Rob
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux