1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| GtkWidget *window1 = NULL;
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
on_button1_clicked (GtkButton *button,
gpointer user_data)
{
if (window1 == NULL)
{
window1 = create_window1();
gtk_widget_show (window1);
}
}
void
on_button2_clicked (GtkButton *button,
gpointer user_data)
{
if (window1 != NUL) gtk_widget_destroy(window1));
} |