Re: problem whit a chek button



I think what you want to do is connect to the "clicked" signal on the
check button.

I'm much more versed in gtkmm than gtk, but I think you would still
connect to it as you would a normal button:
http://www.gtk.org/tutorial/ch-buttonwidget.html#SEC-NORMALBUTTONS

After you do that, put this inside the handler function:

			   //printf ("%d\n ",bo);
> 			   ncnt = read(outfd, hn, sizeof(hn));
> 			   bo=getpid();
> 			    printf ("%d\n ",bo);
>             if (ncnt > 0) 
> 			{
> 			 
>                printf("fatto");
>                fflush(stdout);
>                sleep(5);
> 			 }
> 		 } 
> 

I may have missed a } or two there, but the indenting was hard to
quickly read, but I'm sure you know anyway what I mean.  :)

Mark

On Wed, 2002-12-25 at 19:16, Mauro Venanzi wrote:
> hi
> 
> i wuold like to stop a cicle when
> a chebutton turn up
> i have found the gtk_toggle_get_active function
> i'm tring it ,but i can't stop the cicle whit this function
> 
> here is a piece of code 
> someone can give me an example  to do this???
> 
> 
> while (1)
> 	       {
>             if(bo=gtk_toggle_button_get_active (checkbutton)==1)
> 			{
> 			   //printf ("%d\n ",bo);
> 			   ncnt = read(outfd, hn, sizeof(hn));
> 			   bo=getpid();
> 			    printf ("%d\n ",bo);
>             if (ncnt > 0) 
> 			{
> 			 
>                printf("fatto");
>                fflush(stdout);
>                sleep(5);
> 			 }
> 		 } 
> 		 }
> 
> }
> }
> eccc
-- 

Mark
http://www.utdallas.edu/~mej017200/




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