RE: GTK Trouble
- Posted by Ron W <nova812 at hotmail.com> Aug 19, 2002
- 536 views
I figured out one solution. as it turns out, it was an address. So my solution is. function encrypt_textarea_0() object address integer len integer start sequence s start =0 len = gtk_text_get_length(txt) address=gtk_editable_get_chars(txt,start,len) s=peek({address,len}) printf(1,"%s",{s}) return NULL end function constant encrypt_textarea=call_back(routine_id("encrypt_textarea_0")) I'm not sure it's how the lib was intended to be used, but it seems to work. Ron_W Ron W wrote: > I've also tried this it doesnt seem to > work either. But at least I don't get a > seg fault. It looks as though I might > be getting a pointer values, maybe. > > function encrypt_textarea_0() > object str > integer len > integer start > > start =0 > len = gtk_text_get_length(txt) > str=gtk_editable_get_chars(txt,start,len) > > printf(1,"%s",str) > return NULL > end function > constant encrypt_textarea=call_back(routine_id("encrypt_textarea_0")) > > Ron W wrote: > > I'm having a little trouble with the gtk lib. I made this function... > > > > function encrypt_textarea_0() > > object str > > str=get_text(txt) > > printf(1,"%s",str) > > return NULL > > end function > > constant encrypt_textarea=call_back(routine_id("encrypt_textarea_0")) > > > > when I click on the button that calls this funtion I get.... > > > > Gtk-CRITICAL **: file gtkentry.c: line 535 (gtk_entry_get_text): > > assertion `GTK_IS_ENTRY (entry)' failed. > > Segmentation fault > > > > from looking at the error, it looks like get_text is for a GtkEntry > > widget and not a GtkText object. so my question is ... > > > > how do you get the contents of a GtkText widget a store them in a > > sequence? > > > > Ron_W > > > >