aboutsummaryrefslogtreecommitdiff
path: root/src/gtk-util-routines.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-02-22 17:10:06 +0100
committerThomas White <taw@physics.org>2021-02-22 17:10:06 +0100
commita3ff9efcb2cd7b89e5ec355c78e78a209167fec3 (patch)
treeb8249e50b7e186f240c7ffcee081667aa1c5a604 /src/gtk-util-routines.c
parentc290ce84b6a61f1465ae264a4af9433eba029a60 (diff)
Add redraw_widget utility procedure
Diffstat (limited to 'src/gtk-util-routines.c')
-rw-r--r--src/gtk-util-routines.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gtk-util-routines.c b/src/gtk-util-routines.c
index 8fd9fecb..f709921d 100644
--- a/src/gtk-util-routines.c
+++ b/src/gtk-util-routines.c
@@ -98,3 +98,12 @@ void set_active(GtkWidget *tb, int active)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb), active);
}
+
+
+void redraw_widget(GtkWidget *wid)
+{
+ gint w, h;
+ w = gtk_widget_get_allocated_width(GTK_WIDGET(wid));
+ h = gtk_widget_get_allocated_height(GTK_WIDGET(wid));
+ gtk_widget_queue_draw_area(GTK_WIDGET(wid), 0, 0, w, h);
+}