2002-07-18 Duncan Mak <duncan@ximian.com>
* 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 the unnecessary try... catch block. svn path=/trunk/gtk-sharp/; revision=5889
This commit is contained in:
parent
6f5bbc2259
commit
aeb6280e2f
5 changed files with 30 additions and 15 deletions
|
@ -1,7 +1,12 @@
|
||||||
2002-07-18 Duncan Mak <duncan@ximian.com>
|
2002-07-18 Duncan Mak <duncan@ximian.com>
|
||||||
|
|
||||||
|
* 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
|
* 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 <duncan@ximian.com>
|
2002-07-18 Duncan Mak <duncan@ximian.com>
|
||||||
|
|
||||||
|
@ -10,7 +15,6 @@
|
||||||
* TestFileSelection.cs:
|
* TestFileSelection.cs:
|
||||||
* TestFlipping.cs:
|
* TestFlipping.cs:
|
||||||
* TestMenus.cs:
|
* TestMenus.cs:
|
||||||
|
|
||||||
* TestRadioButton.cs:
|
* TestRadioButton.cs:
|
||||||
* TestRange.cs:
|
* TestRange.cs:
|
||||||
* TestStatusbar.cs:
|
* TestStatusbar.cs:
|
||||||
|
|
|
@ -2,9 +2,9 @@ MCS=mcs
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(MCS) -o WidgetViewer.exe -r glib-sharp -r gdk-sharp -r gtk-sharp \
|
$(MCS) -o WidgetViewer.exe -r glib-sharp -r gdk-sharp -r gtk-sharp \
|
||||||
TestCheckButton.cs TestColorSelection.cs TestFileSelection.cs TestRadioButton.cs \
|
TestCheckButton.cs TestColorSelection.cs TestFileSelection.cs \
|
||||||
TestRange.cs TestStatusbar.cs TestToolbar.cs TestDialog.cs TestFlipping.cs \
|
TestRadioButton.cs TestRange.cs TestStatusbar.cs TestToolbar.cs \
|
||||||
TestMenus.cs \
|
TestDialog.csTestFlipping.cs TestMenus.cs \
|
||||||
WidgetViewer.cs
|
WidgetViewer.cs
|
||||||
clean:
|
clean:
|
||||||
rm -f *.exe *~
|
rm -f *.exe *~
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace WidgetViewer {
|
||||||
menuitem.Submenu = Create_Menu (3, true);
|
menuitem.Submenu = Create_Menu (3, true);
|
||||||
menubar.Append (menuitem);
|
menubar.Append (menuitem);
|
||||||
|
|
||||||
Image image = new Image ("gtk-help", IconSize.Menu);
|
Image image = new Image (Stock.Help, IconSize.Menu);
|
||||||
|
|
||||||
menuitem = new ImageMenuItem ("Help");
|
menuitem = new ImageMenuItem ("Help");
|
||||||
((ImageMenuItem) menuitem).Image = image;
|
((ImageMenuItem) menuitem).Image = image;
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace WidgetViewer {
|
||||||
static Window window = null;
|
static Window window = null;
|
||||||
static Statusbar statusbar = null;
|
static Statusbar statusbar = null;
|
||||||
static int counter = 1;
|
static int counter = 1;
|
||||||
|
static uint context_id ;
|
||||||
|
|
||||||
public static Gtk.Window Create ()
|
public static Gtk.Window Create ()
|
||||||
{
|
{
|
||||||
|
@ -33,7 +34,7 @@ namespace WidgetViewer {
|
||||||
|
|
||||||
statusbar = new Statusbar ();
|
statusbar = new Statusbar ();
|
||||||
box1.PackEnd (statusbar, true, true, 0);
|
box1.PackEnd (statusbar, true, true, 0);
|
||||||
statusbar.TextPopped += new EventHandler (statusbar_popped);
|
statusbar.TextPopped += new TextPoppedHandler (statusbar_popped);
|
||||||
|
|
||||||
Button button = new Button ("push");
|
Button button = new Button ("push");
|
||||||
box2.PackStart (button, false, false, 0);
|
box2.PackStart (button, false, false, 0);
|
||||||
|
@ -41,7 +42,7 @@ namespace WidgetViewer {
|
||||||
|
|
||||||
button = new Button ("pop");
|
button = new Button ("pop");
|
||||||
box2.PackStart (button, false, false, 0);
|
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);
|
box1.PackStart (new HSeparator (), false, true, 0);
|
||||||
|
|
||||||
|
@ -59,17 +60,27 @@ namespace WidgetViewer {
|
||||||
return window;
|
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)
|
static void statusbar_pushed (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
if (counter < 1024) {
|
string content = String.Format ("Push #{0}", counter);
|
||||||
statusbar.Push (1, String.Format ("Push #{0}", counter));
|
context_id = statusbar.GetContextId (content);
|
||||||
counter ++;
|
statusbar.Push (context_id, content);
|
||||||
}
|
|
||||||
|
counter ++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Close_Button (object o, EventArgs args)
|
static void Close_Button (object o, EventArgs args)
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace WidgetViewer {
|
||||||
|
|
||||||
static void Close_Button (object o, EventArgs args)
|
static void Close_Button (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
Window_Delete (o, (DeleteEventArgs) args);
|
Application.Quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Check_Buttons (object o, EventArgs args)
|
static void Check_Buttons (object o, EventArgs args)
|
||||||
|
|
Loading…
Reference in a new issue