Re: emulating a button click by software



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


On Thu, 2006-12-07 at 13:33 +0000, Ricardo Cruz wrote:
>  Already replied to you:
> 
>  Try sending an "activate" signal and see if that works. Otherwise, you may 
> have to do a hack like:
> 
> button->depressed = TRUE;
> gtk_widget_queue_draw (button);
> install a gtimeout for 250 ms or so
> 
> and in timeout:
> button->depressed = FALSE;
> gtk_widget_queue_draw (button);
> 
> Cheers,
>  Ricardo
> 
> lacasta ific uv es wrote (@ Segunda, 4 de Dezembro de 2006 23:14):
> > Hello,
> >
> > I am trying to emulate a button click by software. The idea is that I
> > have an application that reacts when a button-like (toggle_button,
> > radio_button) widget is clicked, and I would like to make it believe
> > that one of those buttons have been clicked. I've tried with
> > gtk_button_toggle() with a radio button (also with
> > gtk_button_clicked() to see whether that was triggering something
> > else) but to no avail. The program reacts to the signal, but the
> > widget stays the same, that is the radio button does not change on the
> > window. How can I do that ?
> >
> > Regards,
> >
> > Carlos
> >
> 
-- 
 ___________________________________________________________________
 Carlos  Lacasta                        
 ^^^^^^^^^^^^^^^                            
                            Inst. de Fisica Corpuscular (IFIC)      
                            Edificio Institutos de Investigacion 
                            P.O. Box 22085                     
                            E-46071 VALENCIA
                            Spain
 Tel.: +34 96  354 3490                    
 Fax.: +34 96  354 3488    
 Carlos Lacasta ific uv es                
 ___________________________________________________________________




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