Problem when using gtk_window_set_decorated and gtk_window_iconify together.

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

 



Hi,
    I want to delete titlebar 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 titlebar, the minimize button couldn't work. Anyone has ideas?

Thanks a lot.
 
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux