RE: [gtkmm] How to copy Gtk::Widgets?



I see your point.

I guess that then I will have to create my own "MediaElement" class,
containing a Gtk::Widget or rather the "source material" (i.e. PixBuf,
or text, attributes, etc..) for it, and then sort out the methods and
subclasses to deal with different widget types.

In this way I could use a collection of MediaElements as described in my
previous email.

Can you see an easier way?

Enrico

-----Original Message-----
From: Murray Cumming [mailto:murrayc t-online de] 
Sent: 29 March 2003 13:43
To: Enrico Costanza
Cc: 'gtkmm-list'
Subject: RE: [gtkmm] How to copy Gtk::Widgets?


On Sat, 2003-03-29 at 14:29, Enrico Costanza wrote:
> Thanks for your reply.
> 
> 
> >> How could I make a copy of a Gtk::Widget?
> >> It seems that both the copy constructor and operator= are declared
> >> private.
> 
> >That means that you cannot copy Gtk::Widget instances. Why would you
> want to do it, and
> >what would it mean for you? What would you expect to happen?
> 
> I would expect to have another identical instance.

That's not such a simple thing to say.

If the first one was shown, would that mean that the 2nd one would be
visible as soon as the C++ data structure was copied? Where would it be
shown? Should it have the same parent container? What if that parent
container could only have one child? Or if the parent was a VBox would
the new widget appear above or below the original?

If the widget is a container should it have exactly the same children?
But children can only be in one parent container at a time?

I can imagine that a .clone() method might be useful, to do a deep copy
of a widget that would not be immmediately visible, but putting that in
an implicit copy constructor would be a major step.

-- 
Murray Cumming
murray usa net
www.murrayc.com





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