Re: emulating a button click by software



Holla Carlos,

 Not sure what you mean... I have made you a couple of tests, one with an 
ordinary button, the other with radio buttons, and you can see it's really 
simple:
http://rpmcruz.planetaclix.pt/trash/button-click.c
http://rpmcruz.planetaclix.pt/trash/radio-click.c

 No need for any hack. You don't even need to do anything unusual. Just do 
your normal connection to "clicked" / "toggled" and whenever you want to 
programatically click on a button, send an "activate".
 On the toggle callback of a radio button, you must check its state to see if 
it was pressed or released. But this is no different than if it was "humanly" 
pressed.

 Hope that helps.

Cheers,
 Ricardo

Carlos Lacasta wrote (@ Segunda, 11 de Dezembro de 2006 08:12):
> Many thanks for the hack Ricardo,
>
> It turned out that I was doing something wrong: I was "deactivating" a
> radio button of a group with just 2 of them, hoping that this would
> trigger the other button activation. However, I did manage to leave the
> application in a fancy state, that is, what happens if none of the
> radiobuttons in a group is activated ?
>
> REgards,
>
> Carlos
>
-- 
Reisner's Rule of Conceptual Inertia:
	If you think big enough, you'll never have to do it.



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