Re: Fwd: memory



Probably this documentation snippet can help-

template<class T>
T* 	manage (T* obj)
	Mark a Gtk::Object as owned by its parent container widget, so you
don't need to delete it manually.

Gtk::manage works with classes derived from Gtk::Object, those classes
whose objects can be 'added' to some parent widget class. If u want
memory management for any general class have a look at
boost::shared_ptr.

On 5/10/06, Mickael Drean <mickael drean gmail com> wrote:
That's what i wanted to say! My question was not about new and delete but
more on manage()




2006/5/9, Alex Buell <alex buell munted org uk >:
> On Tue, 9 May 2006 21:12:14 +0200, I waved a wand and this message
> magically appeared from Mickael Drean:
>
> > No, i used new() and delete(). I never used manage but i will try to
> > use it. Can i use it with my own class object?
>
> there's only new and delete. There are no functions called new() and
> delete()!
>
> Yes you can. For example:
>
> Dialog *dialog = new Dialog();
> ..
> ..
> ..
>
> dialog.run();
>
> ..
> ..
>
> delete dialog;
>
> It's that easy.
>
> --
> http://www.munted.org.uk
>
> Take a nap, it saves lives.
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list






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