Re: Wrapping GApplication inside Gtk module





Den 2015-03-24 03:04, 张海 skrev:
Ah, yes. Thanks. I'm looking at the source code now.

The documentation says that one need to have a Main for Main::~Main() to be called for cleanup, although the doc says "Of course I can't imagine any situation in which you wouldn't have a Gtk::Main."

But if I'm writing a C++ module inside a C application, will this be the case? Can this be resolved or ignored?
It can be ignored. That comment is out of date. Nowadays it's easy to imagine programs without a Gtk::Main. Most of Gtk::Main is deprecated, and has been replaced by Gtk::Application. The cleanup in Gtk::Main::~Main is not important. It just deallocates some dynamically allocated memory before the program finishes. Gtk::Application::~Application does not do it. The operating system will take care of it when the program has finished.

On Mon, Mar 23, 2015 at 11:26 PM Marcus Karlsson <mk acc umu se> wrote:
On Mon, Mar 23, 2015 at 03:09:25PM +0000, 张海 wrote:
> So will calling init_gtkmm_internals() twice be a problem? I mean, what if
> my module has a gtkmm host? If there is a problem, is there anyway to check
> whether it has been called?

The init_gtkmm_internals method has a check in place so that calling it
additional times will do nothing.

Marcus



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