diff options
Diffstat (limited to 'src/gtk-util-routines.c')
-rw-r--r-- | src/gtk-util-routines.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gtk-util-routines.c b/src/gtk-util-routines.c index a5e04457..83ed066f 100644 --- a/src/gtk-util-routines.c +++ b/src/gtk-util-routines.c @@ -118,3 +118,11 @@ void redraw_widget(GtkWidget *wid) h = gtk_widget_get_allocated_height(GTK_WIDGET(wid)); gtk_widget_queue_draw_area(GTK_WIDGET(wid), 0, 0, w, h); } + + +const char *get_text_or_null(GtkEntry *entry) +{ + const char *text = gtk_entry_get_text(entry); + if ( text[0] == '\0' ) return NULL; + return text; +} |