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-Thread: 103376,f51c726168257d12 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!fr.ip.ndsoftware.net!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: passing hand arround a db connection Date: 24 Aug 2004 08:51:18 -0400 Organization: Cuivre, Argent, Or Message-ID: References: <2p0g8gFfi977U1@uni-berlin.de> 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 1093351912 87595 212.85.156.195 (24 Aug 2004 12:51:52 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 24 Aug 2004 12:51:52 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <2p0g8gFfi977U1@uni-berlin.de> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-OriginalArrivalTime: 24 Aug 2004 12:51:30.0874 (UTC) FILETIME=[13F1D1A0:01C489D9] X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:2961 Date: 2004-08-24T08:51:18-04:00 matthias-dated@mteege.de writes: > Moin, > > I've playing with a small Ada application which uses GTK and APQ. I > build the GTK frontend with glade. Ok. There is also the GtkAda mailing list (see http://lists.act-europe.fr/mailman/listinfo/gtkada) > > > But I think it isnt a cool idea to use a new connection for each > query. Right. > What is the best way to use one connection for all querys? Store the connection object in the top level window. In your event handler, use Gtk.Widget.Get_Toplevel to get the top level window object. For example (from one of my applications): procedure On_Button_Add (Button : access Gtk.Button.Gtk_Button_Record'Class) is Table_View : constant Gtk_Table_View := Gtk_Table_View (Gtk.Button.Get_Toplevel (Button)); begin To_Add (Table_View); Default_Add (Table_View); end On_Button_Add; What database binding are you using? It doesn't look like GNADE. -- -- Stephe