Re: very urgently required solution to a problem
- From: Olexiy Avramchenko <ath beast stu cn ua>
- To: Your Name <kanishka_vatsa da-iict org>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: very urgently required solution to a problem
- Date: Thu, 24 Oct 2002 10:45:35 +0300
Your Name wrote:
hi
i want a solution to a very simple problem.
how can i attach an event to fixed object.
or
What do you mean ? Attach a signal handler to object
or smth else ?
how can i minimize the whole window when i
click on a particular button.
Look at example I've attached (gcc `pkg-config --cflags --libs`
iconify.c -o iconify).
This can be done with gtk_window_iconify() function:
http://developer.gnome.org/doc/API/2.0/gtk/gtkwindow.html#gtk-window-iconify
Olexiy
#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);
/* this signal handler minimizes (iconifies) the main window via gtk_window_iconify() function */
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_widget_show_all(window);
gtk_main();
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]