Re: Abstract string properties with getter/setter functions

2007-09-29 Thread Owen Taylor
On 9/28/07, Federico Mena Quintero <[EMAIL PROTECTED]> wrote: > On Thu, 2007-09-20 at 08:34 +0200, Raffaele Sandrini wrote: > > > Take a look at 'gtk_file_chooser_get_preview_widget'. While the hack > > done there is somehow possible with objects it is not with strings. > > > > GtkWidget * > > gtk_

Re: Abstract string properties with getter/setter functions

2007-09-29 Thread Emmanuele Bassi
On Fri, 2007-09-28 at 16:24 -0500, Federico Mena Quintero wrote: > By the way, this is a *TERRIBLE* idea. I don't remember why I wrote the > code that way. Please don't follow that broken pattern. if I may guess, it's because otherwise you'd have to unref the returned widget, which would be a b

Re: Abstract string properties with getter/setter functions

2007-09-28 Thread Federico Mena Quintero
On Thu, 2007-09-20 at 08:34 +0200, Raffaele Sandrini wrote: > Take a look at 'gtk_file_chooser_get_preview_widget'. While the hack > done there is somehow possible with objects it is not with strings. > > GtkWidget * > gtk_file_chooser_get_preview_widget (GtkFileChooser *chooser) > { > GtkWidge

Re: Abstract string properties with getter/setter functions

2007-09-21 Thread James \"Doc\" Livingston
On Thu, 2007-09-20 at 08:15 +0200, Raffaele Sandrini wrote: > On Wed, 2007-09-19 at 19:20 +0200, David Nečas (Yeti) wrote: > > On Wed, Sep 19, 2007 at 06:48:25PM +0200, Raffaele Sandrini wrote: > > > > > Since we do not see a way around this (yet) and we could not find an > > > > > example with st

Re: Abstract string properties with getter/setter functions

2007-09-20 Thread Tim Janik
On Thu, 20 Sep 2007, Raffaele Sandrini wrote: > On Wed, 2007-09-19 at 19:17 +0200, Tim Janik wrote: >> erm, no. that's at least not a clean solution, ref counts may increase and >> decrease at any point in time for random reasons (caches, garbage collection >> algorithms, etc...), even from concu

Re: Abstract string properties with getter/setter functions

2007-09-19 Thread Raffaele Sandrini
On Wed, 2007-09-19 at 19:17 +0200, Tim Janik wrote: > >>> BTW: There are equal issues with properties returning objects only there > >>> you can add a hack into the getter unrefing the object before returning > >>> it. This is not applicable with strings. > >> > >> this is not applicable with objec

Re: Abstract string properties with getter/setter functions

2007-09-19 Thread Raffaele Sandrini
On Wed, 2007-09-19 at 19:20 +0200, David Nečas (Yeti) wrote: > On Wed, Sep 19, 2007 at 06:48:25PM +0200, Raffaele Sandrini wrote: > > > > Since we do not see a way around this (yet) and we could not find an > > > > example with strings in another project. I'm asking here if there is a > > > > nice

Re: Abstract string properties with getter/setter functions

2007-09-19 Thread Yeti
On Wed, Sep 19, 2007 at 06:48:25PM +0200, Raffaele Sandrini wrote: > > > Since we do not see a way around this (yet) and we could not find an > > > example with strings in another project. I'm asking here if there is a > > > nice way around this. > > > > i'm really not sure i understand your probl

Re: Abstract string properties with getter/setter functions

2007-09-19 Thread Tim Janik
On Wed, 19 Sep 2007, Raffaele Sandrini wrote: > On Wed, 2007-09-19 at 17:53 +0200, Tim Janik wrote: >> On Wed, 19 Sep 2007, Raffaele Sandrini wrote: >> callers of getters have to free the returned string in C. >> for glib/gtk programs, if the caller doesn't need to free the string, >> the return

Re: Abstract string properties with getter/setter functions

2007-09-19 Thread Michael Lawrence
On 9/19/07, Raffaele Sandrini <[EMAIL PROTECTED]> wrote: > > Ok i see there is need to clarify things. > > On Wed, 2007-09-19 at 17:53 +0200, Tim Janik wrote: > > On Wed, 19 Sep 2007, Raffaele Sandrini wrote: > > > > > Hi there, > > > > > > While implementing abstract properties in Vala we encounte

Re: Abstract string properties with getter/setter functions

2007-09-19 Thread Raffaele Sandrini
Ok i see there is need to clarify things. On Wed, 2007-09-19 at 17:53 +0200, Tim Janik wrote: > On Wed, 19 Sep 2007, Raffaele Sandrini wrote: > > > Hi there, > > > > While implementing abstract properties in Vala we encountered a problem > > regarding string properties with getter and setter func

Re: Abstract string properties with getter/setter functions

2007-09-19 Thread Tim Janik
On Wed, 19 Sep 2007, Raffaele Sandrini wrote: > Hi there, > > While implementing abstract properties in Vala we encountered a problem > regarding string properties with getter and setter functions: > > public interface Test.MyIface { > public abstract string text { get; } > } > > A getter fu

Abstract string properties with getter/setter functions

2007-09-19 Thread Raffaele Sandrini
Hi there, While implementing abstract properties in Vala we encountered a problem regarding string properties with getter and setter functions: public interface Test.MyIface { public abstract string text { get; } } A getter function of an abstract string property looks like: char* test_m