Re: help with window widgets



 I tried to follow your idea and this is what I did :

> main()
> {
> 	// I made ALL widgets necessary for program
> 	
> 	// enter while loop to read all values from stdin
unsigned int val;
char buf[5];
	read(STDIN_FILENO, &val, sizeof(int));   //1st voltage not used
	read(STDIN_FILENO, &val, sizeof(int));   //2nd voltage not used

while(read(STDIN_FILENO, &val, sizeof(int)))
{
	char temp[5];
	//read(STDIN_FILENO, &val, sizeof(int));
	buf[0]=ita(val/100);
	buf[1]=ita((val-((val/100)*100))/10);
	buf[2]='.';
	buf[3]=ita(val-((val/10)*10));
	printf(" reading %d",val);
	
    strcat(buf," V");
    gtk_entry_set_text(GTK_ENTRY(text_entry_Widget), buf); // update text
into widget

	read(STDIN_FILENO, &val, sizeof(int));
	buf[0]=ita(val/100);
	buf[1]=ita((val-((val/100)*100))/10);
	buf[2]='.';
	buf[3]=ita(val-((val/10)*10));
	buf[4]='\0';
	printf(" reading %d",val);

    //volt insert
	strcat(buf," V");
    gtk_entry_set_text(GTK_ENTRY(text_entry_Widget2), buf); // update text
into widget

}      //with the while loop closing here I have this error:
       //(<unknown>:4436): Gtk-WARNING **: Attempting to add a widget with
type GtkVBox to a container of type GtkHBox, but the widget is already
inside a              //container of type GtkHBox, the GTK+ FAQ at
http://www.gtk.org/faq/ explains how to reparent a widget.

  gtk_widget_show_all (window);

  gtk_main ();
   
// if I close the while loop here I only have one voltage output and it
can't refresh

  return 0;
> 	
> }

I don't know if it has something to do with "reparent widget" function, I
tried to read about it but I don't get it...

Thanks, do you have any idea what could cause this ?


-- 
View this message in context: http://www.nabble.com/help-with-window-widgets-tf2615494.html#a7325351
Sent from the Gtk+ - General mailing list archive at Nabble.com.




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