Added find parent window
This commit is contained in:
parent
b71bb729c9
commit
3beebbc9d7
2 changed files with 16 additions and 0 deletions
|
@ -569,6 +569,20 @@ gm_notebook_focus_from_label(GtkNotebook *note, gchar *caption) {
|
|||
}
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gm_find_parent(GtkWidget *widget, GType parent_type) {
|
||||
if (widget == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (G_TYPE_CHECK_INSTANCE_TYPE(widget, parent_type)) {
|
||||
return widget;
|
||||
}
|
||||
|
||||
return gm_find_parent(gtk_widget_get_parent(widget), parent_type);
|
||||
}
|
||||
|
||||
|
||||
gchar *
|
||||
gm_convert_with_fallback(gchar const *text, gssize len, gchar const *from,
|
||||
gchar const *to, gchar const *fallback) {
|
||||
|
|
|
@ -147,6 +147,8 @@ void gm_widget_destroy_data(GtkWidget *caller, GtkWidget *destroyer);
|
|||
const gchar *gm_default_charset();
|
||||
void gm_notebook_focus_from_label(GtkNotebook *note, gchar *caption);
|
||||
|
||||
GtkWidget *gm_find_parent(GtkWidget *widget, GType parent_type);
|
||||
|
||||
gchar *gm_from_utf8_with_fallback(gchar const *text, gssize len,
|
||||
gchar const *to, gchar const *fallback);
|
||||
gchar *gm_to_utf8_with_fallback(gchar const *text, gssize len,
|
||||
|
|
Reference in a new issue