From: Stephen Leake <stephen_leake@acm.org>
To: comp.lang.ada@ada-france.org
Subject: Re: passing hand arround a db connection
Date: 24 Aug 2004 08:51:18 -0400
Date: 2004-08-24T08:51:18-04:00 [thread overview]
Message-ID: <mailman.3.1093351910.31213.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <2p0g8gFfi977U1@uni-berlin.de>
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)
> <snip event handler stuff>
>
> 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
next prev parent reply other threads:[~2004-08-24 12:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-24 9:32 passing hand arround a db connection matthias-dated
2004-08-24 12:51 ` Stephen Leake [this message]
2004-08-24 15:03 ` Matthias Teege
2004-08-25 1:32 ` Stephen Leake
2004-08-25 5:28 ` Matthias Teege
2004-08-26 17:55 ` Warren W. Gay VE3WWG
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox