How to duplicate a widget



Hi,

I have to duplicate some widgets which i've extended from the ones in GTKmm:

class GraphicalButton : public Gtk::Button

I am making copies of these widgets using the traditional "copy constructor way" like this:

GrahicalButton* oneButton = new GraphicalButton();
GrahicalButton* anotherButton = new GraphicalButton( *oneButton );

Is this OK? What's the correct way of making a copy of one widget?

Best regards,
Diego A. Fons.


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