Create a CustomView and add it into a DockingView

About Monkey 2 Forums Monkey 2 Programming Help Create a CustomView and add it into a DockingView

This topic contains 4 replies, has 2 voices, and was last updated by  cocon 1 year, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12540

    cocon
    Participant

    Do you know how can I create my own view class and add GUI elements to it?

    [Old Code Deleted]

    #12548

    nerobot
    Participant

    Try to add in constructor of CustomView:

    And possibly right there:

    dockingView.Layout=”fill”

    #12549

    cocon
    Participant

    Hi Nerobot, I had a look at the monkey examples and I figured out that by looking at the “stargate.monkey2” example.

    This is a reimplementation of what other GUI elements do, such as the Label or something else. For example instead of managing the stack with the views myself I found that I can extend the label and have the same idea.

    I think that a new GUI element to be added to mojox, for example currently the hierarchy goes like this: View > Label, View > Button, then this new element would be done like this, View > ViewComponent.

    How it should be named? i.e: ViewComponent, ViewNode, ViewControl, etc.

    #12550

    nerobot
    Participant

    Naming depends on what that component will do.

    I don’t understand what do you want to achieve here. Kind of container? But we already have DockingView as a good container.

    #12551

    cocon
    Participant

    Oh, you ‘re saying that I would just use DockingView instead.

    It seems that this is what works best.

    Hopefully all of these snippets posted into this forum will be used to create a nice collection of examples. 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.