Re: [Vala] bah! protected indeed! Re: structs unions and types



Hi Sam,

I'm having trouble understanding exactly what you are trying to access
where. Would you please be able to send a complete and minimal test
case, i.e. a standalone program which is as small as possible and
demonstrates the problem.

Cheers,
Jared

2008/6/23 Sam Liddicott <sam liddicott com>:
Even defining it as an outer class makes vala think that it is private:

/* widgets is still private */
    public class window_widgets {
    Gtk.Widget blah;
    Gtk.Widget blah2;
    }

public class PhoneUIGlade : Gtk.Object {
    protected Glade.XML xml;
    public window_widgets widgets;
}

but if I go back to a struct, it "works" and for some reason isn't giving me
incomplete class either.

    public struct window_widgets {
    Gtk.Widget blah;
    Gtk.Widget blah2;
    }

public class PhoneUIGlade : Gtk.Object {
    protected Glade.XML xml;
    public window_widgets widgets;
}

But if I change "public" to "protected" (below) the generated .h files are
correctly exposing the protected members, but vala still complains that:
Access to private member `window_widgets.blah' denied
if a subclass tries to access the widgets member.

    protected struct window_widgets {
    Gtk.Widget blah;
    Gtk.Widget blah2;
    }

public class PhoneUIGlade : Gtk.Object {
    protected Glade.XML xml;
    protected window_widgets widgets;
}


* Sam Liddicott wrote, On 23/06/08 12:58:

public class PhoneUIGlade : Gtk.Object {
    protected Glade.XML xml;
    public class window_widgets {
    Gtk.Widget blah;
    Gtk.Widget blah2;
    }
    protected window_widgets widgets;
    private Module module;
}

Does not work; a subclass cannot access the protected member "widgets" with
the error:
 error: Access to private member `PhoneUIGlade.window_widgets.blah' denied

Making the class and variable public do not work:

public class PhoneUIGlade : Gtk.Object {
    protected Glade.XML xml;
    public class window_widgets {
    Gtk.Widget blah;
    Gtk.Widget blah2;
    }
    public window_widgets widgets;
    private Module module;
}

aggghhhh

Sam

________________________________
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list


_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list





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