Added find parent window

This commit is contained in:
Jesse van den Kieboom 2006-03-31 20:28:12 +00:00
parent b71bb729c9
commit 3beebbc9d7
2 changed files with 16 additions and 0 deletions

View File

@ -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) {

View File

@ -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,