From 45ebde9387446e033153d7fd1427117b344598a7 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 27 Jul 2005 13:52:51 +0000 Subject: [PATCH] * gtk/ComboBoxEntry.custom: add an "Entry" property to cleanly fetch the ComboBoxEntry's Gtk.Entry svn path=/trunk/gtk-sharp/; revision=47750 --- ChangeLog | 5 +++++ doc/en/Gtk/ComboBoxEntry.xml | 12 ++++++++++++ gtk/ComboBoxEntry.custom | 5 +++++ sample/test/ChangeLog | 4 ++++ sample/test/TestComboBox.cs | 11 +++++++++-- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ebbac825..611753d55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-27 Dan Winship + + * gtk/ComboBoxEntry.custom: add an "Entry" property to cleanly + fetch the ComboBoxEntry's Gtk.Entry + 2005-07-27 Dan Winship * parser/gapi2xml.pl (addParamsElem): deal with G_CONST_RETURN in diff --git a/doc/en/Gtk/ComboBoxEntry.xml b/doc/en/Gtk/ComboBoxEntry.xml index ee4e063e4..6be3a1dec 100644 --- a/doc/en/Gtk/ComboBoxEntry.xml +++ b/doc/en/Gtk/ComboBoxEntry.xml @@ -129,5 +129,17 @@ + + + Property + + Gtk.Entry + + + The combo box's child. + The . + + + diff --git a/gtk/ComboBoxEntry.custom b/gtk/ComboBoxEntry.custom index a5d4d8522..7593ceb82 100644 --- a/gtk/ComboBoxEntry.custom +++ b/gtk/ComboBoxEntry.custom @@ -24,3 +24,8 @@ AppendText (entry); } + public Gtk.Entry Entry { + get { + return (Gtk.Entry)Child; + } + } diff --git a/sample/test/ChangeLog b/sample/test/ChangeLog index c2999225d..258a054f4 100644 --- a/sample/test/ChangeLog +++ b/sample/test/ChangeLog @@ -1,3 +1,7 @@ +2005-07-27 Dan Winship + + * TestComboBox.cs: test ComboBoxEntry.Entry + 2004-05-31 Jeroen Zwartepoorte reviewed by: diff --git a/sample/test/TestComboBox.cs b/sample/test/TestComboBox.cs index c99a2e38d..1163a4595 100644 --- a/sample/test/TestComboBox.cs +++ b/sample/test/TestComboBox.cs @@ -27,6 +27,7 @@ namespace WidgetViewer { ComboBoxEntry combo = new Gtk.ComboBoxEntry (new string[] {"Foo", "Bar"}); combo.Changed += new EventHandler (OnComboActivated); + combo.Entry.Changed += new EventHandler (OnComboEntryChanged); box2.PackStart (combo, true, true, 0); HSeparator separator = new HSeparator (); @@ -55,8 +56,14 @@ namespace WidgetViewer { { ComboBox combo = o as ComboBox; TreeIter iter; - combo.GetActiveIter (out iter); - Console.WriteLine ((string)combo.Model.GetValue (iter, 0)); + if (combo.GetActiveIter (out iter)) + Console.WriteLine ((string)combo.Model.GetValue (iter, 0)); + } + + static void OnComboEntryChanged (object o, EventArgs args) + { + Entry entry = o as Entry; + Console.WriteLine ("Entry text is: " + entry.Text); } } }