Re: How to install a new "property"?
- From: "Andrew E. Makeev" <andrew solvo ru>
- To: Roger Leigh <rleigh whinlatter ukfsn org>
- Cc: gtkmm-list gnome org
- Subject: Re: How to install a new "property"?
- Date: Mon, 28 Mar 2005 15:09:17 +0400
Roger Leigh wrote:
dzho002 <zhou_dx yahoo com> writes:
how I can install/register the new property (do I need do that at
all?) Is the function, PropertyBase::install_property, for this
purpose?
I think you want to firstly install the property. You want
g_object_class_install_property() for that (in C) or add a private
Glib::Property member to your class (in addition to the PropertyProxy,
which proxies it).
I'm not totally sure of how this should be handled in C++. If it's
the same as C, you should override the set_property() and get_property
methods of Glib::ObjectBase, but these aren't virtual...
class MyClass : public Glib::Object
{
...
public:
Glib::PropertyProxy<void *> property_data() {return
property_data_.get_proxy(); }
private:
Glib::Property<void *> property_data_;
...
};
MyClass::MyClass() :
...
property_data_( *this, "data", (void *)0 ),
...
{
...
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]