aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-gtk-utils.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-09-18 07:21:20 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-09-18 07:21:20 +0800
commitf88ca730db134f1d081b415110a2303344ea8ef4 (patch)
tree929e1315d42cb3e72078116734c63816425412df /e-util/e-gtk-utils.c
parentdcd0b593b3e4670cb6e1b9675b4664d842cae7de (diff)
downloadgsoc2013-evolution-f88ca730db134f1d081b415110a2303344ea8ef4.tar.gz
gsoc2013-evolution-f88ca730db134f1d081b415110a2303344ea8ef4.tar.zst
gsoc2013-evolution-f88ca730db134f1d081b415110a2303344ea8ef4.zip
Removed. (gtk_radio_button_select_nth): Removed.
* e-gtk-utils.c (gtk_radio_button_get_nth_selected): Removed. (gtk_radio_button_select_nth): Removed. (e_make_widget_backing_stored): New. svn path=/trunk/; revision=12919
Diffstat (limited to 'e-util/e-gtk-utils.c')
-rw-r--r--e-util/e-gtk-utils.c71
1 files changed, 28 insertions, 43 deletions
diff --git a/e-util/e-gtk-utils.c b/e-util/e-gtk-utils.c
index a1230ad774..564d834cfb 100644
--- a/e-util/e-gtk-utils.c
+++ b/e-util/e-gtk-utils.c
@@ -27,6 +27,11 @@
#endif
#include <gtk/gtksignal.h>
+
+#include <gdk/gdkx.h>
+
+#include <X11/Xlib.h>
+
#include "e-gtk-utils.h"
@@ -106,56 +111,36 @@ e_gtk_signal_connect_full_while_alive (GtkObject *object,
GTK_SIGNAL_FUNC (alive_disconnecter), info);
}
-/**
- * gtk_radio_button_get_nth_selected:
- * @button: A GtkRadioButton
- *
- * Returns an int indicating which button in the radio group is
- * toggled active. NOTE: radio group item numbering starts at zero.
- **/
-int
-gtk_radio_button_get_nth_selected (GtkRadioButton *button)
-{
- GSList *l;
- int i, c;
-
- g_return_val_if_fail (button != NULL, 0);
- g_return_val_if_fail (GTK_IS_RADIO_BUTTON (button), 0);
-
- c = g_slist_length (button->group);
-
- for (i = 0, l = button->group; l; l = l->next, i++) {
- GtkRadioButton *tmp = l->data;
+
+/* BackingStore support. */
- if (GTK_TOGGLE_BUTTON (tmp)->active)
- return c - i - 1;
- }
+static void
+widget_realize_callback_for_backing_store (GtkWidget *widget,
+ void *data)
+{
+ XSetWindowAttributes attributes;
- return 0;
+ attributes.backing_store = Always;
+ XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (widget->window),
+ GDK_WINDOW_XWINDOW (widget->window),
+ CWBackingStore, &attributes);
}
/**
- * gtk_radio_button_select_nth:
- * @button: A GtkRadioButton
- * @n: Which button to select from the group
+ * e_make_widget_backing_stored:
+ * @widget: A GtkWidget
+ *
+ * Make sure that the window for @widget has the BackingStore attribute set to
+ * Always when realized. This will allow the widget to be refreshed by the X
+ * server even if the application is currently not responding to X events (this
+ * is e.g. very useful for the splash screen).
*
- * Select the Nth item of a radio group. NOTE: radio group items
- * start numbering from zero
+ * Notice that this will not work 100% in all cases as the server might not
+ * support that or just refuse to do so.
**/
void
-gtk_radio_button_select_nth (GtkRadioButton *button, int n)
+e_make_widget_backing_stored (GtkWidget *widget)
{
- GSList *l;
- int len;
-
- g_return_if_fail (button != NULL);
- g_return_if_fail (GTK_IS_RADIO_BUTTON (button));
-
- len = g_slist_length (button->group);
-
- if ((n <= len) && (n > 0)) {
- l = g_slist_nth (button->group, len - n - 1);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (l->data), TRUE);
- }
-
+ gtk_signal_connect (GTK_OBJECT (widget), "realize",
+ GTK_SIGNAL_FUNC (widget_realize_callback_for_backing_store), NULL);
}