On Monday 01 April 2002 06:13, you wrote:
> At Mon, 1 Apr 2002 01:45:06 +0200,
>
> > TextEditor instead of MultilineInput, but I guess, from ruby-fltk
> > docs, that TextEditor is not really supported/implemented.
>
> TextDisplay and TextEditor are now supported. I should have
> updated the documentation.
> > Does anybody know how I could achieve my target?
>
> So I would use TextEditor.
Hello,
I have tried to understand the fltk doc on TextEditor,
but with no good results.
In the following example the commented lines do not work,
as I get "undefined method".
A lot of others methods in TextEditor and TextBuffer
have the same behaviour. Am I doing a silly mistake?
Are these methods not supported? If they are not, how could I
let the user select part of the text and choose a different
color/size/font for it?
Thanks for the help.
cix
--------------------
require 'fltk'
w = FLTK::Window.new(0,0,200,220){
d = FLTK::TextEditor.new(200,200)
b = FLTK::TextBuffer.new(100)
b.text = "this is a buffer text."
d.buffer = b
d.insert_position(0)
d.show_insert_position()
FLTK::Button.new(0,200,50,20,"action"){
#The following 3 lines are unrelated! It is just a sample.
#p b.highlight_selection
#p b.text_range(2,5)
#d.textcolor(Fltk::RED)
}
}
w.show
FLTK::run()
----------------------
|