예제 #1
0
        static public void Initilize(GtkEngine engine)
        {
            engine.AddLinkInfo <Widget>("width", "WidthRequest");
            engine.AddLinkInfo <Widget>("height", "HeightRequest");

            engine.AddFunctionHookInfo <Widget>("on_delete", "DeleteEvent");
        }
예제 #2
0
        static public void Initilize(GtkEngine engine)
        {
            engine.AddSimpleInstancer("HorizontalSlider", () => new HScale(0.0, 1.0, 0.01));
            engine.AddPublicPropertyAttributeLinksForType <HScale>();

            engine.AddSimpleInstancer("VerticalSlider", () => new VScale(0.0, 1.0, 0.01));
            engine.AddPublicPropertyAttributeLinksForType <VScale>();

            engine.AddLinkInfo <Scale>("minimum", "Adjustment.Lower");
            engine.AddLinkInfo <Scale>("maximum", "Adjustment.Upper");
        }
예제 #3
0
        static public void Initilize(GtkEngine engine)
        {
            engine.AddSimpleInstancer <MenuBar>("Menu");
            engine.AddPublicPropertyAttributeLinksForType <MenuBar>();

            engine.AddSimpleInstancer <MenuItem>("MenuItem");
            engine.AddPublicPropertyAttributeLinksForType <MenuItem>();

            engine.AddLinkInfo <MenuItem, string>("label", (i, s) =>
                                                  i.SetChild(new AccelLabel(s).Chain(l => l.AccelWidget = i))
                                                  );

            engine.AddFunctionInfo <MenuItem>("action", (i, s) => i.Activated += s.GetEventHandler());
            engine.AddSingleDynamicChildInfo <MenuItem, Widget>("contents", (i, w) => i.SetChild(w));

            engine.AddDynamicChildrenInfo <MenuItem, MenuItem>(
                (i, p) => i.RemoveSubmenuChildAt(p),
                (i, c) => i.AddSubmenuChild(c),
                (i, p, c) => i.InsertSubmenuChild(p, c)
                );
        }
예제 #4
0
        static public void Initilize(GtkEngine engine)
        {
            engine.AddSimpleInstancer <Entry>("TextField");
            engine.AddPublicPropertyAttributeLinksForType <Entry>();

            engine.AddVariationInstancer <Entry>("SmallField", "TextField", e => {
                e.Focused += (o, args) => e.SelectAllText();
            });

            engine.AddVariationInstancer <Entry>("StringField", "SmallField", b => {
                b.InputPurpose = InputPurpose.FreeForm;
            });
            engine.AddVariationInstancer <Entry>("IntField", "SmallField", b => {
                b.InputPurpose = InputPurpose.Number;
            });
            engine.AddVariationInstancer <Entry>("FloatField", "SmallField", b => {
                b.InputPurpose = InputPurpose.Number;
            });

            engine.AddLinkInfo <Entry, string>("value", (e, v) => e.Text = v, e => e.Text);

            engine.AddSimpleInstancer <TextView>("TextBox");
            engine.AddPublicPropertyAttributeLinksForType <TextView>();
        }