A question about correct widget packaging sequence



hi everyone

we're trying to port the debian-installer gtk frontend from X to Direct Frame Buffer: in the debian-installer gtk frontend code sequences of instructions like this are often used


button = gtk_button_new_with_label("Hello world!");
frame = gtk_frame_new("blah blah");
gtk_container_add (GTK_CONTAINER (frame), button);
box = gtk_hbox_new (FALSE, 5);
gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5);
gtk_container_add(GTK_CONTAINER(window), box);
gtk_widget_show_all (window);
gtk_main ();

is this sequence correct?
If the same actions would be performed in this order

button = gtk_button_new_with_label("Hello world!");
frame = gtk_frame_new("blah blah");
box = gtk_hbox_new (FALSE, 5);
gtk_container_add(GTK_CONTAINER(window), box);
gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5);
gtk_container_add (GTK_CONTAINER (frame), button);
gtk_widget_show_all (window);
gtk_main ();

would this piece of code still be correct?

I've noticed that under X both sequences work correctly, in a DFB environement, instead, the second one produces crashes (but DFB is still buggy, so maybe this doesn't means a thing..)
thanks

attilio



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