Re: Button press



On 06 Feb 2002 16:40:22 +0100
Sven Neumann <sven gimp org> wrote:

> Hi,
> 
> David Eduardo Gomez Noguera <davidgn servidor unam mx> writes:
> 
> > I wanted to make a button behave lika a keyboard key, in that if i leave the key pressed, it will repeat.
> > Thus i connected a button widget to a pressed signal, but when i press it its like sometimes it was kust once, and other times 20 times at once or so. (The button is supossed to increment the content of a label).
> > How can i make it so that if i  held the button pressed, the signal will repeat itself, but with a small, but noticeable, delay? or is this in the FAQ?
> > 
> 
> use a timeout:
> http://developer.gnome.org/doc/API/gtk/gtk-general.html#GTK-TIMEOUT-ADD
> 
> 

Thank you.
I was just thinking what would be the best way of action. 
Have the function registered on a button pressed event, and removed on a button realeased event?
or have a gtlobal static variable set to TRUE, and the function registered on a button press, and have the button release set the var to FALSE? (that variable would be the return fariable.
I guess the firstone is better (more secure and less error prone), but would like to hear some advices.

Thank you again.

> Salut, Sven
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list


-- 
ICQ: 15605359 Bicho
                                  =^..^=
First, they ignore you. Then they laugh at you. Then they fight you. Then you win. Mahatma Gandhi.
........Por que no pensaran los hombres como los animales? Pink Panther........
-------------------------------気検体の一致------------------------------------
暑さ寒さも彼岸まで。
アン アン アン とっても大好き




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