[gnome-dictionary] Do not use deprecated methods
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-dictionary] Do not use deprecated methods
- Date: Tue, 10 Apr 2012 21:09:28 +0000 (UTC)
commit 8be0a24fc6c039245eb72d8113a458551ee54f18
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Apr 10 17:02:56 2012 +0200
Do not use deprecated methods
libgdict/gdict-database-chooser.c | 2 +-
libgdict/gdict-defbox.c | 18 +++++++++++-------
libgdict/gdict-source-chooser.c | 2 +-
libgdict/gdict-speller.c | 2 +-
libgdict/gdict-strategy-chooser.c | 2 +-
src/gdict-sidebar.c | 6 +++---
src/gdict-window.c | 12 ++++++------
7 files changed, 24 insertions(+), 20 deletions(-)
---
diff --git a/libgdict/gdict-database-chooser.c b/libgdict/gdict-database-chooser.c
index 114f23c..ddf2c83 100644
--- a/libgdict/gdict-database-chooser.c
+++ b/libgdict/gdict-database-chooser.c
@@ -362,7 +362,7 @@ gdict_database_chooser_constructor (GType type,
gtk_container_add (GTK_CONTAINER (sw), priv->treeview);
gtk_widget_show (priv->treeview);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
priv->buttons_box = hbox;
priv->refresh_button = gtk_button_new ();
diff --git a/libgdict/gdict-defbox.c b/libgdict/gdict-defbox.c
index 0b41907..5d2e1be 100644
--- a/libgdict/gdict-defbox.c
+++ b/libgdict/gdict-defbox.c
@@ -1292,10 +1292,10 @@ create_find_pane (GdictDefbox *defbox)
priv = defbox->priv;
- find_pane = gtk_hbox_new (FALSE, 0);
+ find_pane = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (find_pane), 0);
- hbox1 = gtk_hbox_new (FALSE, 6);
+ hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (find_pane), hbox1, TRUE, TRUE, 0);
gtk_widget_show (hbox1);
@@ -1309,7 +1309,7 @@ create_find_pane (GdictDefbox *defbox)
gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0);
gtk_widget_show (button);
- hbox2 = gtk_hbox_new (FALSE, 12);
+ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (hbox1), hbox2, TRUE, TRUE, 0);
gtk_widget_show (hbox2);
@@ -1322,7 +1322,7 @@ create_find_pane (GdictDefbox *defbox)
gtk_box_pack_start (GTK_BOX (hbox2), priv->find_entry, TRUE, TRUE, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->find_entry);
- sep = gtk_vseparator_new ();
+ sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (GTK_BOX (hbox1), sep, FALSE, FALSE, 0);
gtk_widget_show (sep);
@@ -1583,8 +1583,6 @@ defbox_motion_notify_cb (GtkWidget *text_view,
set_cursor_if_appropriate (defbox, GTK_TEXT_VIEW (text_view), bx, by);
- gdk_window_get_pointer (gtk_widget_get_window (text_view), NULL, NULL, NULL);
-
return FALSE;
}
@@ -1593,10 +1591,16 @@ defbox_visibility_notify_cb (GtkWidget *text_view,
GdkEventVisibility *event,
GdictDefbox *defbox)
{
+ GdkDisplay *display;
+ GdkDeviceManager *device_manager;
+ GdkDevice *pointer;
gint wx, wy;
gint bx, by;
- gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL);
+ display = gdk_window_get_display (event->window);
+ device_manager = gdk_display_get_device_manager (display);
+ pointer = gdk_device_manager_get_client_pointer (device_manager);
+ gdk_window_get_device_position (gtk_widget_get_window (text_view), pointer, &wx, &wy, NULL);
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view),
GTK_TEXT_WINDOW_WIDGET,
diff --git a/libgdict/gdict-source-chooser.c b/libgdict/gdict-source-chooser.c
index 7a829d9..490407e 100644
--- a/libgdict/gdict-source-chooser.c
+++ b/libgdict/gdict-source-chooser.c
@@ -279,7 +279,7 @@ gdict_source_chooser_constructor (GType gtype,
gtk_container_add (GTK_CONTAINER (sw), priv->treeview);
gtk_widget_show (priv->treeview);
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
priv->buttons_box = hbox;
priv->refresh_button = gtk_button_new ();
diff --git a/libgdict/gdict-speller.c b/libgdict/gdict-speller.c
index ae0e340..5052a63 100644
--- a/libgdict/gdict-speller.c
+++ b/libgdict/gdict-speller.c
@@ -338,7 +338,7 @@ gdict_speller_constructor (GType type,
gtk_container_add (GTK_CONTAINER (sw), priv->treeview);
gtk_widget_show (priv->treeview);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
priv->clear_button = gtk_button_new ();
gtk_button_set_image (GTK_BUTTON (priv->clear_button),
diff --git a/libgdict/gdict-strategy-chooser.c b/libgdict/gdict-strategy-chooser.c
index 9c84b41..538d6de 100644
--- a/libgdict/gdict-strategy-chooser.c
+++ b/libgdict/gdict-strategy-chooser.c
@@ -346,7 +346,7 @@ gdict_strategy_chooser_constructor (GType type,
gtk_container_add (GTK_CONTAINER (sw), priv->treeview);
gtk_widget_show (priv->treeview);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
priv->refresh_button = gtk_button_new ();
gtk_button_set_image (GTK_BUTTON (priv->refresh_button),
diff --git a/src/gdict-sidebar.c b/src/gdict-sidebar.c
index fbe1b07..ed5a27b 100644
--- a/src/gdict-sidebar.c
+++ b/src/gdict-sidebar.c
@@ -176,7 +176,7 @@ gdict_sidebar_select_button_press_cb (GtkWidget *widget,
gtk_widget_get_allocation (widget, &allocation);
width = allocation.width;
gtk_widget_set_size_request (sidebar->priv->menu, -1, -1);
- gtk_widget_size_request (sidebar->priv->menu, &req);
+ gtk_widget_get_preferred_size (sidebar->priv->menu, NULL, &req);
gtk_widget_set_size_request (sidebar->priv->menu,
MAX (width, req.width), -1);
gtk_widget_grab_focus (widget);
@@ -327,7 +327,7 @@ gdict_sidebar_init (GdictSidebar *sidebar)
priv->pages_by_id = g_hash_table_new (g_str_hash, g_str_equal);
/* top option menu */
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (sidebar), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
priv->hbox = hbox;
@@ -342,7 +342,7 @@ gdict_sidebar_init (GdictSidebar *sidebar)
sidebar);
priv->select_button = select_button;
- select_hbox = gtk_hbox_new (FALSE, 0);
+ select_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
priv->label = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5);
diff --git a/src/gdict-window.c b/src/gdict-window.c
index 640cc0b..8e8c14f 100644
--- a/src/gdict-window.c
+++ b/src/gdict-window.c
@@ -185,7 +185,7 @@ gdict_window_dispose (GObject *gobject)
if (window->busy_cursor)
{
- gdk_cursor_unref (window->busy_cursor);
+ g_object_unref (window->busy_cursor);
window->busy_cursor = NULL;
}
@@ -1649,7 +1649,7 @@ gdict_window_constructor (GType type,
gtk_widget_push_composite_child ();
- window->main_box = gtk_vbox_new (FALSE, 0);
+ window->main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), window->main_box);
gtk_widget_show (window->main_box);
@@ -1688,12 +1688,12 @@ gdict_window_constructor (GType type,
gdict_window_ensure_menu_state (window);
}
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (window->main_box), vbox);
gtk_widget_show (vbox);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
@@ -1731,8 +1731,8 @@ gdict_window_constructor (GType type,
gtk_box_pack_start (GTK_BOX (vbox), handle, TRUE, TRUE, 0);
gtk_widget_show (handle);
- frame1 = gtk_vbox_new (FALSE, 0);
- frame2 = gtk_vbox_new (FALSE, 0);
+ frame1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ frame2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
window->defbox = gdict_defbox_new ();
if (window->context)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]