From 640ba7857e19c1fc057113455af018be3e39a949 Mon Sep 17 00:00:00 2001 From: Duncan Mak Date: Wed, 24 Jul 2002 14:15:58 +0000 Subject: [PATCH] Made the entries accessible, so that we can grab the text out of it. svn path=/trunk/gtk-sharp/; revision=6137 --- sample/DbClient/client.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sample/DbClient/client.cs b/sample/DbClient/client.cs index 96e986d84..1dbb17775 100644 --- a/sample/DbClient/client.cs +++ b/sample/DbClient/client.cs @@ -9,6 +9,9 @@ class Client { static Dialog dialog = null; static Toolbar toolbar = null; static Table tableau = null; + static Entry id_entry = null; + static Entry name_entry = null; + static Entry address_entry = null; static void Main () { @@ -149,23 +152,21 @@ class Client { table.ColSpacings = 4; table.RowSpacings = 4; Label label = null; - Gtk.Entry entry = null; label = Label.NewWithMnemonic ("_ID"); table.Attach (label, 0, 1, 0, 1); - entry = new Entry (); - table.Attach (entry, 1, 2, 0, 1); + id_entry = new Entry (); + table.Attach (id_entry, 1, 2, 0, 1); label = Label.NewWithMnemonic ("_Name"); table.Attach (label, 0, 1, 1, 2); - entry = new Entry (); - table.Attach (entry, 1, 2, 1, 2); + name_entry = new Entry (); + table.Attach (name_entry, 1, 2, 1, 2); label = Label.NewWithMnemonic ("_Address"); table.Attach (label, 0, 1, 2, 3); - entry = new Entry (); - table.Attach (entry, 1, 2, 2, 3); - + address_entry = new Entry (); + table.Attach (address_entry, 1, 2, 2, 3); return hbox ; } @@ -181,10 +182,14 @@ class Client { static void Insert_Action (object o, EventArgs args) { + Console.WriteLine (String.Format ("ID: {0}\nName: {1}\nAddress: {2}", + id_entry.Text, name_entry.Text, address_entry.Text)); } static void Remove_Action (object o, EventArgs args) { + Console.WriteLine (String.Format ("ID: {0}\nName: {1}\nAddress: {2}", + id_entry.Text, name_entry.Text, address_entry.Text)); } static void Dialog_Cancel (object o, EventArgs args)