GtkSharp/sample/panelapplet/testapplet.cs
Mike Kestner 7f3171c814 merge to HEAD of jeroen and friends' work on the 2-4 branch. HEAD
is now tracking Gnome 2.6.

svn path=/trunk/gtk-sharp/; revision=35479
2004-10-29 20:33:07 +00:00

43 lines
1.1 KiB
C#

using System;
using PanelApplet;
using Gtk;
namespace AppletTest
{
public class PanelAppletClass : PanelApplet
{
protected PanelAppletClass (IntPtr raw) : base (raw) {}
static void Main (string[] argv)
{
Gnome.Program p = new Gnome.Program ("CSharpTestApplet", "0.1", Gnome.Modules.UI, argv);
AppletFactory.Register (typeof (PanelAppletClass));
}
Label testLabel;
public override void Creation ()
{
testLabel = new Label ("MonoTest");
this.Add (testLabel);
this.ShowAll ();
string xml = "<popup name=\"button3\"><menuitem name=\"Properties\" verb=\"LabelChange\" _label=\"_Change Label\" pixtype=\"stock\" pixname=\"gtk-properties\"/></popup>";
this.SetupMenu (xml, new BonoboUIVerb [] { new BonoboUIVerb ("LabelChange", new ContextMenuItemCallback (LabelChangeCB)) });
}
int i = 0;
void LabelChangeCB ()
{
testLabel.Text = String.Format ("Changed {0} time(s).", ++i);
}
public override string IID {
get { return "OAFIID:CSharpTestApplet"; }
}
public override string FactoryIID {
get { return "OAFIID:CSharpTestApplet_Factory"; }
}
}
}