implement some of the DemoApplicationWindow
fix some bugs in DemoEditableCells use more consistent tabs and spaces add a TODO of what is left use the using () pattern to dispose Dialogs automatically use args.RetVal when handling the DeleteEvent svn path=/trunk/gtk-sharp/; revision=32017
This commit is contained in:
parent
92553bb827
commit
db410e9497
19 changed files with 636 additions and 698 deletions
|
@ -1,2 +1,4 @@
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
|
GtkDemo.exe
|
||||||
|
GtkDemo.exe.mdb
|
||||||
|
|
|
@ -19,24 +19,29 @@ using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoApplicationWindow
|
public class DemoApplicationWindow : Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
// for the statusbar
|
||||||
|
const int ctx = 1;
|
||||||
|
const string fmt = "Cursor at row {0} column {1} - {2} chars in document";
|
||||||
|
int row, column, count = 0;
|
||||||
|
|
||||||
|
Statusbar statusbar;
|
||||||
|
|
||||||
// static ItemFactoryEntry items[] = { new ItemFactoryEntry ("/_File", null, 0, 0, "<Branch>" )};
|
// static ItemFactoryEntry items[] = { new ItemFactoryEntry ("/_File", null, 0, 0, "<Branch>" )};
|
||||||
|
|
||||||
public DemoApplicationWindow ()
|
public DemoApplicationWindow () : base ("Demo Application Window")
|
||||||
{
|
{
|
||||||
window = new Gtk.Window ("Demo Application Window");
|
this.SetDefaultSize (400, 300);
|
||||||
window.SetDefaultSize (400, 300);
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
|
||||||
|
|
||||||
VBox vbox = new VBox (false, 0);
|
VBox vbox = new VBox (false, 0);
|
||||||
window.Add (vbox);
|
this.Add (vbox);
|
||||||
|
|
||||||
// Create the menubar
|
// Create the menubar
|
||||||
|
|
||||||
AccelGroup accelGroup = new AccelGroup ();
|
AccelGroup accelGroup = new AccelGroup ();
|
||||||
window.AddAccelGroup (accelGroup);
|
this.AddAccelGroup (accelGroup);
|
||||||
|
|
||||||
MenuBar menubar = CreateMenu ();
|
MenuBar menubar = CreateMenu ();
|
||||||
vbox.PackStart (menubar, false, false, 0);
|
vbox.PackStart (menubar, false, false, 0);
|
||||||
|
@ -45,10 +50,12 @@ namespace GtkDemo
|
||||||
vbox.PackStart (toolbar, false, false, 0);
|
vbox.PackStart (toolbar, false, false, 0);
|
||||||
|
|
||||||
TextView textview = new TextView ();
|
TextView textview = new TextView ();
|
||||||
|
textview.Buffer.MarkSet += new MarkSetHandler (OnMarkSet);
|
||||||
vbox.PackStart (textview, true, true, 0);
|
vbox.PackStart (textview, true, true, 0);
|
||||||
|
|
||||||
Statusbar statusbar = new Statusbar ();
|
statusbar = new Statusbar ();
|
||||||
statusbar.Push (1, "Cursor at row 0 column 0 - 0 chars in document");
|
UpdateStatus ();
|
||||||
|
|
||||||
vbox.PackStart (statusbar, false, false, 0);
|
vbox.PackStart (statusbar, false, false, 0);
|
||||||
|
|
||||||
//ItemFactory itemFactory = new ItemFactory (typeof (MenuBar),"<main>", accelGroup);
|
//ItemFactory itemFactory = new ItemFactory (typeof (MenuBar),"<main>", accelGroup);
|
||||||
|
@ -63,7 +70,7 @@ namespace GtkDemo
|
||||||
// create menu items
|
// create menu items
|
||||||
//STUCK : Didn't find any examples of ItemFactory
|
//STUCK : Didn't find any examples of ItemFactory
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private MenuBar CreateMenu ()
|
private MenuBar CreateMenu ()
|
||||||
|
@ -95,16 +102,32 @@ namespace GtkDemo
|
||||||
|
|
||||||
private void OnToolbarClicked (object o, EventArgs args)
|
private void OnToolbarClicked (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
MessageDialog md = new MessageDialog (window, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Close, "You selected a toolbar button.");
|
using (MessageDialog md = new MessageDialog (this, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Close, "You selected a toolbar button.")) {
|
||||||
md.Run ();
|
md.Run ();
|
||||||
md.Hide ();
|
md.Hide ();
|
||||||
md.Dispose ();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnMarkSet (object o, MarkSetArgs args)
|
||||||
|
{
|
||||||
|
TextIter iter = args.Location;
|
||||||
|
row = iter.Line + 1;
|
||||||
|
column = iter.VisibleLineOffset;
|
||||||
|
count = args.Mark.Buffer.CharCount;
|
||||||
|
UpdateStatus ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateStatus ()
|
||||||
|
{
|
||||||
|
statusbar.Pop (ctx);
|
||||||
|
statusbar.Push (ctx, String.Format (fmt, row, column, count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,25 +12,20 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoButtonBox
|
public class DemoButtonBox : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
public DemoButtonBox () : base ("Button Boxes")
|
||||||
|
|
||||||
public DemoButtonBox ()
|
|
||||||
{
|
{
|
||||||
// Create a Window
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window = new Gtk.Window ("Button Boxes");
|
this.BorderWidth = 10;
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
|
||||||
window.BorderWidth = 10;
|
|
||||||
|
|
||||||
// Add Vertical Box
|
// Add Vertical Box
|
||||||
VBox mainVbox = new VBox (false,0);
|
VBox mainVbox = new VBox (false,0);
|
||||||
window.Add (mainVbox);
|
this.Add (mainVbox);
|
||||||
|
|
||||||
// Add Horizontal Frame
|
// Add Horizontal Frame
|
||||||
Frame horizontalFrame = new Frame ("Horizontal Button Boxes");
|
Frame horizontalFrame = new Frame ("Horizontal Button Boxes");
|
||||||
|
@ -58,7 +53,7 @@ namespace GtkDemo
|
||||||
hbox.PackStart(CreateButtonBox (false, "Start (spacing 20)", 20, 85, 20, ButtonBoxStyle.Start));
|
hbox.PackStart(CreateButtonBox (false, "Start (spacing 20)", 20, 85, 20, ButtonBoxStyle.Start));
|
||||||
hbox.PackStart(CreateButtonBox (false, "End (spacing 20)", 20, 85, 20, ButtonBoxStyle.End));
|
hbox.PackStart(CreateButtonBox (false, "End (spacing 20)", 20, 85, 20, ButtonBoxStyle.End));
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a Button Box with the specified parameters
|
// Create a Button Box with the specified parameters
|
||||||
|
@ -95,8 +90,9 @@ namespace GtkDemo
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,28 +13,23 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Gdk;
|
using Gdk;
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoColorSelection
|
public class DemoColorSelection : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window ;
|
|
||||||
private Gdk.Color color;
|
private Gdk.Color color;
|
||||||
private ColorSelectionDialog colorSelectionDialog;
|
|
||||||
private Gtk.DrawingArea drawingArea;
|
private Gtk.DrawingArea drawingArea;
|
||||||
|
|
||||||
public DemoColorSelection ()
|
public DemoColorSelection () : base ("Color Selection")
|
||||||
{
|
{
|
||||||
window = new Gtk.Window ("Color Selection");
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
this.BorderWidth = 8;
|
||||||
window.BorderWidth = 8;
|
|
||||||
VBox vbox = new VBox (false,8);
|
VBox vbox = new VBox (false,8);
|
||||||
vbox.BorderWidth = 8;
|
vbox.BorderWidth = 8;
|
||||||
window.Add (vbox);
|
this.Add (vbox);
|
||||||
|
|
||||||
// Create the color swatch area
|
// Create the color swatch area
|
||||||
Frame frame = new Frame ();
|
Frame frame = new Frame ();
|
||||||
|
@ -56,13 +51,14 @@ namespace GtkDemo
|
||||||
alignment.Add (button);
|
alignment.Add (button);
|
||||||
vbox.PackStart (alignment);
|
vbox.PackStart (alignment);
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expose callback for the drawing area
|
// Expose callback for the drawing area
|
||||||
|
@ -81,28 +77,21 @@ namespace GtkDemo
|
||||||
|
|
||||||
private void ChangeColorCallback (object o, EventArgs args)
|
private void ChangeColorCallback (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
colorSelectionDialog = new ColorSelectionDialog ("Changing color");
|
using (ColorSelectionDialog colorSelectionDialog = new ColorSelectionDialog ("Changing color")) {
|
||||||
colorSelectionDialog.TransientFor = window;
|
colorSelectionDialog.TransientFor = this;
|
||||||
colorSelectionDialog.ColorSelection.PreviousColor = color;
|
colorSelectionDialog.ColorSelection.PreviousColor = color;
|
||||||
colorSelectionDialog.ColorSelection.CurrentColor = color;
|
colorSelectionDialog.ColorSelection.CurrentColor = color;
|
||||||
colorSelectionDialog.ColorSelection.HasPalette = true;
|
colorSelectionDialog.ColorSelection.HasPalette = true;
|
||||||
|
|
||||||
colorSelectionDialog.CancelButton.Clicked += new EventHandler (Color_Selection_Cancel);
|
if (colorSelectionDialog.Run () == (int) ResponseType.Ok)
|
||||||
colorSelectionDialog.OkButton.Clicked += new EventHandler (Color_Selection_OK);
|
|
||||||
|
|
||||||
colorSelectionDialog.ShowAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Color_Selection_OK (object o, EventArgs args)
|
|
||||||
{
|
{
|
||||||
Gdk.Color selected = colorSelectionDialog.ColorSelection.CurrentColor;
|
Gdk.Color selected = colorSelectionDialog.ColorSelection.CurrentColor;
|
||||||
drawingArea.ModifyBg (StateType.Normal, selected);
|
drawingArea.ModifyBg (StateType.Normal, selected);
|
||||||
colorSelectionDialog.Destroy ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Color_Selection_Cancel (object o, EventArgs args)
|
colorSelectionDialog.Hide ();
|
||||||
{
|
|
||||||
colorSelectionDialog.Destroy ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,26 +16,24 @@
|
||||||
// - Check how to handle response type. Can we make the button to have
|
// - Check how to handle response type. Can we make the button to have
|
||||||
// the binding to the cancel signal automagicly like in
|
// the binding to the cancel signal automagicly like in
|
||||||
// gtk_dialog_new_with_buttons or should we just use the if ?
|
// gtk_dialog_new_with_buttons or should we just use the if ?
|
||||||
using System;
|
|
||||||
|
|
||||||
|
using System;
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoDialog
|
public class DemoDialog : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
|
||||||
private Entry entry1;
|
private Entry entry1;
|
||||||
private Entry entry2;
|
private Entry entry2;
|
||||||
|
|
||||||
public DemoDialog ()
|
public DemoDialog () : base ("Dialogs")
|
||||||
{
|
{
|
||||||
window = new Gtk.Window ("Dialogs");
|
this.DeleteEvent += new DeleteEventHandler(WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler(WindowDelete);
|
this.BorderWidth = 8;
|
||||||
window.BorderWidth = 8;
|
|
||||||
|
|
||||||
Frame frame = new Frame ("Dialogs");
|
Frame frame = new Frame ("Dialogs");
|
||||||
window.Add (frame);
|
this.Add (frame);
|
||||||
|
|
||||||
VBox vbox = new VBox (false, 8);
|
VBox vbox = new VBox (false, 8);
|
||||||
vbox.BorderWidth = 8;
|
vbox.BorderWidth = 8;
|
||||||
|
@ -76,36 +74,40 @@ namespace GtkDemo
|
||||||
table.Attach (entry2, 1, 2, 1, 2);
|
table.Attach (entry2, 1, 2, 1, 2);
|
||||||
label.MnemonicWidget = entry2;
|
label.MnemonicWidget = entry2;
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int i = 1;
|
private int i = 1;
|
||||||
private void MessageDialogClicked (object o, EventArgs args)
|
private void MessageDialogClicked (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
string message = String.Format ("This message box has been popped up the following\n number of times:\n\n {0:D} ", i);
|
string message = String.Format ("This message box has been popped up the following\n number of times:\n\n {0:D} ", i);
|
||||||
Dialog dialog = new MessageDialog(window,
|
|
||||||
|
using (Dialog dialog = new MessageDialog (this,
|
||||||
DialogFlags.Modal | DialogFlags.DestroyWithParent,
|
DialogFlags.Modal | DialogFlags.DestroyWithParent,
|
||||||
MessageType.Info,
|
MessageType.Info,
|
||||||
ButtonsType.Ok,
|
ButtonsType.Ok,
|
||||||
message);
|
message)) {
|
||||||
dialog.Run ();
|
dialog.Run ();
|
||||||
dialog.Destroy ();
|
dialog.Hide ();
|
||||||
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InteractiveDialogClicked (object o, EventArgs args)
|
private void InteractiveDialogClicked (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
MessageDialog dialog = new MessageDialog (window,
|
using (MessageDialog dialog = new MessageDialog (this,
|
||||||
DialogFlags.Modal | DialogFlags.DestroyWithParent,
|
DialogFlags.Modal | DialogFlags.DestroyWithParent,
|
||||||
MessageType.Question,
|
MessageType.Question,
|
||||||
ButtonsType.Ok,
|
ButtonsType.Ok,
|
||||||
null);
|
null)) {
|
||||||
|
|
||||||
dialog.AddButton ("_Non-stock Button", (int) ResponseType.Cancel);
|
dialog.AddButton ("_Non-stock Button", (int) ResponseType.Cancel);
|
||||||
|
|
||||||
|
@ -142,7 +144,9 @@ namespace GtkDemo
|
||||||
entry2.Text = localEntry2.Text;
|
entry2.Text = localEntry2.Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.Destroy ();
|
dialog.Hide ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,32 +22,29 @@
|
||||||
* to clear the area.
|
* to clear the area.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
using Gdk;
|
using Gdk;
|
||||||
|
|
||||||
namespace GtkDemo {
|
namespace GtkDemo
|
||||||
public class DemoDrawingArea
|
{
|
||||||
|
public class DemoDrawingArea : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
|
||||||
private static Pixmap pixmap = null;
|
private static Pixmap pixmap = null;
|
||||||
private static DrawingArea drawingArea;
|
private static DrawingArea drawingArea;
|
||||||
private static DrawingArea drawingArea1;
|
private static DrawingArea drawingArea1;
|
||||||
|
|
||||||
public DemoDrawingArea ()
|
public DemoDrawingArea () : base ("Drawing Area")
|
||||||
{
|
{
|
||||||
window = new Gtk.Window ("Drawing Area");
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
this.BorderWidth = 8;
|
||||||
window.BorderWidth = 8;
|
|
||||||
|
|
||||||
VBox vbox = new VBox (false, 8);
|
VBox vbox = new VBox (false, 8);
|
||||||
vbox.BorderWidth = 8;
|
vbox.BorderWidth = 8;
|
||||||
window.Add (vbox);
|
this.Add (vbox);
|
||||||
|
|
||||||
// Create the checkerboard area
|
// Create the checkerboard area
|
||||||
Label label = new Label(null);
|
Label label = new Label ();
|
||||||
label.Markup = "<u>Checkerboard pattern</u>";
|
label.Markup = "<u>Checkerboard pattern</u>";
|
||||||
vbox.PackStart (label, false, false, 0);
|
vbox.PackStart (label, false, false, 0);
|
||||||
|
|
||||||
|
@ -87,13 +84,14 @@ namespace GtkDemo {
|
||||||
drawingArea1.Events = EventMask.LeaveNotifyMask | EventMask.ButtonPressMask |
|
drawingArea1.Events = EventMask.LeaveNotifyMask | EventMask.ButtonPressMask |
|
||||||
EventMask.PointerMotionMask | EventMask.PointerMotionHintMask;
|
EventMask.PointerMotionMask | EventMask.PointerMotionHintMask;
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckerboardExpose (object o, ExposeEventArgs args)
|
private void CheckerboardExpose (object o, ExposeEventArgs args)
|
||||||
|
@ -122,7 +120,6 @@ namespace GtkDemo {
|
||||||
color.Blue = 65535;
|
color.Blue = 65535;
|
||||||
gc2.RgbFgColor = color;
|
gc2.RgbFgColor = color;
|
||||||
|
|
||||||
|
|
||||||
// Start redrawing the Checkerboard
|
// Start redrawing the Checkerboard
|
||||||
xcount = 0;
|
xcount = 0;
|
||||||
i = Spacing;
|
i = Spacing;
|
||||||
|
@ -146,7 +143,6 @@ namespace GtkDemo {
|
||||||
// return true because we've handled this event, so no
|
// return true because we've handled this event, so no
|
||||||
// further processing is required.
|
// further processing is required.
|
||||||
args.RetVal = true;
|
args.RetVal = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ScribbleExpose (object o, ExposeEventArgs args)
|
private void ScribbleExpose (object o, ExposeEventArgs args)
|
||||||
|
@ -218,7 +214,6 @@ namespace GtkDemo {
|
||||||
args.RetVal = true;
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Draw a rectangle on the screen
|
// Draw a rectangle on the screen
|
||||||
static void DrawBrush (double x, double y)
|
static void DrawBrush (double x, double y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,26 +16,23 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoEditableCells
|
public class DemoEditableCells : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
|
||||||
private ListStore store;
|
private ListStore store;
|
||||||
private TreeView treeView;
|
private TreeView treeView;
|
||||||
private ArrayList articles;
|
private ArrayList articles;
|
||||||
|
|
||||||
public DemoEditableCells ()
|
public DemoEditableCells () : base ("Color Selection")
|
||||||
{
|
{
|
||||||
window = new Gtk.Window ("Color Selection");
|
this.SetDefaultSize (320, 200);
|
||||||
window.SetDefaultSize (320, 200);
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
|
||||||
|
|
||||||
VBox vbox = new VBox (false, 5);
|
VBox vbox = new VBox (false, 5);
|
||||||
window.Add (vbox);
|
this.Add (vbox);
|
||||||
|
|
||||||
vbox.PackStart (new Label ("Shopping list (you can edit the cells!)"), false, false, 0);
|
vbox.PackStart (new Label ("Shopping list (you can edit the cells!)"), false, false, 0);
|
||||||
|
|
||||||
|
@ -63,11 +60,9 @@ namespace GtkDemo
|
||||||
button.Clicked += new EventHandler (RemoveItem);
|
button.Clicked += new EventHandler (RemoveItem);
|
||||||
hbox.PackStart (button, true, true, 0);
|
hbox.PackStart (button, true, true, 0);
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void AddColumns ()
|
private void AddColumns ()
|
||||||
{
|
{
|
||||||
CellRendererText renderer;
|
CellRendererText renderer;
|
||||||
|
@ -79,7 +74,6 @@ namespace GtkDemo
|
||||||
treeView.AppendColumn ("Number", renderer,
|
treeView.AppendColumn ("Number", renderer,
|
||||||
"text", (int) Column.Number);
|
"text", (int) Column.Number);
|
||||||
|
|
||||||
|
|
||||||
// product column
|
// product column
|
||||||
renderer = new CellRendererText ();
|
renderer = new CellRendererText ();
|
||||||
renderer.Edited += new EditedHandler (TextCellEdited);
|
renderer.Edited += new EditedHandler (TextCellEdited);
|
||||||
|
@ -91,7 +85,6 @@ namespace GtkDemo
|
||||||
|
|
||||||
private void CreateModel ()
|
private void CreateModel ()
|
||||||
{
|
{
|
||||||
|
|
||||||
// create array
|
// create array
|
||||||
articles = new ArrayList ();
|
articles = new ArrayList ();
|
||||||
AddItems ();
|
AddItems ();
|
||||||
|
@ -101,7 +94,6 @@ namespace GtkDemo
|
||||||
// add items
|
// add items
|
||||||
foreach (Item item in articles)
|
foreach (Item item in articles)
|
||||||
store.AppendValues (item.Number, item.Product, item.Editable);
|
store.AppendValues (item.Number, item.Product, item.Editable);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddItems ()
|
private void AddItems ()
|
||||||
|
@ -126,56 +118,40 @@ namespace GtkDemo
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: This is ugly.
|
|
||||||
// Figure out why the following line doesn't work
|
|
||||||
// Console.WriteLine ("articles[i] {0}", articles[i].Number);
|
|
||||||
// the code would definitely look better if I havent to do the
|
|
||||||
// following midle step to get the Number.
|
|
||||||
// foo.Number = Convert.ToInt32(args.NewText);
|
|
||||||
//, Figure out why I'm not catching the execptions..
|
|
||||||
private void NumberCellEdited (object o, EditedArgs args)
|
private void NumberCellEdited (object o, EditedArgs args)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
Item foo;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
i = Convert.ToInt32 (args.Path);
|
i = Convert.ToInt32 (args.Path);
|
||||||
|
foo = (Item) articles[i];
|
||||||
|
foo.Number = int.Parse (args.NewText);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine ("Exeception {0}",e);
|
Console.WriteLine (e.ToString ());
|
||||||
return; // This return should exit the callback but it doesn't
|
return;
|
||||||
}
|
}
|
||||||
Console.WriteLine ("--NUMBER--1");
|
|
||||||
// //Console.WriteLine ("Path {0}", args.Path);
|
TreeIter iter;
|
||||||
// //Console.WriteLine ("NewText {0}", args.NewText);
|
|
||||||
// //Console.WriteLine ("articles[i] {0}",articles[i]);
|
|
||||||
Item foo = (Item) articles[i];
|
|
||||||
// //Console.WriteLine ("foo.Number {0}", foo.Number);
|
|
||||||
// //Console.WriteLine ("");
|
|
||||||
foo.Number = Convert.ToInt32(args.NewText);
|
|
||||||
TreeIter iter = new TreeIter ();
|
|
||||||
// // How the hell do I assing the column !!!
|
|
||||||
store.GetIterFromString (out iter, args.Path);
|
store.GetIterFromString (out iter, args.Path);
|
||||||
// store.SetValue(iter, (int) Column.Number, foo.Number);
|
store.SetValue (iter, (int) Column.Number, foo.Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void TextCellEdited (object o, EditedArgs args)
|
private void TextCellEdited (object o, EditedArgs args)
|
||||||
{
|
{
|
||||||
int i = Convert.ToInt32(args.Path);
|
int i = int.Parse (args.Path);
|
||||||
// Console.WriteLine ("--PRODUCT--");
|
|
||||||
// Console.WriteLine ("Path {0}", args.Path);
|
|
||||||
// Console.WriteLine ("NewText {0}", args.NewText);
|
|
||||||
// Console.WriteLine ("articles[i] {0}",articles[i]);
|
|
||||||
Item foo = (Item) articles[i];
|
Item foo = (Item) articles[i];
|
||||||
// Console.WriteLine ("foo.Product {0}", foo.Product);
|
|
||||||
// Console.WriteLine ("");
|
|
||||||
foo.Product = args.NewText;
|
foo.Product = args.NewText;
|
||||||
TreeIter iter = new TreeIter ();
|
TreeIter iter;
|
||||||
store.GetIterFromString (out iter, args.Path);
|
store.GetIterFromString (out iter, args.Path);
|
||||||
store.SetValue (iter, (int) Column.Product, foo.Product);
|
store.SetValue (iter, (int) Column.Product, foo.Product);
|
||||||
}
|
}
|
||||||
|
@ -194,10 +170,9 @@ namespace GtkDemo
|
||||||
|
|
||||||
if (treeView.Selection.GetSelected (out model, out iter))
|
if (treeView.Selection.GetSelected (out model, out iter))
|
||||||
{
|
{
|
||||||
TreePath path = store.GetPath (iter);
|
int position = int.Parse (store.GetPath (iter).ToString ());
|
||||||
store.Remove (ref iter);
|
store.Remove (ref iter);
|
||||||
//articles.RemoveAt (path.Indices[0]);
|
articles.RemoveAt (position);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,21 +31,21 @@ using System.IO;
|
||||||
using Gtk;
|
using Gtk;
|
||||||
using Gdk;
|
using Gdk;
|
||||||
|
|
||||||
namespace GtkDemo {
|
namespace GtkDemo
|
||||||
public class DemoImages
|
{
|
||||||
|
public class DemoImages : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
|
||||||
private static Gtk.Image progressiveImage;
|
private static Gtk.Image progressiveImage;
|
||||||
private VBox vbox;
|
private VBox vbox;
|
||||||
public DemoImages ()
|
|
||||||
|
public DemoImages () : base ("images")
|
||||||
{
|
{
|
||||||
window = new Gtk.Window ("Images");
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
this.BorderWidth = 8;
|
||||||
window.BorderWidth = 8;
|
|
||||||
|
|
||||||
vbox = new VBox (false, 8);
|
vbox = new VBox (false, 8);
|
||||||
vbox.BorderWidth = 8;
|
vbox.BorderWidth = 8;
|
||||||
window.Add (vbox);
|
this.Add (vbox);
|
||||||
|
|
||||||
Gtk.Label label = new Gtk.Label ("<u>Image loaded from a file</u>");
|
Gtk.Label label = new Gtk.Label ("<u>Image loaded from a file</u>");
|
||||||
label.UseMarkup = true;
|
label.UseMarkup = true;
|
||||||
|
@ -104,13 +104,14 @@ namespace GtkDemo {
|
||||||
vbox.PackStart (button, false, false, 0);
|
vbox.PackStart (button, false, false, 0);
|
||||||
button.Toggled += new EventHandler (ToggleSensitivity);
|
button.Toggled += new EventHandler (ToggleSensitivity);
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ToggleSensitivity (object o, EventArgs args)
|
private void ToggleSensitivity (object o, EventArgs args)
|
||||||
|
@ -122,7 +123,6 @@ namespace GtkDemo {
|
||||||
widget.Sensitive = !widget.Sensitive;
|
widget.Sensitive = !widget.Sensitive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private uint timeout_id;
|
private uint timeout_id;
|
||||||
private void StartProgressiveLoading ()
|
private void StartProgressiveLoading ()
|
||||||
{
|
{
|
||||||
|
@ -160,6 +160,5 @@ namespace GtkDemo {
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,24 +21,22 @@ using Gdk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoItemFactory
|
public class DemoItemFactory : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
public DemoItemFactory () : base ("Demo Item Factory")
|
||||||
|
|
||||||
public DemoItemFactory ()
|
|
||||||
{
|
{
|
||||||
window = new Gtk.Window (null);
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
|
||||||
Gtk.AccelGroup accelGroup = new Gtk.AccelGroup ();
|
Gtk.AccelGroup accelGroup = new Gtk.AccelGroup ();
|
||||||
//STUCK OUCH !!!!
|
//STUCK OUCH !!!!
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,18 +21,17 @@ using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
|
public class DemoListStore : Gtk.Window
|
||||||
public class DemoListStore
|
|
||||||
{
|
{
|
||||||
private Window window;
|
|
||||||
ListStore store;
|
ListStore store;
|
||||||
public DemoListStore (){
|
|
||||||
window = new Window ("ListStore Demo");
|
public DemoListStore () : base ("ListStore Demo")
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
{
|
||||||
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
|
|
||||||
VBox vbox = new VBox (false, 8);
|
VBox vbox = new VBox (false, 8);
|
||||||
vbox.BorderWidth = 8;
|
vbox.BorderWidth = 8;
|
||||||
window.Add (vbox);
|
this.Add (vbox);
|
||||||
|
|
||||||
vbox.PackStart (new Label ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though)."), false, false, 0);
|
vbox.PackStart (new Label ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though)."), false, false, 0);
|
||||||
|
|
||||||
|
@ -51,15 +50,12 @@ namespace GtkDemo
|
||||||
scrolledWindow.Add (treeView);
|
scrolledWindow.Add (treeView);
|
||||||
|
|
||||||
// finish & show
|
// finish & show
|
||||||
window.SetDefaultSize (650, 400);
|
this.SetDefaultSize (650, 400);
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: Finish implementing this function, I don't know
|
|
||||||
// why it doesn't work.
|
|
||||||
private void ItemToggled (object o, ToggledArgs args)
|
private void ItemToggled (object o, ToggledArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
Gtk.TreeIter iter;
|
Gtk.TreeIter iter;
|
||||||
if (store.GetIterFromString (out iter, args.Path))
|
if (store.GetIterFromString (out iter, args.Path))
|
||||||
{
|
{
|
||||||
|
@ -97,14 +93,13 @@ namespace GtkDemo
|
||||||
column = new TreeViewColumn ("Description", rendererText, "text", ColumnNumber.Description);
|
column = new TreeViewColumn ("Description", rendererText, "text", ColumnNumber.Description);
|
||||||
column.SortColumnId = (int) ColumnNumber.Description;
|
column.SortColumnId = (int) ColumnNumber.Description;
|
||||||
treeView.AppendColumn (column);
|
treeView.AppendColumn (column);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateModel ()
|
private void CreateModel ()
|
||||||
|
@ -119,11 +114,13 @@ namespace GtkDemo
|
||||||
store.AppendValues(bug.Fixed,
|
store.AppendValues(bug.Fixed,
|
||||||
bug.Number,
|
bug.Number,
|
||||||
bug.Severity,
|
bug.Severity,
|
||||||
bug.Description);}
|
bug.Description);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//FIXME: Insted of using numbert conver enum to array using
|
|
||||||
// GetValues and then ge the Length Property
|
// FIXME: Instead of using number convert enum to array using
|
||||||
|
// GetValues and then get the Length Property
|
||||||
public enum ColumnNumber
|
public enum ColumnNumber
|
||||||
{
|
{
|
||||||
Fixed,
|
Fixed,
|
||||||
|
@ -132,8 +129,6 @@ namespace GtkDemo
|
||||||
Description,
|
Description,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static Bug[] bugs =
|
private static Bug[] bugs =
|
||||||
{
|
{
|
||||||
new Bug ( false, 60482, "Normal", "scrollable notebooks and hidden tabs"),
|
new Bug ( false, 60482, "Normal", "scrollable notebooks and hidden tabs"),
|
||||||
|
@ -153,7 +148,6 @@ namespace GtkDemo
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class Bug
|
public class Bug
|
||||||
{
|
{
|
||||||
public bool Fixed;
|
public bool Fixed;
|
||||||
|
@ -161,9 +155,7 @@ namespace GtkDemo
|
||||||
public string Severity;
|
public string Severity;
|
||||||
public string Description;
|
public string Description;
|
||||||
|
|
||||||
public Bug ( bool status,
|
public Bug (bool status, int number, string severity,
|
||||||
int number,
|
|
||||||
string severity,
|
|
||||||
string description)
|
string description)
|
||||||
{
|
{
|
||||||
Fixed = status;
|
Fixed = status;
|
||||||
|
@ -172,5 +164,4 @@ namespace GtkDemo
|
||||||
Description = description;
|
Description = description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,6 @@ namespace GtkDemo
|
||||||
|
|
||||||
private void LoadFile (string filename)
|
private void LoadFile (string filename)
|
||||||
{
|
{
|
||||||
|
|
||||||
Stream file = File.OpenRead (filename);
|
Stream file = File.OpenRead (filename);
|
||||||
StreamReader sr = new StreamReader (file);
|
StreamReader sr = new StreamReader (file);
|
||||||
string s = sr.ReadToEnd ();
|
string s = sr.ReadToEnd ();
|
||||||
|
@ -84,10 +83,7 @@ namespace GtkDemo
|
||||||
// The gtk-logo-rgb icon has a white background, make it transparent
|
// The gtk-logo-rgb icon has a white background, make it transparent
|
||||||
Pixbuf transparent = pixbuf.AddAlpha (true, 0xff, 0xff, 0xff);
|
Pixbuf transparent = pixbuf.AddAlpha (true, 0xff, 0xff, 0xff);
|
||||||
|
|
||||||
Gdk.Pixbuf[] list = new Gdk.Pixbuf [1];
|
Gtk.Window.DefaultIconList = new Gdk.Pixbuf [] {transparent};
|
||||||
list[0] = transparent;
|
|
||||||
|
|
||||||
Gtk.Window.DefaultIconList = list;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +115,6 @@ namespace GtkDemo
|
||||||
FontDescription fontDescription = FontDescription.FromString ("Courier 12");
|
FontDescription fontDescription = FontDescription.FromString ("Courier 12");
|
||||||
textView.ModifyFont (fontDescription);
|
textView.ModifyFont (fontDescription);
|
||||||
textView.WrapMode = Gtk.WrapMode.None;
|
textView.WrapMode = Gtk.WrapMode.None;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -132,7 +127,6 @@ namespace GtkDemo
|
||||||
return scrolledWindow;
|
return scrolledWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private TreeView CreateTree ()
|
private TreeView CreateTree ()
|
||||||
{
|
{
|
||||||
treeView = new TreeView ();
|
treeView = new TreeView ();
|
||||||
|
@ -143,7 +137,7 @@ namespace GtkDemo
|
||||||
{
|
{
|
||||||
store = new TreeStore (typeof (string));
|
store = new TreeStore (typeof (string));
|
||||||
|
|
||||||
store.AppendValues ("Application Window (5% complete)");
|
store.AppendValues ("Application Window (75% complete)");
|
||||||
store.AppendValues ("Button Boxes");
|
store.AppendValues ("Button Boxes");
|
||||||
store.AppendValues ("Change Display");
|
store.AppendValues ("Change Display");
|
||||||
store.AppendValues ("Color Selector");
|
store.AppendValues ("Color Selector");
|
||||||
|
@ -158,16 +152,15 @@ namespace GtkDemo
|
||||||
store.AppendValues ("Stock Item and Icon Browser (10% complete)");
|
store.AppendValues ("Stock Item and Icon Browser (10% complete)");
|
||||||
store.AppendValues ("Text Widget (95% complete)");
|
store.AppendValues ("Text Widget (95% complete)");
|
||||||
TreeIter iter = store.AppendValues ("Tree View");
|
TreeIter iter = store.AppendValues ("Tree View");
|
||||||
store.AppendValues (iter, "Editable Cells (buggy)");
|
store.AppendValues (iter, "Editable Cells");
|
||||||
store.AppendValues (iter, "List Store");
|
store.AppendValues (iter, "List Store");
|
||||||
store.AppendValues (iter, "Tree Store (95% complete)");
|
store.AppendValues (iter, "Tree Store");
|
||||||
|
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTreeChanged (object o, EventArgs args)
|
private void OnTreeChanged (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
TreeIter iter;
|
TreeIter iter;
|
||||||
TreeModel model;
|
TreeModel model;
|
||||||
|
|
||||||
|
@ -235,7 +228,6 @@ namespace GtkDemo
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,25 +41,21 @@
|
||||||
// point on the right side
|
// point on the right side
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoMenus
|
public class DemoMenus : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
public DemoMenus () : base ("Menus")
|
||||||
|
|
||||||
public DemoMenus ()
|
|
||||||
{
|
{
|
||||||
window = new Window ("Menus");
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
|
||||||
|
|
||||||
AccelGroup accel_group = new AccelGroup ();
|
AccelGroup accel_group = new AccelGroup ();
|
||||||
window.AddAccelGroup (accel_group);
|
this.AddAccelGroup (accel_group);
|
||||||
|
|
||||||
VBox box1 = new VBox (false, 0);
|
VBox box1 = new VBox (false, 0);
|
||||||
window.Add (box1);
|
this.Add (box1);
|
||||||
|
|
||||||
MenuBar menubar = new MenuBar ();
|
MenuBar menubar = new MenuBar ();
|
||||||
box1.PackStart (menubar, false, false, 0);
|
box1.PackStart (menubar, false, false, 0);
|
||||||
|
@ -128,7 +124,7 @@ namespace GtkDemo
|
||||||
close_button.CanDefault = true;
|
close_button.CanDefault = true;
|
||||||
close_button.GrabDefault ();
|
close_button.GrabDefault ();
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Menu Create_Menu (int depth, bool tearoff)
|
private Menu Create_Menu (int depth, bool tearoff)
|
||||||
|
@ -170,14 +166,15 @@ namespace GtkDemo
|
||||||
|
|
||||||
private void Close_Button (object o, EventArgs args)
|
private void Close_Button (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,14 +22,12 @@
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoPanes
|
public class DemoPanes : Gtk.Window
|
||||||
{
|
{
|
||||||
private Window window;
|
|
||||||
private VPaned vpaned;
|
private VPaned vpaned;
|
||||||
private HPaned top;
|
private HPaned top;
|
||||||
private Frame left;
|
private Frame left;
|
||||||
|
@ -45,14 +43,14 @@ namespace GtkDemo
|
||||||
private CheckButton resizeBottom;
|
private CheckButton resizeBottom;
|
||||||
private CheckButton shrinkBottom;
|
private CheckButton shrinkBottom;
|
||||||
private Button button;
|
private Button button;
|
||||||
public DemoPanes ()
|
|
||||||
|
public DemoPanes () : base ("Panes")
|
||||||
{
|
{
|
||||||
window = new Window ("Panes");
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
this.BorderWidth = 0;
|
||||||
window.BorderWidth = 0;
|
|
||||||
|
|
||||||
VBox vbox = new VBox (false, 0);
|
VBox vbox = new VBox (false, 0);
|
||||||
window.Add (vbox);
|
this.Add (vbox);
|
||||||
|
|
||||||
vpaned = new VPaned ();
|
vpaned = new VPaned ();
|
||||||
vbox.PackStart (vpaned, true, true, 0);
|
vbox.PackStart (vpaned, true, true, 0);
|
||||||
|
@ -144,7 +142,7 @@ namespace GtkDemo
|
||||||
shrinkBottom.Active = true;
|
shrinkBottom.Active = true;
|
||||||
shrinkBottom.Toggled += new EventHandler (BottomCB);
|
shrinkBottom.Toggled += new EventHandler (BottomCB);
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LeftCB (object o, EventArgs args)
|
private void LeftCB (object o, EventArgs args)
|
||||||
|
@ -153,7 +151,6 @@ namespace GtkDemo
|
||||||
top.Pack1 (left, resizeLeft.Active, shrinkLeft.Active);
|
top.Pack1 (left, resizeLeft.Active, shrinkLeft.Active);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void RightCB (object o, EventArgs args)
|
private void RightCB (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
top.Remove (right);
|
top.Remove (right);
|
||||||
|
@ -172,11 +169,10 @@ namespace GtkDemo
|
||||||
vpaned.Pack2 (bottom, resizeBottom.Active, shrinkBottom.Active);
|
vpaned.Pack2 (bottom, resizeBottom.Active, shrinkBottom.Active);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,10 @@ namespace GtkDemo
|
||||||
|
|
||||||
public class DemoPixbuf : Gtk.Window
|
public class DemoPixbuf : Gtk.Window
|
||||||
{
|
{
|
||||||
|
|
||||||
const int FrameDelay = 50;
|
const int FrameDelay = 50;
|
||||||
const int CycleLen = 60;
|
const int CycleLen = 60;
|
||||||
const string BackgroundName = "images/background.jpg";
|
const string BackgroundName = "images/background.jpg";
|
||||||
|
|
||||||
string [] ImageNames = {
|
string [] ImageNames = {
|
||||||
"images/apple-red.png",
|
"images/apple-red.png",
|
||||||
"images/gnome-applets.png",
|
"images/gnome-applets.png",
|
||||||
|
@ -59,9 +59,6 @@ namespace GtkDemo
|
||||||
// drawing area
|
// drawing area
|
||||||
DrawingArea drawingArea;
|
DrawingArea drawingArea;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string FindFile (string name)
|
string FindFile (string name)
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
|
@ -81,11 +78,9 @@ namespace GtkDemo
|
||||||
images[i] = new Pixbuf (FindFile (ImageNames[i]));
|
images[i] = new Pixbuf (FindFile (ImageNames[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Expose callback for the drawing area
|
// Expose callback for the drawing area
|
||||||
void Expose (object o, ExposeEventArgs args)
|
void Expose (object o, ExposeEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
EventExpose ev = args.Event;
|
EventExpose ev = args.Event;
|
||||||
Widget widget = (Widget) o;
|
Widget widget = (Widget) o;
|
||||||
Gdk.Rectangle area = ev.Area;
|
Gdk.Rectangle area = ev.Area;
|
||||||
|
@ -98,11 +93,8 @@ namespace GtkDemo
|
||||||
Gdk.PixbufAlphaMode.Full, 8,
|
Gdk.PixbufAlphaMode.Full, 8,
|
||||||
RgbDither.Normal,
|
RgbDither.Normal,
|
||||||
100, 100);
|
100, 100);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// timeout handler to regenerate the frame
|
// timeout handler to regenerate the frame
|
||||||
bool timeout ()
|
bool timeout ()
|
||||||
{
|
{
|
||||||
|
@ -170,23 +162,23 @@ namespace GtkDemo
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Gtk.Window window;
|
|
||||||
|
|
||||||
public DemoPixbuf () : base ("Gdk Pixbuf Demo")
|
public DemoPixbuf () : base ("Gdk Pixbuf Demo")
|
||||||
{
|
{
|
||||||
//window = new DemoPixbuf ();
|
this.DeleteEvent += new DeleteEventHandler (OnWindowDelete);
|
||||||
//window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
|
||||||
|
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
LoadPixbuf ();
|
LoadPixbuf ();
|
||||||
} catch (Exception e) {
|
} catch (Exception e)
|
||||||
MessageDialog md = new MessageDialog (this,
|
{
|
||||||
|
using (MessageDialog md = new MessageDialog (this,
|
||||||
DialogFlags.DestroyWithParent,
|
DialogFlags.DestroyWithParent,
|
||||||
MessageType.Error,
|
MessageType.Error,
|
||||||
ButtonsType.Close,
|
ButtonsType.Close,
|
||||||
"Error: \n" + e.Message);
|
"Error: \n" + e.Message)) {
|
||||||
md.Run ();
|
md.Run ();
|
||||||
|
md.Hide ();
|
||||||
|
}
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
@ -205,13 +197,12 @@ namespace GtkDemo
|
||||||
ShowAll ();
|
ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnWindowDelete (object obj, DeleteEventArgs args)
|
||||||
static void windowDelete (object obj, DeleteEventArgs args)
|
|
||||||
{
|
{
|
||||||
Application.Quit ();
|
this.Hide ();
|
||||||
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,24 +22,21 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoSizeGroup
|
public class DemoSizeGroup : Dialog
|
||||||
{
|
{
|
||||||
private Dialog window;
|
|
||||||
private SizeGroup sizeGroup;
|
private SizeGroup sizeGroup;
|
||||||
|
|
||||||
public DemoSizeGroup ()
|
public DemoSizeGroup ()
|
||||||
{
|
{
|
||||||
window = new Dialog ();
|
this.Title = "Size groups";
|
||||||
window.Title = "Sized groups";
|
this.Resizable = false;
|
||||||
window.Resizable = false;
|
|
||||||
|
|
||||||
VBox vbox = new VBox (false, 5);
|
VBox vbox = new VBox (false, 5);
|
||||||
window.VBox.PackStart (vbox, true, true, 0);
|
this.VBox.PackStart (vbox, true, true, 0);
|
||||||
vbox.BorderWidth = 5;
|
vbox.BorderWidth = 5;
|
||||||
|
|
||||||
sizeGroup = new SizeGroup (SizeGroupMode.Horizontal);
|
sizeGroup = new SizeGroup (SizeGroupMode.Horizontal);
|
||||||
|
@ -81,10 +78,10 @@ namespace GtkDemo
|
||||||
checkButton.Toggled += new EventHandler (ButtonToggleCb);
|
checkButton.Toggled += new EventHandler (ButtonToggleCb);
|
||||||
|
|
||||||
Button CloseButton = new Button (Stock.Close);
|
Button CloseButton = new Button (Stock.Close);
|
||||||
window.AddActionWidget (CloseButton, 5);
|
this.AddActionWidget (CloseButton, ResponseType.Close);
|
||||||
window.Response += new ResponseHandler (ResponseCallback);
|
this.Response += new ResponseHandler (ResponseCallback);
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convenience function to create an option menu holding a number of strings
|
// Convenience function to create an option menu holding a number of strings
|
||||||
|
@ -147,11 +144,11 @@ namespace GtkDemo
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResponseCallback (object obj, ResponseArgs args)
|
private void ResponseCallback (object obj, ResponseArgs args)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (((int) args.ResponseId) == 5) {
|
if ((args.ResponseId) == ResponseType.Close) {
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();}
|
this.Destroy ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,24 +6,20 @@
|
||||||
// (C) 2003 Ximian, Inc.
|
// (C) 2003 Ximian, Inc.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoStockBrowser
|
public class DemoStockBrowser : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
public DemoStockBrowser () : base ("Stock Item Browser Demo")
|
||||||
|
|
||||||
public DemoStockBrowser ()
|
|
||||||
{
|
{
|
||||||
window = new Gtk.Window ("Stock Item Browser Demo");
|
this.SetDefaultSize (600, 400);
|
||||||
window.SetDefaultSize (600, 400);
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
this.BorderWidth = 8;
|
||||||
window.BorderWidth = 8;
|
|
||||||
|
|
||||||
HBox hbox = new HBox (false, 8);
|
HBox hbox = new HBox (false, 8);
|
||||||
window.Add (hbox);
|
this.Add (hbox);
|
||||||
|
|
||||||
ScrolledWindow scrolledWindow = new ScrolledWindow (null, null);
|
ScrolledWindow scrolledWindow = new ScrolledWindow (null, null);
|
||||||
scrolledWindow.SetPolicy (PolicyType.Never, PolicyType.Automatic);
|
scrolledWindow.SetPolicy (PolicyType.Never, PolicyType.Automatic);
|
||||||
|
@ -40,16 +36,9 @@ namespace GtkDemo
|
||||||
Frame frame = new Frame ();
|
Frame frame = new Frame ();
|
||||||
hbox.PackStart (frame, true, true, 0);
|
hbox.PackStart (frame, true, true, 0);
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// private TreeModel CreateModel ()
|
|
||||||
// {
|
|
||||||
// ListStore store;
|
|
||||||
// TreeModel model = new TreeModel ();
|
|
||||||
// return model;
|
|
||||||
// }
|
|
||||||
|
|
||||||
private ListStore CreateStore ()
|
private ListStore CreateStore ()
|
||||||
{
|
{
|
||||||
// image, name, label, accel
|
// image, name, label, accel
|
||||||
|
@ -66,8 +55,9 @@ namespace GtkDemo
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
* formatting features.
|
* formatting features.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
|
@ -23,21 +21,20 @@ using Gtk;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
public class DemoTextView
|
public class DemoTextView : Gtk.Window
|
||||||
{
|
{
|
||||||
private Gtk.Window window;
|
|
||||||
TextView view1;
|
TextView view1;
|
||||||
TextView view2;
|
TextView view2;
|
||||||
public DemoTextView ()
|
|
||||||
|
public DemoTextView () : base ("TextView Demo")
|
||||||
{
|
{
|
||||||
window = new Gtk.Window ("TextView Demo");
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
this.SetDefaultSize (450,450);
|
||||||
window.SetDefaultSize (450,450);
|
this.BorderWidth = 6;
|
||||||
window.BorderWidth = 0;
|
|
||||||
|
|
||||||
VPaned vpaned = new VPaned ();
|
VPaned vpaned = new VPaned ();
|
||||||
vpaned.BorderWidth = 5;
|
vpaned.BorderWidth = 5;
|
||||||
window.Add (vpaned);
|
this.Add (vpaned);
|
||||||
|
|
||||||
/* For convenience, we just use the autocreated buffer from
|
/* For convenience, we just use the autocreated buffer from
|
||||||
* the first text view; you could also create the buffer
|
* the first text view; you could also create the buffer
|
||||||
|
@ -66,14 +63,15 @@ namespace GtkDemo
|
||||||
|
|
||||||
vpaned.ShowAll();
|
vpaned.ShowAll();
|
||||||
|
|
||||||
window.ShowAll ();
|
this.ShowAll ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextChildAnchor buttonAnchor;
|
private TextChildAnchor buttonAnchor;
|
||||||
private TextChildAnchor menuAnchor;
|
private TextChildAnchor menuAnchor;
|
||||||
private TextChildAnchor scaleAnchor;
|
private TextChildAnchor scaleAnchor;
|
||||||
private TextChildAnchor animationAnchor;
|
private TextChildAnchor animationAnchor;
|
||||||
private TextChildAnchor entryAnchor;
|
private TextChildAnchor entryAnchor;
|
||||||
|
|
||||||
private void AttachWidgets (TextView textView)
|
private void AttachWidgets (TextView textView)
|
||||||
{
|
{
|
||||||
Button button = new Button ("Click Me");
|
Button button = new Button ("Click Me");
|
||||||
|
@ -106,7 +104,6 @@ namespace GtkDemo
|
||||||
Entry entry = new Entry ();
|
Entry entry = new Entry ();
|
||||||
textView.AddChildAtAnchor (entry, entryAnchor);
|
textView.AddChildAtAnchor (entry, entryAnchor);
|
||||||
image.ShowAll ();
|
image.ShowAll ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateTags (TextBuffer buffer)
|
private void CreateTags (TextBuffer buffer)
|
||||||
|
@ -392,7 +389,6 @@ namespace GtkDemo
|
||||||
TextIter insertIter, beginIter, endIter;
|
TextIter insertIter, beginIter, endIter;
|
||||||
int begin, end;
|
int begin, end;
|
||||||
|
|
||||||
|
|
||||||
begin = buffer.CharCount;
|
begin = buffer.CharCount;
|
||||||
insertIter = buffer.GetIterAtMark(buffer.InsertMark);
|
insertIter = buffer.GetIterAtMark(buffer.InsertMark);
|
||||||
buffer.Insert (insertIter, insertText);
|
buffer.Insert (insertIter, insertText);
|
||||||
|
@ -400,21 +396,22 @@ namespace GtkDemo
|
||||||
foreach (string fontItem in fontName) {
|
foreach (string fontItem in fontName) {
|
||||||
endIter = buffer.GetIterAtOffset (end);
|
endIter = buffer.GetIterAtOffset (end);
|
||||||
beginIter = buffer.GetIterAtOffset (begin);
|
beginIter = buffer.GetIterAtOffset (begin);
|
||||||
buffer.ApplyTag (fontItem, beginIter, endIter);}
|
buffer.ApplyTag (fontItem, beginIter, endIter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Insert (TextBuffer buffer , string insertText)
|
private void Insert (TextBuffer buffer , string insertText)
|
||||||
{
|
{
|
||||||
TextIter insertIter;
|
TextIter insertIter;
|
||||||
|
|
||||||
insertIter = buffer.GetIterAtMark (buffer.InsertMark);
|
insertIter = buffer.GetIterAtMark (buffer.InsertMark);
|
||||||
buffer.Insert (insertIter, insertText);
|
buffer.Insert (insertIter, insertText);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RecursiveAttach (int depth, TextView view, TextChildAnchor anchor)
|
private void RecursiveAttach (int depth, TextView view, TextChildAnchor anchor)
|
||||||
|
@ -437,7 +434,6 @@ namespace GtkDemo
|
||||||
view.AddChildAtAnchor (eventBox, anchor);
|
view.AddChildAtAnchor (eventBox, anchor);
|
||||||
|
|
||||||
RecursiveAttach (depth+1, childView, anchor);
|
RecursiveAttach (depth+1, childView, anchor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EasterEggCB (object o, EventArgs args)
|
private void EasterEggCB (object o, EventArgs args)
|
||||||
|
@ -462,7 +458,6 @@ namespace GtkDemo
|
||||||
|
|
||||||
window.SetDefaultSize (300, 400);
|
window.SetDefaultSize (300, 400);
|
||||||
window.ShowAll ();
|
window.ShowAll ();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,19 +22,17 @@ using GLib;
|
||||||
|
|
||||||
namespace GtkDemo
|
namespace GtkDemo
|
||||||
{
|
{
|
||||||
|
public class DemoTreeStore : Gtk.Window
|
||||||
public class DemoTreeStore
|
|
||||||
{
|
{
|
||||||
private Window window;
|
|
||||||
private TreeStore store;
|
private TreeStore store;
|
||||||
public DemoTreeStore ()
|
|
||||||
|
public DemoTreeStore () : base ("TreeStore Demo")
|
||||||
{
|
{
|
||||||
window = new Window ("TreeStore Demo");
|
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
||||||
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
|
|
||||||
|
|
||||||
VBox vbox = new VBox (false, 8);
|
VBox vbox = new VBox (false, 8);
|
||||||
vbox.BorderWidth = 8;
|
vbox.BorderWidth = 8;
|
||||||
window.Add (vbox);
|
this.Add (vbox);
|
||||||
|
|
||||||
vbox.PackStart (new Label ("Jonathan's Holiday Card Planning Sheet"), false, false, 0);
|
vbox.PackStart (new Label ("Jonathan's Holiday Card Planning Sheet"), false, false, 0);
|
||||||
|
|
||||||
|
@ -60,10 +58,8 @@ namespace GtkDemo
|
||||||
treeView.ExpandRow (new TreePath (i.ToString ()), false);
|
treeView.ExpandRow (new TreePath (i.ToString ()), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.SetDefaultSize (650, 400);
|
this.SetDefaultSize (650, 400);
|
||||||
|
this.ShowAll ();
|
||||||
window.ShowAll ();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ItemToggled (object o, ToggledArgs args)
|
private void ItemToggled (object o, ToggledArgs args)
|
||||||
|
@ -106,7 +102,6 @@ namespace GtkDemo
|
||||||
column.Clickable = true;
|
column.Clickable = true;
|
||||||
treeView.InsertColumn (column, (int) Column.Alex);
|
treeView.InsertColumn (column, (int) Column.Alex);
|
||||||
|
|
||||||
|
|
||||||
// havoc column
|
// havoc column
|
||||||
rendererToggle = new CellRendererToggle ();
|
rendererToggle = new CellRendererToggle ();
|
||||||
rendererToggle.Xalign = 0.0f;
|
rendererToggle.Xalign = 0.0f;
|
||||||
|
@ -166,13 +161,13 @@ namespace GtkDemo
|
||||||
column.Sizing = TreeViewColumnSizing.Fixed;
|
column.Sizing = TreeViewColumnSizing.Fixed;
|
||||||
column.FixedWidth = 50;
|
column.FixedWidth = 50;
|
||||||
column.Clickable = true;
|
column.Clickable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowDelete (object o, DeleteEventArgs args)
|
private void WindowDelete (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
window.Hide ();
|
this.Hide ();
|
||||||
window.Destroy ();
|
this.Destroy ();
|
||||||
|
args.RetVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateModel ()
|
private void CreateModel ()
|
||||||
|
@ -189,7 +184,6 @@ namespace GtkDemo
|
||||||
typeof(bool));
|
typeof(bool));
|
||||||
|
|
||||||
// add data to the tree store
|
// add data to the tree store
|
||||||
// STUCK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
|
|
||||||
foreach (MyTreeItem month in toplevel)
|
foreach (MyTreeItem month in toplevel)
|
||||||
{
|
{
|
||||||
|
@ -212,11 +206,8 @@ namespace GtkDemo
|
||||||
hollyday.Owen,
|
hollyday.Owen,
|
||||||
hollyday.Dave,
|
hollyday.Dave,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// tree data
|
// tree data
|
||||||
|
@ -327,7 +318,6 @@ namespace GtkDemo
|
||||||
};
|
};
|
||||||
|
|
||||||
// TreeItem structure
|
// TreeItem structure
|
||||||
// report bug array mismatch declaration
|
|
||||||
public class MyTreeItem
|
public class MyTreeItem
|
||||||
{
|
{
|
||||||
public string Label;
|
public string Label;
|
||||||
|
|
18
sample/GtkDemo/TODO
Normal file
18
sample/GtkDemo/TODO
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
General
|
||||||
|
- general C#-ification
|
||||||
|
- embed PixBufs instead of loading from disk
|
||||||
|
|
||||||
|
DemoApplicationWindow
|
||||||
|
- ItemFactory stuff
|
||||||
|
|
||||||
|
DemoIconFactory
|
||||||
|
- almost everything
|
||||||
|
|
||||||
|
DemoImages
|
||||||
|
- fix the progressive loading image
|
||||||
|
|
||||||
|
DemoStockBrowser
|
||||||
|
- almost everything
|
||||||
|
|
||||||
|
DemoTextView
|
||||||
|
- small issue with international text
|
Loading…
Add table
Reference in a new issue