Re: Debugging widgets

Thanks Daniel for the tip.
I tried gtk_init() but it looks like it is not enough for mm version.
Instead, I called Gtk::Application::run() and it works. The code is

        auto app = Gtk::Application::create("mytest");
        Gtk::Box box;
        BOOST_TEST(box.get_homogeneous() == false);

I also substituted Gtk::Box with my custom widget and everything seems
works just fine.



On Wed, 2019-09-18 at 20:48 +0100, Daniel Boles wrote:
sounds like you just never initialised gtk via an application or

On Wed, 18 Sep 2019, 20:45 Pavlo Solntsev via gtkmm-list, <
gtkmm-list gnome org> wrote:

I am trying to understand how to debug a widget. I am trying to do
something like this. This is just a test.

        Gtk::Box box;
        BOOST_TEST(box.get_homogeneous() == true);

I get the following error:

(process:25274): Gtk-CRITICAL **: 14:36:20.149:
_gtk_css_lookup_resolve: assertion '(((__extension__ ({
*__inst = (GTypeInstance*) ((provider)); GType __t =
((_gtk_style_provider_private_get_type ())); gboolean __r; if
__r = (0); else if (__inst->g_class && __inst->g_class->g_type ==
__r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
}))))' failed

(process:25274): GLib-GObject-CRITICAL **: 14:36:20.149:
g_object_set_data_full: assertion 'G_IS_OBJECT (object)' failed

(process:25274): Gtk-ERROR **: 14:36:20.149: ../../checkout/gtk+-
3/gtk/gtkstylecontext.c:348:gtk_style_context_init: Can't create a
GtkStyleContext without a display connection

Since Gtk::Box is not a top level widget is has no CSS styles
associated with it. What would be the best practice to add CSS
(ctor?) and eventually, how to debug a widget? I assume, we don't
to call any show() methods. 


gtkmm-list mailing list
gtkmm-list gnome org

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