Re: [Vala] [Genie] Chain up TextBuffer



Hi,

I'm developping a program and i need to override a function in Gtk.TextBuffer.
This is the code:

[indent=4]

uses
    Gtk

class testbuffer : Gtk.TextBuffer

    mark : TextMark

    init
        mark = new TextMark(null, true)

def private override insert_text (iter : TextIter, text : string, length : int)
        print "future function"

class test : Window

    txtview : TextView
    txtbuffer : TextBuffer

    init
        title = "Test"
        default_height = 270
        default_width = 440
        window_position = WindowPosition.CENTER
        this.destroy.connect(Gtk.main_quit)
        txtbuffer = new testbuffer ()
        txtview = new TextView.with_buffer(txtbuffer)
        this.add(txtview)
        this.show_all()

init
    Gtk.init (ref args)
    var window = new test ()
    window.show_all ()
    Gtk.main ()

My problem is that i can't write anything in the textview.
Someone can explain me (with code if possible, my english is poor) how to chain up ?

Thank in advance,
Nicolas.





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