Re: [Vala] example request
- From: Frederik <scumm_fredo gmx net>
- To: vala-list <vala-list gnome org>
- Subject: Re: [Vala] example request
- Date: Wed, 24 Feb 2010 18:59:59 +0100
Reid Thompson wrote:
Can anyone point me to an example where i can see something along the
lines of ... hey, this changed (in my case the text buffer), do this as
a results ...
TextBuffer has a 'changed' and a 'modified_changed' signal:
http://valadoc.org/gtk+-2.0/Gtk.TextBuffer.changed.html
http://valadoc.org/gtk+-2.0/Gtk.TextBuffer.modified_changed.html
If you have a TextView you can connect a handler to one of those signals
of its buffer:
var textview = new TextView ();
textview.buffer.changed.connect (on_buffer_changed);
And the handler:
void on_buffer_changed (TextBuffer buffer) {
// Save text
}
If you're doing this with Glade, then you must create a text buffer
object (there's a section in the tool palette on the left side) and reference
this buffer object in the properties pane of the text view (on the right side).
Best regards,
Frederik
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]