Re: Gio::Action lookup crash
- From: Yann LEYDIER <yann leydier info>
- To: gtkmm-list gnome org
- Subject: Re: Gio::Action lookup crash
- Date: Wed, 27 Apr 2016 13:20:00 +0200
Thanks.
This kind of weird not to be able to access an object I just created
until the widget is realized.
Are there any other things I cannot do with Actions untill the
containing widget is realized?
Thanks again,
yann
On 27/04/2016 15:03, Phil Wolff wrote:
The following modification produces the expected result:
#include <gtkmm.h>
#include <iostream>
class App: public Gtk::ApplicationWindow
{
public:
App()
{
add_action("int");
}
virtual void on_realize ();
};
void App::on_realize ()
{
Gtk::ApplicationWindow::on_realize ();
auto la = lookup_action("int");
std::cout << bool(la) << std::endl;
}
int main(int argc, char *argv[])
{
auto app = Gtk::Application::create(argc, argv, "test.gtk");
App win;
return app->run(win);
}
On 2016/04/27 03:52, Yann LEYDIER wrote:
Hi,
I have this simple program :
#include <gtkmm.h>
#include <iostream>
class App: public Gtk::ApplicationWindow
{
public:
App()
{
add_action("int");
auto la = lookup_action("int");
std::cout << bool(la) << std::endl;
}
};
int main(int argc, char *argv[])
{
auto app = Gtk::Application::create(argc, argv, "test.gtk");
App win;
return app->run(win);
}
The expected output is "1", but instead I get twice this message:
"GLib-Object-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT
(object)' failed" and then the application crashes.
If I add the action to a Gio::SimpleActionGroup instead, it works.
I tested with Gtkmm 3.10 on Linux and 3.18 on Windows.
What am I doing wrong?
Thanks,
yann
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]