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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,31e24749747ccfc9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-03 10:51:29 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!easynet-quince!easynet.net!teaser.fr!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Access check failed Date: 03 Jan 2004 13:51:16 -0500 Organization: Cuivre, Argent, Or Message-ID: References: <4138e9c3.0401030603.9a4fe6e@posting.google.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1073155887 45164 80.67.180.195 (3 Jan 2004 18:51:27 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Sat, 3 Jan 2004 18:51:27 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <4138e9c3.0401030603.9a4fe6e@posting.google.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:4076 Date: 2004-01-03T13:51:16-05:00 gilmour@banda.lv (gilmour) writes: > Why when I press 'Insert' button, following error appears? > "CONSTRAINT_ERROR: win_new_employee_pkg.ads:25 access check failed" > I'am using GtkAda-2.2.0 > procedure On_Btninsert_Pressed(Object : access Gtk_Button_Record'Class)is > > begin > > Set_Text(win_new_employee.entry3, ""); This is referencing Win_New_Employee_Pkg.Win_New_Employee, which is never set, so it is null, so you get an access check failure. You need to get the parent of the parent of Object; that is the top level window containing Entry3. > end On_Btninsert_Pressed; > > end Win_New_Employee_Pkg.Callbacks; > procedure Gtk_New (Win_New_Employee : out Win_New_Employee_Access) is > begin > Win_New_Employee := new Win_New_Employee_Record; This is the out parameter Win_New_Employee, _not_ the global Win_New_Employee_Pkg.Win_New_Employee. > Win_New_Employee_Pkg.Initialize (Win_New_Employee); > end Gtk_New; > Here is a typical event handler from one of my applications: procedure On_Enabled_Clicked (Button : access Gtk.Button.Gtk_Button_Record'Class) is Check_Button : constant Gtk.Check_Button.Gtk_Check_Button := Gtk.Check_Button.Gtk_Check_Button (Button); View : constant Gtk_View := Gtk_View (Gtk.Button.Get_Parent (Button)); begin View.Data.Enabled := Gtk.Check_Button.Get_Active (Check_Button); end On_Enabled_Clicked; Hope this helps. There is also a GtkAda mailing list; see http://libre.act-europe.fr/ -- -- Stephe