Editor Gadget Word Wrap using GTK?

Linux specific forum
Hydrate
Enthusiast
Enthusiast
Posts: 436
Joined: Mon May 16, 2005 9:37 pm
Contact:

Editor Gadget Word Wrap using GTK?

Post by Hydrate »

I have been wanting to create a fully functional editorgadget for a while, I feel this is not possible without the wordwrap function.

I have been looking at the GTK api and have found what I think I need to pull it off, but have no idea how to do it in purebasic, here is what I am looking at:

http://library.gnome.org/devel/gtk/2.12 ... -word-wrap

From that, this code is what I attempted:

Code: Select all

gtkText.l=EditorGadget(#PB_Any,0,4,\lw,\lh-4);
  gtk_text_set_word_wrap_(gtkText,#True);
Ideas?
.::Image::.
frederic
User
User
Posts: 56
Joined: Thu Jan 05, 2006 11:22 pm

Post by frederic »

this function is deprecated, use gtk_text_view_set_wrap_mode ()
but i don't know how to use it with pb
http://library.gnome.org/devel/gtk/2.12 ... -wrap-mode
Hydrate
Enthusiast
Enthusiast
Posts: 436
Joined: Mon May 16, 2005 9:37 pm
Contact:

Post by Hydrate »

frederic wrote:this function is deprecated, use gtk_text_view_set_wrap_mode ()
but i don't know how to use it with pb
http://library.gnome.org/devel/gtk/2.12 ... -wrap-mode
Ah thank you, I got it working with this code:

Code: Select all

  gtkText=EditorGadget(#PB_Any,0,19,\lw,\lh-19);
  gtk_text_view_set_wrap_mode_(GadgetID(gtkText),#True);
.::Image::.
frederic
User
User
Posts: 56
Joined: Thu Jan 05, 2006 11:22 pm

Post by frederic »

hmm there is an error, this is not #true (1) but a value from this constants :

Code: Select all

                    Enumeration 0
                              #GTK_WRAP_NONE
                              #GTK_WRAP_CHAR
                              #GTK_WRAP_WORD
                              #GTK_WRAP_WORD_CHAR
                    EndEnumeration
                    
                    gtk_text_view_set_wrap_mode_(GadgetID(#gadget_Main_Editor_TemplateMsg), #GTK_WRAP_WORD)
Post Reply