Problem when using gtk_window_set_decorated and gtk_window_iconify together.
- From: Terry <terry8848 gmail com>
- To: gtk-app-devel-list gnome org
- Subject: Problem when using gtk_window_set_decorated and gtk_window_iconify together.
- Date: Mon, 19 Nov 2007 14:45:39 +0800
Hi,
I want to delete toolbar via gtk_window_set_decorated and use a button
to minimize the window. And I found a sample on:
http://mail.gnome.org/archives/gtk-app-devel-list/2002-October/msg00260.html
.
Here is the sample code:
(gcc `pkg-config --cflags --libs` iconify.c -o iconify).
<------------------------------------------------------------------------------------------------------------------
#include <gtk/gtk.h>
int main(int argc, char **argv)
{
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *button;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
g_signal_connect(window, "delete_event", (GCallback)gtk_main_quit, 0);
vbox = gtk_vbox_new(TRUE, 0);
gtk_container_add(GTK_CONTAINER(window), vbox);
button = gtk_button_new_with_label("Iconify");
gtk_box_pack_start(GTK_BOX(vbox), button, TRUE,TRUE, 0);
g_signal_connect_swapped(button, "clicked",
(GCallback)gtk_window_iconify, window);
button = gtk_button_new_from_stock(GTK_STOCK_QUIT);
gtk_box_pack_start(GTK_BOX(vbox), button, TRUE,TRUE, 0);
g_signal_connect(button, "clicked", (GCallback)gtk_main_quit, 0);
//gtk_window_set_decorated(window, FALSE);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
------------------------------------------------------------------->
This sample works all right. But after i added
gtk_window_set_decorated(window, FALSE) before
gtk_widget_show_all(window) to delete the toolbar, the minimize button
couldn't work. Anyone has ideas?
Thanks a lot.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]