[glade--] Could raw C++ pointers be eliminated?

My (and others) C++ memory philosophy is that raw C++ pointers
should be very rare in application programs. They cause
problems in an exception environment:

(see especially slide 40)

When I need to create a complex widgit or dialog, I run
glademm, glade--, then I hack the hell out of the generated
code, changing all the pointers to sub-widgits to contained
("has-a") subobjects.

What would be involved in changing glade-- to generate
this code automaticly?

If this is not easy, what would be involved in changing
all the raw pointers to some kind of smart pointer?
std::auto_ptr, boost::shared_ptr or Gtk::RefPtr?

One of the selling points of Gtkmm is that member instances
can be used:
	(4) Member instances can be used, simplifying memory
	management. All GTK+ C widgets are dealt with by use of
	pointers. As a C++ coder you know that pointers should be
	avoided where possible.

From the Gtkmm FAQ:

So my question is, how much trouble would it be to make glade-- take
advantge of this?

Thank You

Best wishes.
Paul Elliott                       1(512)837-1096
pelliott io com                    PMB 181, 11900 Metric Blvd Suite J
http://www.io.com/~pelliott/pme/   Austin TX 78758-3117

Attachment: pgpTy5Q5Gfb0F.pgp
Description: PGP signature

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