Hi,
I have problem while adding a child to a GtkVBox. The VBox is inside a GtkViewPort which is inside a ScrolledWindows.
After the child it's added using gtk_box_pack_end I check if it's really added checking the GLIST and it appears that it's added. Although visually anything appears and the scrolled window gets really big. Like if something really big and invisible was added.
The code is as follows:
GtkWidget *child;
switch (response_id) {
case GTK_RESPONSE_ADD:
//The see the code for this function read the other
//piece of code i'm posting
child = (GtkWidget *)newChild();
gtk_box_pack_end((GtkBox *)protocolsBox, child, 0, 1, 0);
GList *temp = gtk_container_get_children((GtkContainer *) protocolsBox);
//Here I do a while to check if the list has gotten bigger
break;
}
The function newChild() is as follows:
GtkHBox* newChild() {
printf("Creating new hbox\n");
countProt++;
//creation of all the widgets to look for a service
GtkHBox* new = (GtkHBox *) gtk_hbox_new(0, 0);
GtkEntry* nameEntry = (GtkEntry *) gtk_entry_new();
GtkEntry* domainEntry = (GtkEntry *) gtk_entry_new();
GtkHButtonBox *buttons = (GtkHButtonBox *) gtk_hbox_new(1, 0);
GtkRadioButton *tcpButton = (GtkRadioButton *) gtk_radio_button_new_with_label_from_widget(NULL, "tcp");
GtkRadioButton *udpButton = (GtkRadioButton *) gtk_radio_button_new_with_label_from_widget(tcpButton, "udp");
//packing the radio button widget
gtk_box_pack_start((GtkBox *) buttons, (GtkWidget *) tcpButton, 0, 0, 0);
gtk_box_pack_end((GtkBox *) buttons, (GtkWidget *) udpButton, 0, 0, 0);
//packing the outer most widget
gtk_box_pack_start((GtkBox *) new, (GtkWidget *) nameEntry, 1, 1, 0);
gtk_box_pack_end((GtkBox *) new, (GtkWidget *) buttons, 0, 0, 0);
gtk_box_pack_end((GtkBox *) new, (GtkWidget *) domainEntry, 1, 1, 0);
return new;
}
Any suggestions?