Skip to content

Commit

Permalink
Add ui_builder_get_object()
Browse files Browse the repository at this point in the history
This is used to get any object built from the UI file, not widgets only.
  • Loading branch information
b4n committed Jan 20, 2012
1 parent 21cd7bb commit 9130b84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ui_utils.c
Expand Up @@ -2444,6 +2444,15 @@ GtkWidget *ui_lookup_widget(GtkWidget *widget, const gchar *widget_name)
}


/* wraps gtk_builder_get_object()
* unlike ui_lookup_widget(), it does only support getting object created from the main
* UI file, but it can fetch any object, not only widgets */
gpointer ui_builder_get_object (const gchar *name)
{
return gtk_builder_get_object (builder, name);
}


/* Progress Bar */
static guint progress_bar_timer_id = 0;

Expand Down
2 changes: 2 additions & 0 deletions src/ui_utils.h
Expand Up @@ -209,6 +209,8 @@ void ui_widget_set_tooltip_text(GtkWidget *widget, const gchar *text);

GtkWidget *ui_lookup_widget(GtkWidget *widget, const gchar *widget_name);

gpointer ui_builder_get_object (const gchar *name);

/* Compatibility functions */
GtkWidget *create_edit_menu1(void);
GtkWidget *create_prefs_dialog(void);
Expand Down

0 comments on commit 9130b84

Please sign in to comment.