using a factory to control instances
Jacob Perkins <[email protected]>
| Newsgroups | gmane.comp.gnome.components |
|---|---|
| Organization | seahorse |
| Message-ID | <[email protected]> |
I want to use a bonobo factory for creating controls (or any BonoboObject). I already have a setup working that was basically copied from the sample control in libbonoboui. However, I only want one instance of this control. So, given 'moniker', I want to create a new BonoboObject if it doesn't exist yet, or return the already created one. However, if given 'moniker:new', I want to create a new instance of the object. Since there are no guarentees as to which process will request the first instance, how do I do this. To make it simple, how would one modify the sample control to support this? I know this can be done with a static variable or object, but it seems that factories should provide a better way to do this. Thanks -- Jacob Perkins <[email protected]> seahorse