Wrapping GApplication inside Gtk module
- From: 张海 <dreaming in code zh gmail com>
- To: "gtkmm-list gnome org" <gtkmm-list gnome org>
- Subject: Wrapping GApplication inside Gtk module
- Date: Sun, 22 Mar 2015 12:02:43 +0000
I'm writing a Gtk module for keyboard navigation like vimium in Chromium, so I'd like to add a keybinding to the host application using Gtk::Application.set_accel_for_action().
But when I try to call Gio::Application::get_default() in gtk_module_init(), the returned value is null, and a warning is issued:
Glib::RefPtr<Gio::Application> application = Gio::Application::get_default();
(gedit:8868): glibmm-WARNING **: Failed to wrap object of type 'GeditAppX11'. Hint: this error is commonly caused by failing to call a library init() function.
While using pure C worked properly:
std::cout << g_application_get_application_id(g_application_get_default()) << std::endl;
org.gnome.gedit
I primarily used Gedit for testing, and using gtk3-widget-factory also produced the same output.
Any idea? Thanks in advance.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]