From 43bff93046d891cdf250704d520e4785f5f07cd4 Mon Sep 17 00:00:00 2001 From: Matthew Brush Date: Sun, 13 Nov 2011 06:05:53 -0800 Subject: [PATCH] Make locate_sci_in_container() search recursively Supports changes to the widget heirarchy in the future. --- src/document.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/document.c b/src/document.c index b6c164901..a3cf75df7 100644 --- a/src/document.c +++ b/src/document.c @@ -231,6 +231,10 @@ gint document_get_notebook_page(GeanyDocument *doc) } +/* + * Recursively searches a containers children until it finds a + * Scintilla widget, or NULL if one was not found. + */ static ScintillaObject *locate_sci_in_container(GtkWidget *container) { ScintillaObject *sci = NULL; @@ -246,6 +250,13 @@ static ScintillaObject *locate_sci_in_container(GtkWidget *container) sci = SCINTILLA(iter->data); break; } + else if (GTK_IS_CONTAINER(iter->data)) + { + sci = locate_sci_in_container(iter->data); + if (IS_SCINTILLA(sci)) + break; + sci = NULL; + } } g_list_free(children); -- 2.11.4.GIT