Пример #1
0
        static public void Initilize(GtkEngine engine)
        {
            engine.AddDynamicChildrenInfo <Container, Widget>((c, i) => c.RemoveChildAt(i), (c, w) => c.AddChild(w), (c, i, w) => c.InsertChild(i, w));

            engine.AddSimpleInstancer("HorizontalLayout", () => new Box(Orientation.Horizontal, 0));
            engine.AddSimpleInstancer("VerticalLayout", () => new Box(Orientation.Vertical, 0));
            engine.AddPublicPropertyAttributeLinksForType <Box>();

            engine.AddSimpleInstancer <Grid>();
            engine.AddPublicPropertyAttributeLinksForType <Grid>();

            engine.AddChildPropertyOfParentLinkInfo <Grid, Widget, int>("row", "top-attach");
            engine.AddChildPropertyOfParentLinkInfo <Grid, Widget, int>("column", "left-attach");

            engine.AddChildPropertyOfParentLinkInfo <Grid, Widget, int>("row_span", "height");
            engine.AddChildPropertyOfParentLinkInfo <Grid, Widget, int>("column_span", "width");

            engine.AddSimpleInstancer <HPaned>("HorizontalSplitContainer");
            engine.AddPublicPropertyAttributeLinksForType <HPaned>();

            engine.AddSimpleInstancer <VPaned>("VerticalSplitContainer");
            engine.AddPublicPropertyAttributeLinksForType <VPaned>();

            engine.AddSingleDynamicChildInfo <Paned, Widget>("child1", (p, w) => p.Add1(w));
            engine.AddSingleDynamicChildInfo <Paned, Widget>("child2", (p, w) => p.Add2(w));
            engine.AddStaticChildrenInfo <Paned, Widget>((p, w) => p.Add(w));

            engine.AddSimpleInstancer <FlowBox>();
            engine.AddPublicPropertyAttributeLinksForType <FlowBox>();
        }
Пример #2
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)
                );
        }