29 Oct
2008
29 Oct
'08
2:43 a.m.
On Tue, 2008-10-28 at 18:54 -0700, Krzysztof Kosiński wrote:
OK, I have one question. How do I derive something meaningful from a glibmm or gtkmm class? In particular, how do I override virtual methods of Gio::OutputStream? In raw GOject, the methods write, flush, splice, close and their asynchronous versions are virtual and can be set in the class constructor, but in the C++ wrappers they are not. Is there a way to do this in C++ or do I have to write my own GObject, and then wrap it in a C++ API? (The second part is trickier, since it requires meddling with glibmm internals).
I believe you can just subclass them. No more tricky than that. If you have a function in the subclass with the same prototype that one will get used.
--Ted