Re: Deriving from Gtk::TextBuffer and Gtk::TextTag



On Mon, 2006-04-17 at 20:47 -0700, Tamer Mowafy wrote:
> I'd like to derive a class from Gtk::TextBuffer and/or
> Gtk::TextTag. The problem is to get an instance of any
> of these classes one uses the static member function
> create that returns a pointer wrapped in Glib::RefPtr.
> This makes me uncertain if it is possible to derive
> from these classes in the first place, and if it is
> possible what should be the best approach to implement
> a corresponding create function for my class that
> would return a pointer of the base class type (so it
> might be used wherever the base is expected).

It's possible, but you need to add create() functions to your derived
class, to call your derived constuctors, which should be protected. Look
at the implementations of the existing create() functions. They are very
simple.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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