hi,
Uzytkownik wrote:
I have singleton A and subclass B, C and D.
1. How do it in GObject?
The sigleton pattern is usually realized by having a factory method. The
application would use e.g.
gdk_display_manager_get()
which returns a reference to always the same GdkDisplayManager object. Such a
class has no public gdk_display_manager_new() method. The implementation of the
_get() method would use a static variable and create the instance on the first
request to _get().
2. Can I do something that I cannot have B or D at the same time?
Not that I know. A base class has not controll over who subclasses them. What do
you want to achieve. I am not aware of any OO system that could do that and I
miss a cese where this would be needed.
Stefan
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list