mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-25 21:15:27 +00:00
7f3171c814
is now tracking Gnome 2.6. svn path=/trunk/gtk-sharp/; revision=35479
43 lines
1.1 KiB
C#
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"; }
|
|
}
|
|
}
|
|
}
|