diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-21 23:02:32 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-21 23:02:32 +0800 |
commit | c3bfa60a7b27cb0cc44e134dcb9951ab9d41e6f6 (patch) | |
tree | 0e250e4cf1a618a0e5a036243121d40ff28d18da /widgets/misc | |
parent | 19282b39b651f26b60258cc9ce0f93d27e6dd3e5 (diff) | |
download | gsoc2013-evolution-c3bfa60a7b27cb0cc44e134dcb9951ab9d41e6f6.tar gsoc2013-evolution-c3bfa60a7b27cb0cc44e134dcb9951ab9d41e6f6.tar.gz gsoc2013-evolution-c3bfa60a7b27cb0cc44e134dcb9951ab9d41e6f6.tar.bz2 gsoc2013-evolution-c3bfa60a7b27cb0cc44e134dcb9951ab9d41e6f6.tar.lz gsoc2013-evolution-c3bfa60a7b27cb0cc44e134dcb9951ab9d41e6f6.tar.xz gsoc2013-evolution-c3bfa60a7b27cb0cc44e134dcb9951ab9d41e6f6.tar.zst gsoc2013-evolution-c3bfa60a7b27cb0cc44e134dcb9951ab9d41e6f6.zip |
Kill EDropdownButton.
Migrate off of gnome_program_init().
svn path=/branches/kill-bonobo/; revision=37303
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/Makefile.am | 14 | ||||
-rw-r--r-- | widgets/misc/e-dropdown-button.c | 233 | ||||
-rw-r--r-- | widgets/misc/e-dropdown-button.h | 70 | ||||
-rw-r--r-- | widgets/misc/test-calendar.c | 26 | ||||
-rw-r--r-- | widgets/misc/test-dateedit.c | 30 | ||||
-rw-r--r-- | widgets/misc/test-dropdown-button.c | 99 | ||||
-rw-r--r-- | widgets/misc/test-preferences-window.c | 21 |
7 files changed, 35 insertions, 458 deletions
diff --git a/widgets/misc/Makefile.am b/widgets/misc/Makefile.am index 589bd1083e..c422ae9972 100644 --- a/widgets/misc/Makefile.am +++ b/widgets/misc/Makefile.am @@ -51,7 +51,6 @@ widgetsinclude_HEADERS = \ e-charset-picker.h \ e-combo-cell-editable.h \ e-dateedit.h \ - e-dropdown-button.h \ e-expander.h \ e-icon-entry.h \ e-image-chooser.h \ @@ -103,7 +102,6 @@ libemiscwidgets_la_SOURCES = \ e-charset-picker.c \ e-combo-cell-editable.c \ e-dateedit.c \ - e-dropdown-button.c \ e-expander.c \ e-icon-entry.c \ e-image-chooser.c \ @@ -167,7 +165,6 @@ libemiscwidgets_la_LIBADD = $(top_builddir)/e-util/libeutil.la \ noinst_PROGRAMS = \ test-calendar \ test-dateedit \ - test-dropdown-button \ test-preferences-window # test-calendar @@ -192,17 +189,6 @@ test_dateedit_LDADD = \ $(top_builddir)/filter/libfilter.la \ $(E_WIDGETS_LIBS) -# test-dropdown-button - -test_dropdown_button_SOURCES = \ - test-dropdown-button.c - -test_dropdown_button_LDADD = \ - libemiscwidgets.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(E_WIDGETS_LIBS) - # test-preferences-window test_preferences_window_SOURCES = \ diff --git a/widgets/misc/e-dropdown-button.c b/widgets/misc/e-dropdown-button.c deleted file mode 100644 index aa5f84f6c8..0000000000 --- a/widgets/misc/e-dropdown-button.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Ettore Perazzoli <ettore@ximian.com> - * Damon Chaplin <damon@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "e-dropdown-button.h" - -#include <stdio.h> - -struct _EDropdownButtonPrivate { - GtkAccelGroup *accel_group; - GtkWidget *menu; -}; - -G_DEFINE_TYPE (EDropdownButton, e_dropdown_button, GTK_TYPE_TOGGLE_BUTTON) - -/* Callback to position the pop-up menu. */ - -static void -menu_position_cb (GtkMenu *menu, - int *x, - int *y, - gboolean *push_in, - void *data) -{ - EDropdownButton *dropdown_button; - EDropdownButtonPrivate *priv; - GtkRequisition menu_requisition; - int max_x, max_y; - - dropdown_button = E_DROPDOWN_BUTTON (data); - priv = dropdown_button->priv; - - /* Calculate our preferred position. */ - gdk_window_get_origin (GTK_WIDGET (dropdown_button)->window, x, y); - *y += GTK_WIDGET (dropdown_button)->allocation.height; - - /* Now make sure we are on the screen. */ - gtk_widget_size_request (GTK_WIDGET (priv->menu), &menu_requisition); - max_x = MAX (0, gdk_screen_width () - menu_requisition.width); - max_y = MAX (0, gdk_screen_height () - menu_requisition.height); - - *x = CLAMP (*x, 0, max_x); - *y = CLAMP (*y, 0, max_y); -} - -/* Callback for the "deactivate" signal on the pop-up menu. This is used so - that we unset the state of the toggle button when the pop-up menu - disappears. */ - -static int -menu_deactivate_cb (GtkMenuShell *menu_shell, - void *data) -{ - EDropdownButton *dropdown_button; - - dropdown_button = E_DROPDOWN_BUTTON (data); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dropdown_button), FALSE); - return TRUE; -} - - -/* GtkObject methods. */ - -static void -impl_destroy (GtkObject *object) -{ - EDropdownButton *dropdown_button; - EDropdownButtonPrivate *priv; - - dropdown_button = E_DROPDOWN_BUTTON (object); - priv = dropdown_button->priv; - - g_object_unref (priv->accel_group); - gtk_widget_destroy (priv->menu); - - g_free (priv); - - if (GTK_OBJECT_CLASS (e_dropdown_button_parent_class)->destroy) - (* GTK_OBJECT_CLASS (e_dropdown_button_parent_class)->destroy) (object); -} - - -/* GtkWidget methods. */ - -static void -impl_toggled (GtkToggleButton *toggle_button) -{ - EDropdownButton *dropdown_button; - EDropdownButtonPrivate *priv; - - if (GTK_TOGGLE_BUTTON_CLASS (e_dropdown_button_parent_class)->toggled) - GTK_TOGGLE_BUTTON_CLASS (e_dropdown_button_parent_class)->toggled (toggle_button); - - dropdown_button = E_DROPDOWN_BUTTON (toggle_button); - priv = dropdown_button->priv; - - if (toggle_button->active) { - gtk_menu_popup (GTK_MENU (priv->menu), NULL, NULL, - menu_position_cb, dropdown_button, - 1, GDK_CURRENT_TIME); - } else { - gtk_menu_popdown (GTK_MENU (priv->menu)); - } -} - - -static void -e_dropdown_button_class_init (EDropdownButtonClass *klass) -{ - GtkObjectClass *object_class; - GtkToggleButtonClass *toggle_class; - - object_class = GTK_OBJECT_CLASS (klass); - toggle_class = GTK_TOGGLE_BUTTON_CLASS (klass); - - object_class->destroy = impl_destroy; - toggle_class->toggled = impl_toggled; -} - - -static void -e_dropdown_button_init (EDropdownButton *dropdown_button) -{ - EDropdownButtonPrivate *priv; - - priv = g_new (EDropdownButtonPrivate, 1); - priv->accel_group = gtk_accel_group_new (); - priv->menu = NULL; - - dropdown_button->priv = priv; -} - - -/** - * e_dropdown_button_construct: - * @dropdown_button: A pointer to an %EDropdownButton object - * @label_text: Text to display in the button - * @menu: The menu to pop up when the button is pressed - * - * Construct the @dropdown_button with the specified @label_text and the - * associated @menu. - **/ -void -e_dropdown_button_construct (EDropdownButton *dropdown_button, - const char *label_text, - GtkMenu *menu) -{ - EDropdownButtonPrivate *priv; - GtkWidget *hbox; - GtkWidget *arrow; - GtkWidget *label; - unsigned int accel_key; - - g_return_if_fail (dropdown_button != NULL); - g_return_if_fail (E_IS_DROPDOWN_BUTTON (dropdown_button)); - g_return_if_fail (label_text != NULL); - g_return_if_fail (menu != NULL); - g_return_if_fail (GTK_IS_MENU (menu)); - - priv = dropdown_button->priv; - - hbox = gtk_hbox_new (FALSE, 2); - gtk_container_add (GTK_CONTAINER (dropdown_button), hbox); - gtk_widget_show (hbox); - - label = gtk_label_new (""); - accel_key = gtk_label_parse_uline (GTK_LABEL (label), label_text); - gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); - gtk_widget_show (label); - gtk_widget_add_accelerator (GTK_WIDGET (dropdown_button), "clicked", - priv->accel_group, accel_key, GDK_MOD1_MASK, 0); - - arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); - gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, FALSE, 2); - gtk_widget_show (arrow); - - priv->menu = GTK_WIDGET (menu); - - g_signal_connect_object (priv->menu, "deactivate", - G_CALLBACK (menu_deactivate_cb), - dropdown_button, 0); -} - -/** - * e_dropdown_button_new: - * @label_text: Text to display in the button - * @menu: The menu to pop up when the button is pressed - * - * Create a new dropdown button. When the button is clicked, the specified - * @menu will be popped up. - * - * Return value: A pointer to the newly created %EDropdownButton. - **/ -GtkWidget * -e_dropdown_button_new (const char *label_text, - GtkMenu *menu) -{ - GtkWidget *widget; - - g_return_val_if_fail (label_text != NULL, NULL); - g_return_val_if_fail (menu != NULL, NULL); - g_return_val_if_fail (GTK_IS_MENU (menu), NULL); - - widget = g_object_new (e_dropdown_button_get_type (), NULL); - - e_dropdown_button_construct (E_DROPDOWN_BUTTON (widget), label_text, menu); - return widget; -} - diff --git a/widgets/misc/e-dropdown-button.h b/widgets/misc/e-dropdown-button.h deleted file mode 100644 index b10fd9a670..0000000000 --- a/widgets/misc/e-dropdown-button.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Ettore Perazzoli <ettore@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef _E_DROPDOWN_BUTTON_H_ -#define _E_DROPDOWN_BUTTON_H_ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtk.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define E_TYPE_DROPDOWN_BUTTON (e_dropdown_button_get_type ()) -#define E_DROPDOWN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_DROPDOWN_BUTTON, EDropdownButton)) -#define E_DROPDOWN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_DROPDOWN_BUTTON, EDropdownButtonClass)) -#define E_IS_DROPDOWN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_DROPDOWN_BUTTON)) -#define E_IS_DROPDOWN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_DROPDOWN_BUTTON)) - - -typedef struct _EDropdownButton EDropdownButton; -typedef struct _EDropdownButtonPrivate EDropdownButtonPrivate; -typedef struct _EDropdownButtonClass EDropdownButtonClass; - -struct _EDropdownButton { - GtkToggleButton parent; - - EDropdownButtonPrivate *priv; -}; - -struct _EDropdownButtonClass { - GtkToggleButtonClass parent_class; -}; - - -GType e_dropdown_button_get_type (void); -void e_dropdown_button_construct (EDropdownButton *dropdown_button, - const char *label_text, - GtkMenu *menu); -GtkWidget *e_dropdown_button_new (const char *label_text, - GtkMenu *menu); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _E_DROPDOWN_BUTTON_H_ */ diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 1906c70ede..f4fe6d3039 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -30,9 +30,6 @@ #include <gtk/gtk.h> -#include <libgnomeui/gnome-app.h> -#include <libgnomeui/gnome-ui-init.h> - #include "e-calendar.h" /* Drag and Drop stuff. */ @@ -61,21 +58,20 @@ delete_event_cb (GtkWidget *widget, int main (int argc, char **argv) { - GtkWidget *app; + GtkWidget *window; GtkWidget *cal; GtkWidget *vbox; ECalendarItem *calitem; - gnome_program_init ( - "test-calendar", "0.0", LIBGNOMEUI_MODULE, - argc, argv, GNOME_PARAM_NONE); + gtk_init (&argc, &argv); - app = gnome_app_new ("Test", "Test"); - gtk_window_set_default_size (GTK_WINDOW (app), 400, 400); - gtk_window_set_resizable (GTK_WINDOW (app), TRUE); - gtk_container_set_border_width (GTK_CONTAINER (app), 8); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (window), "ECalendar Test"); + gtk_window_set_default_size (GTK_WINDOW (window), 400, 400); + gtk_window_set_resizable (GTK_WINDOW (window), TRUE); + gtk_container_set_border_width (GTK_CONTAINER (window), 8); - g_signal_connect (app, "delete_event", + g_signal_connect (window, "delete_event", G_CALLBACK (delete_event_cb), NULL); cal = e_calendar_new (); @@ -99,8 +95,8 @@ main (int argc, char **argv) gtk_box_pack_start (GTK_BOX (vbox), cal, TRUE, TRUE, 0); gtk_widget_show (vbox); - gnome_app_set_contents (GNOME_APP (app), vbox); - gtk_widget_show (app); + gtk_container_add (GTK_CONTAINER (window), vbox); + gtk_widget_show (window); gtk_main (); @@ -122,7 +118,7 @@ on_date_range_changed (ECalendarItem *calitem) start_day, start_month + 1, start_year, end_day, end_month + 1, end_year); - /* These days should appear bold. Remember month is 0 to 11. */ + /* These days should windowear bold. Remember month is 0 to 11. */ e_calendar_item_mark_day (calitem, 2000, 7, 26, /* 26th Aug 2000. */ E_CALENDAR_ITEM_MARK_BOLD); e_calendar_item_mark_day (calitem, 2000, 8, 13, /* 13th Sep 2000. */ diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index da6a5953b1..8c340ed45b 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -29,13 +29,11 @@ #endif #include <gtk/gtk.h> -#include <libgnomeui/gnome-ui-init.h> -#include <libgnomeui/gnome-app.h> #include "e-dateedit.h" static void delete_event_cb (GtkWidget *widget, GdkEventAny *event, - GtkWidget *app); + GtkWidget *window); static void on_get_date_clicked (GtkWidget *button, EDateEdit *dedit); static void on_toggle_24_hour_clicked (GtkWidget *button, @@ -52,27 +50,29 @@ static void on_time_changed (EDateEdit *dedit, int main (int argc, char **argv) { - GtkWidget *app; + GtkWidget *window; EDateEdit *dedit; GtkWidget *table, *button; - gnome_program_init ("test-dateedit", "0.0", LIBGNOMEUI_MODULE, argc, argv, NULL); + gtk_init (&argc, &argv); puts ("here"); - app = gnome_app_new ("Test", "Test"); - gtk_window_set_default_size (GTK_WINDOW (app), 300, 200); - gtk_window_set_resizable (GTK_WINDOW (app), TRUE); - gtk_container_set_border_width (GTK_CONTAINER (app), 8); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (window), "EDateEdit Test"); + gtk_window_set_default_size (GTK_WINDOW (window), 300, 200); + gtk_window_set_resizable (GTK_WINDOW (window), TRUE); + gtk_container_set_border_width (GTK_CONTAINER (window), 8); - g_signal_connect (app, "delete_event", - G_CALLBACK (delete_event_cb), app); + g_signal_connect (window, "delete_event", + G_CALLBACK (delete_event_cb), window); table = gtk_table_new (3, 3, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_widget_show (table); - gnome_app_set_contents (GNOME_APP (app), table); + + gtk_container_add (GTK_CONTAINER (window), table); /* EDateEdit 1. */ dedit = E_DATE_EDIT (e_date_edit_new ()); @@ -160,7 +160,7 @@ main (int argc, char **argv) g_signal_connect (button, "clicked", G_CALLBACK (on_toggle_24_hour_clicked), dedit); - gtk_widget_show (app); + gtk_widget_show (window); gtk_main (); @@ -171,9 +171,9 @@ main (int argc, char **argv) static void delete_event_cb (GtkWidget *widget, GdkEventAny *event, - GtkWidget *app) + GtkWidget *window) { - gtk_widget_destroy (app); + gtk_widget_destroy (window); gtk_main_quit (); } diff --git a/widgets/misc/test-dropdown-button.c b/widgets/misc/test-dropdown-button.c deleted file mode 100644 index f0a7ca4d0e..0000000000 --- a/widgets/misc/test-dropdown-button.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Ettore Perazzoli <ettore@ximian.com> - * Damon Chaplin <damon@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <gtk/gtk.h> - -#include <libgnomeui/gnome-app.h> -#include <libgnomeui/gnome-app-helper.h> -#include <libgnomeui/gnome-ui-init.h> - -#include "e-dropdown-button.h" - - -/* (The following is shameless stolen from `testgnome.c'. */ - -static void -item_activated (GtkWidget *widget, - void *data) -{ - printf ("%s activated.\n", (char *) data); -} - -static GnomeUIInfo ui_info[] = { - { GNOME_APP_UI_ITEM, "_New", "Create a new file", item_activated, "file/new", NULL, - GNOME_APP_PIXMAP_STOCK, GTK_STOCK_NEW, 'n', GDK_CONTROL_MASK, NULL }, - { GNOME_APP_UI_ITEM, "_Open...", "Open an existing file", item_activated, "file/open", NULL, - GNOME_APP_PIXMAP_STOCK, GTK_STOCK_OPEN, 'o', GDK_CONTROL_MASK, NULL }, - { GNOME_APP_UI_ITEM, "_Save", "Save the current file", item_activated, "file/save", NULL, - GNOME_APP_PIXMAP_STOCK, GTK_STOCK_SAVE, 's', GDK_CONTROL_MASK, NULL }, - { GNOME_APP_UI_ITEM, "Save _as...", "Save the current file with a new name", item_activated, "file/save as", NULL, - GNOME_APP_PIXMAP_STOCK, GTK_STOCK_SAVE_AS, 0, 0, NULL }, - - GNOMEUIINFO_SEPARATOR, - - { GNOME_APP_UI_ITEM, "_Print...", "Print the current file", item_activated, "file/print", NULL, - GNOME_APP_PIXMAP_STOCK, GTK_STOCK_PRINT, 'p', GDK_CONTROL_MASK, NULL }, - - GNOMEUIINFO_SEPARATOR, - - { GNOME_APP_UI_ITEM, "_Close", "Close the current file", item_activated, "file/close", NULL, - GNOME_APP_PIXMAP_STOCK, GTK_STOCK_CLOSE, 0, 0, NULL }, - { GNOME_APP_UI_ITEM, "E_xit", "Exit the program", item_activated, "file/exit", NULL, - GNOME_APP_PIXMAP_STOCK, GTK_STOCK_QUIT, 'q', GDK_CONTROL_MASK, NULL }, - GNOMEUIINFO_END -}; - - -int -main (int argc, char **argv) -{ - GtkWidget *window; - GtkWidget *menu; - GtkWidget *dropdown_button; - - gnome_program_init ( - "test-dropdown-button", "0.0", LIBGNOMEUI_MODULE, - argc, argv, GNOME_PARAM_NONE); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_default_size (GTK_WINDOW (window), 1, 1); - - menu = gtk_menu_new (); - - gnome_app_fill_menu (GTK_MENU_SHELL (menu), ui_info, NULL, TRUE, 0); - - dropdown_button = e_dropdown_button_new ("Me_nu", GTK_MENU (menu)); - gtk_container_add (GTK_CONTAINER (window), dropdown_button); - - gtk_widget_show (window); - gtk_widget_show (dropdown_button); - - gtk_main (); - - return 0; -} diff --git a/widgets/misc/test-preferences-window.c b/widgets/misc/test-preferences-window.c index 8bd8aa8950..bc53f98c58 100644 --- a/widgets/misc/test-preferences-window.c +++ b/widgets/misc/test-preferences-window.c @@ -22,8 +22,6 @@ #include "e-preferences-window.c" #include <gtk/gtk.h> -#include <libgnomeui/gnome-app.h> -#include <libgnomeui/gnome-ui-init.h> #define NUM_PAGES 10 @@ -65,21 +63,20 @@ delete_event_callback (GtkWidget *widget, int main (int argc, char **argv) { - GtkWidget *dialog; + GtkWidget *window; - gnome_program_init ( - "test-preferences-window", "0.0", LIBGNOMEUI_MODULE, - argc, argv, GNOME_PARAM_NONE); + gtk_init (&argc, &argv); - dialog = e_preferences_window_new (); + window = e_preferences_window_new (); + gtk_window_set_default_size (GTK_WINDOW (window), 400, 300); - gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 300); - g_signal_connect((dialog), "delete_event", - G_CALLBACK (delete_event_callback), NULL); + g_signal_connect( + window, "delete-event", + G_CALLBACK (delete_event_callback), NULL); - add_pages (E_PREFERENCES_WINDOW (dialog)); + add_pages (E_PREFERENCES_WINDOW (window)); - gtk_widget_show (dialog); + gtk_widget_show (window); gtk_main (); |