Re: Change button color in button-press-event
- From: Robert Pearce <rob bdt-home demon co uk>
- To: gtk-list gnome org
- Subject: Re: Change button color in button-press-event
- Date: Sat, 24 Apr 2010 21:19:18 +0100
Hi gtk digosp com,
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]