[Glade-users] how can I display an entire text file in Gtktext widget?
- From: vishudh at gmail.com (vishudh ps)
- Subject: [Glade-users] how can I display an entire text file in Gtktext widget?
- Date: Tue, 8 Jul 2008 13:20:49 +0530
The second argument is "gpointer user_data". What change should I make to
the second argument to get the pointer of textview, and where(only in
callback.c, or anywere else needed)?
On 7/8/08, Lukasz Gromotowicz <gromot at gmail.com> wrote:
Hi,
first of all read here:
http://library.gnome.org/devel/gtk/2.6/GtkText.html
It says the GtkText is deprecated... instead it use GtkTextView. Then
having a pointer to GtkTextView use
gtk_text_view_get_buffer<http://library.gnome.org/devel/gtk/2.6/GtkTextView.html#gtk-text-view-get-buffer>to
get its buffer. You must load whatever you want to display to this
buffer.
When you define the callback function you can add a pointer to any
structure / object you want (last parameter of the callback). Pass a pointer
to your textView.
Regards,
LUK
2008/7/7 vishudh ps <vishudh at gmail.com>:
I am new to glade and trying to create an editor in glade.So, I want to
change the content of a Gtktext widget with a text file when a button is
clicked.Both the text and button are children of diffrent windows. The
problem is, I cannot access the text widget from the callback function of
the button.what is the solution to get the text widget on "clicked" callback
of the button? I tried with global variables, But make returns error:
"gtk_text_insert: assertion 'GTK_IS_TEXT(text)' failed".
Please help me to insert text in to the text widget. Thanks in advance.
_______________________________________________
Glade-users maillist - Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20080708/47cead34/attachment.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]