From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Gavin McCord Newsgroups: comp.lang.ada Subject: Re: Errors using gtk.font_button in gtkada (gtk3) Date: Wed, 13 Feb 2019 21:26:03 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 13 Feb 2019 21:26:03 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="03265cdff17da7adcd241f2901d48626"; logging-data="19620"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dghtF3TIuG2UepYiAMmYjIdFLjicGfMPOVO6HLlqcmQ==" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:gOjeYemJwI+vW6Epy8QctH5pAIs= Xref: reader01.eternal-september.org comp.lang.ada:55512 Date: 2019-02-13T21:26:03+00:00 List-Id: No, that makes sense, but I must be missing something really obvious. I've simplified the code so there's only a button, a label and the font_button, with one main program file and a callback package (see below), though the font_button isn't even connected to a handler at this point, the error still occurs when it's clicked on. test2.adb --------- with Gtk.Main; with Gtk.Window; use Gtk.Window; with Gtk.Box; use Gtk.Box; with Gtk.Widget; use Gtk.Widget; with Gtk.Button; use Gtk.Button; with Gtk.Font_Button; use Gtk.Font_Button; with Gtk.Label; use Gtk.Label; with Gtkada.Handlers; use Gtkada.Handlers; with Test2_Cb; use Test2_Cb; procedure Test2 is Win : Gtk_Window; Vert_Box : Gtk_VBox; Button : Gtk_Button; FontButton : Gtk_Font_Button; Label : Gtk_Label; begin Gtk.Main.Init; Gtk_New (Win); Win.Set_Default_Size (480, 160); Win.Set_Title ("FontButton test"); Win.On_Destroy (Main_Quit'Access); Gtk_New_VBox (Vert_Box, False, 0); Win.Add (Vert_Box); Gtk_New (Label, "A label."); Pack_Start (Vert_Box, Label, True, False, 0); Gtk_New (FontButton); Pack_Start (Vert_Box, FontButton, True, False, 0); Gtk_New (Button, "Quit"); Widget_Callback.Object_Connect (Button, "clicked", Widget_Callback.To_Marshaller (Button_Quit'Access), Win); Pack_Start (Vert_Box, Button, True, False, 0); Win.Show_All; Gtk.Main.Main; end Test2; ---------- test2_cb.adb ------------ package body Test2_Cb is procedure Main_Quit (Self : access Gtk_Widget_Record'Class) is begin Gtk.Main.Main_Quit; end Main_Quit; procedure Button_Quit (Self : access Gtk_Widget_Record'Class) is begin Destroy (Self); end Button_Quit; end Test2_Cb; ------------- test2_cb.ads ------------ with Gtk.Main; with Gtk.Widget; use Gtk.Widget; package Test2_Cb is procedure Main_Quit (Self : access Gtk_Widget_Record'Class); procedure Button_Quit (Self : access Gtk_Widget_Record'Class); end Test2_Cb; -------------