diff --git a/sample/test/ChangeLog b/sample/test/ChangeLog index 1d897228a..197b8ff60 100644 --- a/sample/test/ChangeLog +++ b/sample/test/ChangeLog @@ -1,7 +1,12 @@ 2002-07-18 Duncan Mak + * WidgetViewer.cs: Fixed InvalidCastException. + + * TestStatusbar.cs: Made it work. Sigh, I dunno why I got it wrong + the first time. + * TestMenus.cs: Use null instead of new SList (IntPtr.Zero); and - remove try... catch block. + remove the unnecessary try... catch block. 2002-07-18 Duncan Mak @@ -10,7 +15,6 @@ * TestFileSelection.cs: * TestFlipping.cs: * TestMenus.cs: - * TestRadioButton.cs: * TestRange.cs: * TestStatusbar.cs: diff --git a/sample/test/Makefile b/sample/test/Makefile index 199ba71b6..0a1a8724f 100644 --- a/sample/test/Makefile +++ b/sample/test/Makefile @@ -2,9 +2,9 @@ MCS=mcs all: $(MCS) -o WidgetViewer.exe -r glib-sharp -r gdk-sharp -r gtk-sharp \ - TestCheckButton.cs TestColorSelection.cs TestFileSelection.cs TestRadioButton.cs \ - TestRange.cs TestStatusbar.cs TestToolbar.cs TestDialog.cs TestFlipping.cs \ - TestMenus.cs \ + TestCheckButton.cs TestColorSelection.cs TestFileSelection.cs \ + TestRadioButton.cs TestRange.cs TestStatusbar.cs TestToolbar.cs \ + TestDialog.csTestFlipping.cs TestMenus.cs \ WidgetViewer.cs clean: rm -f *.exe *~ diff --git a/sample/test/TestMenus.cs b/sample/test/TestMenus.cs index 905f97633..61b56c984 100644 --- a/sample/test/TestMenus.cs +++ b/sample/test/TestMenus.cs @@ -40,7 +40,7 @@ namespace WidgetViewer { menuitem.Submenu = Create_Menu (3, true); menubar.Append (menuitem); - Image image = new Image ("gtk-help", IconSize.Menu); + Image image = new Image (Stock.Help, IconSize.Menu); menuitem = new ImageMenuItem ("Help"); ((ImageMenuItem) menuitem).Image = image; diff --git a/sample/test/TestStatusbar.cs b/sample/test/TestStatusbar.cs index d6d18e495..50b79dc4d 100644 --- a/sample/test/TestStatusbar.cs +++ b/sample/test/TestStatusbar.cs @@ -18,6 +18,7 @@ namespace WidgetViewer { static Window window = null; static Statusbar statusbar = null; static int counter = 1; + static uint context_id ; public static Gtk.Window Create () { @@ -33,7 +34,7 @@ namespace WidgetViewer { statusbar = new Statusbar (); box1.PackEnd (statusbar, true, true, 0); - statusbar.TextPopped += new EventHandler (statusbar_popped); + statusbar.TextPopped += new TextPoppedHandler (statusbar_popped); Button button = new Button ("push"); box2.PackStart (button, false, false, 0); @@ -41,7 +42,7 @@ namespace WidgetViewer { button = new Button ("pop"); box2.PackStart (button, false, false, 0); - button.Clicked += new EventHandler (statusbar_popped); + button.Clicked += new EventHandler (pop_clicked); box1.PackStart (new HSeparator (), false, true, 0); @@ -59,17 +60,27 @@ namespace WidgetViewer { return window; } - static void statusbar_popped (object o, EventArgs args) + static void pop_clicked (object o, EventArgs args) { - statusbar.Pop ((uint) 1); + Console.WriteLine ("Pop"); + statusbar.Pop (context_id); + } + + static void statusbar_popped (object o, TextPoppedArgs args) + { + Console.WriteLine ("statusbar_popped signal"); + Console.WriteLine (args.Text); + Console.WriteLine (args.ContextId); } static void statusbar_pushed (object o, EventArgs args) { - if (counter < 1024) { - statusbar.Push (1, String.Format ("Push #{0}", counter)); - counter ++; - } + string content = String.Format ("Push #{0}", counter); + context_id = statusbar.GetContextId (content); + statusbar.Push (context_id, content); + + counter ++; + return; } static void Close_Button (object o, EventArgs args) diff --git a/sample/test/WidgetViewer.cs b/sample/test/WidgetViewer.cs index 012aaabae..1824ece72 100644 --- a/sample/test/WidgetViewer.cs +++ b/sample/test/WidgetViewer.cs @@ -86,7 +86,7 @@ namespace WidgetViewer { static void Close_Button (object o, EventArgs args) { - Window_Delete (o, (DeleteEventArgs) args); + Application.Quit (); } static void Check_Buttons (object o, EventArgs args)