Re: [gnomemm] Creating a custom Gnome::Canvas::Item



On Wed, 2002-07-17 at 01:59, Michael Babcock wrote:
> Does anybody have an example that creates a new Canvas::Item class by 
> derivation in C++?
> 
> There is no default constructor,

A default constructor would probably just call g_object_new() without
property values, but I'm not sure whether that would create anything
useful. You could try to simulate it by calling the base cast
constructor, like so:

Thing::Thing(Group& parentx, int something)
: Gnome::Canvas;:Item(GNOME_CANVAS_ITEM(g_object_new(get_type(), 0)))
{
  item_construct(parentx);
}

That's just some code that I copied from line.ccg and modified.

If that is useful then we could add a real default constructor to make
it easier.
 
-- 
Murray Cumming
murrayc usa net
www.murrayc.com




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