Re: [gtkmm] Actions / UIManager and OO programming style



Murray Cumming wrote:
On Wed, 2004-06-30 at 02:52 +0200, Christer Palm wrote:

OK - I've been playing around trying to derive from Gtk::Action using the Action(const Glib::ConstructParams& construct_params) constructor,


No, that's not something that you should try to use - it's only for
internal use.


There are two protected constructors for Gtk::Action (at least in gtkmm 2.4.3 which is what I have):

  explicit Action(const Glib::ConstructParams& construct_params);
  explicit Action(GtkAction* castitem);

Both of which I would certainly put in the "internal use only" category. Given the available choices, the first one was the only one to at least make some sense.


Would it be possible for someone to provide me with a simple example of how this is properly done?

How about you try to do it and tell us what problems you have?


Believe me, I have tried it. But frankly, the result was too embarassing to even post here. Basically, I wasn't able to figure how to properly use the Glib::ConstructParams. I happily admit that I'm quite lost when I'm down at the GObject level.

Nothing about RefPtr stops you from deriving.


Technically, no, of course.

There are protected constructors, so you can derive.

The point is that among the classes using the create() pattern, that's not always the case. Quite a few of them are lacking useful protected constructors.

If you need an
extra constructor then I would be happy to look at a patch.

I will see what I can come up with. I was hoping that it was just me making some silly mistake.

--
Christer Palm



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