2002-07-23 Duncan Mak <duncan@ximian.com>

* TestMenus.cs: Use MenuItem instead of ImageMenuItem, this test
works now.

* TestFileSelection.cs: window.Selections is crashing, remove
it. OK Button doesn't do anything now.

* WidgetViewer.cs: Add in a frame.

svn path=/trunk/gtk-sharp/; revision=6021
This commit is contained in:
Duncan Mak 2002-07-22 17:06:28 +00:00
parent 738aef2a29
commit 2f44d60039
5 changed files with 26 additions and 17 deletions

View file

@ -1,3 +1,13 @@
2002-07-23 Duncan Mak <duncan@ximian.com>
* TestMenus.cs: Use MenuItem instead of ImageMenuItem, this test
works now.
* TestFileSelection.cs: window.Selections is crashing, remove
it. OK Button doesn't do anything now.
* WidgetViewer.cs: Add in a frame.
2002-07-20 Duncan Mak <duncan@ximian.com> 2002-07-20 Duncan Mak <duncan@ximian.com>
* TestSizeGroup.cs: Minor aesthetic changes. * TestSizeGroup.cs: Minor aesthetic changes.

View file

@ -7,4 +7,4 @@ all:
TestDialog.cs TestFlipping.cs TestMenus.cs TestSizeGroup.cs \ TestDialog.cs TestFlipping.cs TestMenus.cs TestSizeGroup.cs \
WidgetViewer.cs WidgetViewer.cs
clean: clean:
rm -f *.exe *~ rm -f *.exe

View file

@ -39,7 +39,6 @@ namespace WidgetViewer {
static void file_selection_ok (object o, EventArgs args) static void file_selection_ok (object o, EventArgs args)
{ {
Console.WriteLine (window.Selections);
} }
static void show_fileops (object o, EventArgs args) static void show_fileops (object o, EventArgs args)

View file

@ -30,13 +30,11 @@ namespace WidgetViewer {
box1.PackStart (menubar, false, false, 0); box1.PackStart (menubar, false, false, 0);
Menu menu = Create_Menu (2, true); Menu menu = Create_Menu (2, true);
MenuItem menuitem = new MenuItem ("foo");
MenuItem menuitem = new MenuItem ("test\nline2");
menuitem.Submenu = menu; menuitem.Submenu = menu;
menubar.Append (menuitem); menubar.Append (menuitem);
menuitem = new MenuItem ("foo"); menuitem = new MenuItem ("bar");
menuitem.Submenu = Create_Menu (3, true); menuitem.Submenu = Create_Menu (3, true);
menubar.Append (menuitem); menubar.Append (menuitem);
@ -59,7 +57,7 @@ namespace WidgetViewer {
VBox box2 = new VBox (false, 10); VBox box2 = new VBox (false, 10);
box2.BorderWidth = 10; box2.BorderWidth = 10;
box1.PackStart (box1, true, true, 0); box1.PackStart (box2, true, true, 0);
menu = Create_Menu (1, false); menu = Create_Menu (1, false);
menu.AccelGroup = accel_group; menu.AccelGroup = accel_group;
@ -103,14 +101,13 @@ namespace WidgetViewer {
static Menu Create_Menu (int depth, bool tearoff) static Menu Create_Menu (int depth, bool tearoff)
{ {
Console.WriteLine ("Depth: " + depth);
if (depth < 1) if (depth < 1)
return null; return null;
Menu menu = new Menu (); Menu menu = new Menu ();
MenuItem menuitem = null; MenuItem menuitem = null;
string label = null; string label = null;
GLib.SList group = null; GLib.SList group = new GLib.SList (IntPtr.Zero);
if (tearoff) { if (tearoff) {
menuitem = new TearoffMenuItem (); menuitem = new TearoffMenuItem ();
@ -121,12 +118,9 @@ namespace WidgetViewer {
for (int i = 0, j = 1; i < 5; i++, j++) { for (int i = 0, j = 1; i < 5; i++, j++) {
label = String.Format ("item {0} - {1}", depth, j); label = String.Format ("item {0} - {1}", depth, j);
Console.WriteLine ("label: " + label); // menuitem = RadioMenuItem.NewWithLabel (group, label);
menuitem = RadioMenuItem.NewWithLabel (group, label); // group = ((RadioMenuItem) menuitem).Group;
menuitem = new MenuItem (label);
group = ((RadioMenuItem) menuitem).Group;
Console.WriteLine ("Pass");
menu.Append (menuitem); menu.Append (menuitem);
if (i == 3) if (i == 3)

View file

@ -28,10 +28,15 @@ namespace WidgetViewer {
VBox box1 = new VBox (false, 0); VBox box1 = new VBox (false, 0);
window.Add (box1); window.Add (box1);
box2 = new VBox (false, 5); box2 = new VBox (false, 5);
box2.BorderWidth = 10; box2.BorderWidth = 10;
box1.PackStart (box2, true, true, 0);
Frame frame = new Frame ("Select a widget");
frame.BorderWidth = 5;
frame.Add (box2);
box1.PackStart (frame, true, true, 0);
AddButton ("Bi-directional flipping", new EventHandler (Flipping)); AddButton ("Bi-directional flipping", new EventHandler (Flipping));
AddButton ("Check Buttons", new EventHandler (Check_Buttons)); AddButton ("Check Buttons", new EventHandler (Check_Buttons));
@ -82,6 +87,7 @@ namespace WidgetViewer {
static void Viewer_Delete (object o, DeleteEventArgs args) static void Viewer_Delete (object o, DeleteEventArgs args)
{ {
viewer.Destroy (); viewer.Destroy ();
viewer = null;
args.RetVal = true; args.RetVal = true;
} }