[Vala] Gtk.TextBuffer text/set_text

2008-10-30 Thread Geert Jan
Gtk.TextBuffer has a property: public weak string text { set; get; } This should mean you can either use: my_text_buffer.text = "foo"; Or: my_text_buffer.set_text ("foo"); Right? However, the set_text() method in this case is different: public void set_text (string text, int

[Vala] How to subclass a Gtk.Label?

2008-10-30 Thread Frederik
Hi, I tried to subclass a Label, but the program will crash: - using Gtk; public class MyLabel : Label { public MyLabel () { this.text = "Subclassed Label"; } } static int main (string[] args) { Gt

Re: [Vala] How to subclass a Gtk.Label?

2008-10-30 Thread Thijs Vermeir
Hi, On Thu, Oct 30, 2008 at 2:49 PM, Frederik <[EMAIL PROTECTED]> wrote: > Hi, > > I tried to subclass a Label, but the program will crash: > > - > using Gtk; > > public class MyLabel : Label { > >public MyLabel () { >

Re: [Vala] How to subclass a Gtk.Label?

2008-10-30 Thread Luca Dionisi
On Thu, Oct 30, 2008 at 3:15 PM, Thijs Vermeir <[EMAIL PROTECTED]> wrote: > use should not use text directly but use the set_text function, (like > you would do in C) Then vapi file should declare "text" as a read-only property. Right? ___ Vala-list mail

Re: [Vala] How to subclass a Gtk.Label?

2008-10-30 Thread Frederik
Thijs Vermeir wrote: use should not use text directly but use the set_text function, (like you would do in C) Than it works. Thanks, it worked! Frederik ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] How to subclass a Gtk.Label?

2008-10-30 Thread Thijs Vermeir
Hi On Thu, Oct 30, 2008 at 3:22 PM, Luca Dionisi <[EMAIL PROTECTED]> wrote: > On Thu, Oct 30, 2008 at 3:15 PM, Thijs Vermeir <[EMAIL PROTECTED]> wrote: >> use should not use text directly but use the set_text function, (like >> you would do in C) > > Then vapi file should declare "text" as a read-

[Vala] Drag and Drop

2008-10-30 Thread Frederik
Hi, I decided to learn about drag'n'drop with Gtk+ and found this (very good) tutorial: http://live.gnome.org/GnomeLove/DragNDropTutorial Now I have ported the sample to Vala (see attachment). It would work with the following changes to gtk+-2.0.vapi public struct TargetEntry { publi

Re: [Vala] How to subclass a Gtk.Label?

2008-10-30 Thread lariamat
"text" should be completely hidden because we have the "set_text"/"get_text" in parallel with the "set_markup". Btw, shouldn't a construction-method with a string as parameter work for the derrived class like for a Gtk.Label? It doesn't. using Gtk; public class MyLabel : Label { } static int ma