Re: Debugging widgets

Daniel Boles via gtkmm-list <[email protected]>
Newsgroups gmane.comp.gnome.gtkmm
Message-ID <CAKChMKM57OxfxtzPkAjiUSEnpNtvQCixvjZOv+YpTbutY-BnYA@mail.gmail.com>
Hi Pavlo,

On Thu, 19 Sep 2019 at 04:26, <[email protected]> wrote:

> Thanks Daniel for the tip.
> I tried gtk_init() but it looks like it is not enough for mm version.
>

Right, I was half awake, and really meant Gtk::Main::init() or whatever the
mm wrapping of that C function is.

However, using a Gtk::Application is the preferred way now anyway. :-)


> Instead, I called Gtk::Application::run() and it works. The code is
> follow:
>
>         auto app = Gtk::Application::create("mytest");
>         Gtk::Box box;
>         app->run();
>         BOOST_TEST(box.get_homogeneous() == false);
>
> I also substituted Gtk::Box with my custom widget and everything seems
> works just fine.
>

Great! Probably the run() isn't even needed, as I think the creation of the
GtkApplication will suffice to initialise things far enough that you can
instantiate widgets and read/write properties.

Of course, if you want to test stuff that requires widgets to actually be
realised, etc., then you will indeed need to pack them into a toplevel and
run the application in order to make that happen.

_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.