using GtkHTML and GtkSourceView in a Glade app
- From: William Page <compenguy gmail com>
- To: gtk-app-devel-list gnome org
- Subject: using GtkHTML and GtkSourceView in a Glade app
- Date: Sat, 20 Aug 2005 21:07:23 -0500
I'm trying to build a Gnome app that has a GtkNotebook with 2 tabs,
one containing a GtkHTML, and one containing a GtkSourceView, but they
just don't show up, and I get an error from glade trying to add the
GtkHTML widget.
glade-2 doesn't have built-in support for those widgets, but it does
have a "Custom" widget. So I have in my glade project a GtkNotebook
with 2 tabs. Each tab contains a GtkScrolledWindow, each of which, in
turn, contains a GtkViewport, which contains the glade "Custom"
widget.
Each of the two custom widgets has a creation function:
uihandler_document_html_init
uihandler_html_sourceview_init
With prototypes like:
GtkWidget *uihandler_html_sourceview_init(gchar *name, gchar *str1,
gchar *str2, gint val1, gint val2);
GtkWidget *uihandler_document_html_init(gchar *name, gchar *str1,
gchar *str2, gint val1, gint val2);
and the functions look like:
GtkWidget *uihandler_document_html_init(gchar *name, gchar *str1,
gchar *str2, gint val1, gint val2)
{
GtkWidget *document_html;
if(str1)
{
document_html = gtk_html_new_from_string(str1, -1);
}
else
{
document_html = gtk_html_new();
}
return document_html;
}
GtkWidget *uihandler_html_sourceview_init(gchar *name, gchar *str1,
gchar *str2, gint val1, gint val2)
{
GtkSourceBuffer *sourceBuffer;
GtkSourceLanguagesManager *languagesManager;
GtkSourceLanguage *language;
languagesManager = gtk_source_languages_manager_new();
language = gtk_source_languages_manager_get_language_from_mime_type(languagesManager,
"text/html");
sourceBuffer = gtk_source_buffer_new_with_language(language);
if(str1)
{
gtk_text_buffer_insert_at_cursor(GTK_TEXT_BUFFER(sourceBuffer),
str1, -1);
}
return gtk_source_view_new_with_buffer(sourceBuffer);
}
The program compiles with no warnings or errors, and upon running:
** (eEd:24337): CRITICAL **: html_utils_get_accessible: assertion `o
!= NULL' failed
and both notebook pages come up blank.
Any ideas?
Will Page
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]