[gtk-list redhat com] Clearing window
- From: ALT2376 ritvax isc rit edu
- To: gtk-list redhat com
- Subject: [gtk-list@redhat.com] Clearing window
- Date: Sat, 24 Jan 1998 01:14:13 -0500 (EST)
Hello,
How Do i clear a window layout?(meaning killing all its children?).
I'd like to have a button that changes the window layout, so i thought, i could
clear it up then redraw it.
I tried something like this
GtkWidget *window;
void first_layout()
{
window = gtk_window_new() /* left out arguments to make codes short */
/* lots of packings here */
/* bind the second_layout function to a button */
button = gtk_button_new_with_label();
gtk_signal_connect(GTK_OBJECT(window),"clicked",
GTK_SIGNAL_FUNC(second_dialog),NULL);
/* more here */
}
void second_layout()
{
gtk_widget_destroy(window) /* call destroy to clear prev layout */
/* is this a correct way to do it? */
window = gtk_window_new();
/* the rest of the stuff goes here for the second layout */
}
so on and so forth...
I tried this. The second_layout pops up real quick then the whole thing
just dies. I can't seem to figure out what is wrong..I am not sure if the,
gtk_widget_destroy() then rebuild it, approach is correct.
Thanks in advance,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]