Paul Barton-Davis wrote:

> In message <000701bfbb97$fa709040$[EMAIL PROTECTED]>you write:
> >Hello,
> >I've written a little calculator with a numeric pad. I've bound keys to the
> >buttons signals, I mean that when i press '7' on the keyboard, the button
> >labeled '7' emits the "clicked" signal, doing the appropriate stuff.
> >But I expected that the button would really looks like if 'clicked'. I mean
> >getting the focus, being depressed, changing its color, etc...
> >I can see that the signal is really emitted, but the look of the button
> >doesn't change. I've tried to emit all of the possible signals for the
> >button, added delays to see better, but nothing happened.
> >
> >Does anyone has an idea ?
>
> my guess it that you're using regular buttons, whose appearance
> doesn't really change except between a button press and a button
> release. if you are using the clicked signal, then unless you use a
> toggle button, i wouldn't expect to see very much.
>
> --p
>
> --
> To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

This is a "bug" in GTK, because regular buttons only get visually pressed or
depressed when you use mouse. When you use the keyboard, or the "pressed"
signals, nothing (visually speaking) will happen. Anybody can change this? I
tried to solve it for a long time, but my understanding of the GTK internals is
very basic.
However I can say that the problem is the following:

When you press a regular button through the keyboard, the gtkwindow.c module
(in the keypress signal handler) sends an "activate" signal to the regular
button. And this signal produces another one: the "clicked" signal, that the
programmer can receive, but that doesn't handle the visualization of the
depression of the button.
However, mouse clicks are handled differently. The button installs
"button_press_event" and "button_release_event" handlers, that in turn call
some routines to visually draw the changes on the button.

These two paths to the same pressed, released, clicked signals on the
gtkbutton.c code (one for the mouse and other for keyboard, etc.) is bad, and
produces this ugly and (again visually) inconsistent behaviour.


-- 
To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

Reply via email to