comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Errors using gtk.font_button in gtkada (gtk3)
Date: Tue, 12 Feb 2019 00:45:02 +0100
Date: 2019-02-12T00:45:02+01:00	[thread overview]
Message-ID: <q3t1ds$1ivc$1@gioia.aioe.org> (raw)
In-Reply-To: q3sv2j$a7j$1@dont-email.me

On 2019-02-12 00:04, Gavin McCord wrote:
> Strange one here, at least to me.
> 
> I'm running Slackware 14.2, using the XFCE 4.12
> desktop environment and GNAT 2018 (though I've
> encountered this problem with an older version
> of GNAT also).
> 
> I created a small program "test" to take input
> from a GEntry and insert it into a Text_View. It
> doesn't do much else, but works okay.
> 
> Since then I've added a Font_Button to allow the
> user to change the font within the Text_View.
> 
> I get an error though when I click on the font
> button for the first time:
> 
> "(test:2564): Gtk-CRITICAL **:
> gtk_tree_model_filter_real_unref_node: assertion
> 'elt->ref_count > 0' failed"

GTK deploys reference counting. It is a very tricky and difficult to 
understand. GTK widgets have so-called "floating" reference when 
created. A floating reference is converted into a normal reference when 
the widget is put into a container. It is done to spare one line of code 
needed to decrement the reference in the sequences like:

    Gtk_New (Child);
    Box.Pack_Start (Child);
  [ Unref (Child) ]

But all other objects are created with normal reference count 1 and need 
to be released using Unref when put somewhere.

You seem mess up with references.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2019-02-11 23:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 23:04 Errors using gtk.font_button in gtkada (gtk3) Gavin McCord
2019-02-11 23:45 ` Dmitry A. Kazakov [this message]
2019-02-13 21:26   ` Gavin McCord
2019-02-13 22:02     ` Dmitry A. Kazakov
2019-02-13 23:22       ` Gavin McCord
2019-02-13 23:42         ` Gavin McCord
2019-02-14  8:26           ` Dmitry A. Kazakov
2019-02-14 23:31             ` Gavin McCord
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox