Re: [gtk-list] Gtk_Text question




Thanks Evan, for your reply. I get same error message even if I reverse
the order as you said. Could this be related to "position" (int*) because
I don't understand why an int pointer is used there? I also put a line
my_text->set_point(0); before insert_text() function but still no luck. If
I removed insert_text(..) line, everything is ok (except I can't insert
text into the widget :( ).

BTW, I use glib-1.1.2, gtk+-1.1.1, Gtk---0.9.14.

Lixin


On Fri, 25 Sep 1998, Evan Lawrence wrote:

> The text widget needs to be show()'n or realized before you can insert
> text into it - reversing the position of those two function calls should
> do the trick...
> 
> 
> --
> Evan Lawrence
> 
> On Fri, 25 Sep 1998, Lixin Tang wrote:
> 
> > Hi, 
> > 
> > what's wrong with my following code when I try to put a string into a text
> > widget? I got "** ERROR **: sigsegv caught" message when I ran it (not
> > compiled it). Your help is appreciated! 
> > 
> > Lixin
> > 
> > ==================================================================
> > ...
> > 
> > Gtk_Text* my_text = new Gtk_Text();
> > 
> > int i = 0;
> > 
> > // syntax: void insert_text(const gchar *new_text, gint new_text_length,
> > //                          gint *position); of class Gtk_Editable
> > 
> > my_text->insert_text( "Hello", 5, &i );
> > 
> > my_text->show();
> > 
> > ...
> > 
> > -- 
> > To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> > 
> > 
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]