RE: [gtkmm] Glib::Module API issues

On Fri, 2003-03-21 at 15:30, Murray Cumming Comneon com wrote:
> > If I use the constructor directly, I can't have a null GModule on the
> > stack. If I use new, then I don't seem to get a null pointer even if I
> > try and load a module which doesn't exist.
> I suppose we should throw an exception, but constructors can't do that (I
> think) so we could add an operator=() instead. That would be like using a
> std::fstream, I think. In the meantime if(module.gobj()) might be an
> equivalent to if(module).

As Paul just pointed out, constructors can throw exceptions (phew, that
sucks otherwise).

I think an exception is the best thing, or a static method
Glib::Module::Open(...) which returns a GModule* or some such pointer (a
la the C API).

You're right, module.gobj() worked.

> > I've compared module.hg and gtk/window.hg, and the way they 
> > declare the constructor wrapping is totally different.
> Yes, because GModule isn't a widget. It's not even a Gobject.

That's a very good point, which I only just noticed.

> If you don't understand the wrapping code, it's OK to look at the generated
> code and talk about that. Someone else might be able to tell you how to
> write the gtkmmproc code to get the desired output.

I don't understand the details, but I've worked with the Python wrappers
so I understand what is going on, at least. :)

> > So, is there a bug in the wrapping? Or am I going mad...
> You are probably the first to use it. I wrapped it so that someone would try
> to use it and show us the bugs, but nobody did before the freeze. Maybe you
> could provide a patch for glibmm 2.4. It would be even better to have an
> example in glibmm 2.4 so that we could prove that it works.

I've got an example now, which works. I'm currently documenting this
module so I don't need two API references open...

Ross Burton                     Software Engineer
OneEighty Software Ltd          Tel: +44 20 8680 8712
Cygnet House                    Fax: +44 20 8680 8453
12-14 Sydenham Road             r burton 180sw com
Croydon, Surrey CR9 2ET, UK
Under the Regulation of Investigatory Powers (RIP) Act 2000 together
with any and all Regulations in force pursuant to the Act OneEighty
Software Ltd reserves the right to monitor any or all incoming or
outgoing communications as provided for under the Act

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