Skip to content

GroupPanel type woes #2

Open
Open
@Sciss

Description

@Sciss

I am regularly running into trouble trying to figure out how to massage my components to fit into the GroupPanel's groups. I have come up with all sorts of crazy type conversions, and once again I forgot how I managed. It would be great to have an example that shows how to accomplish the IMO standard case of creating a group from a collection of widgets:

val labels  = (1 to 10).map(i => new Label(i.toString))
val fields  = (1 to 10).map(i => new TextField(10))

new GroupPanel {
  theHorizontalLayout is Sequential(
    Parallel(labels: _*), Parallel(fields: _*)  // type mismatch: required: Seq[this.InParallel]
  )
  theVerticalLayout is Sequential(              // type mismatch: required: Seq[this.InSequential]
    (labels zip fields).map { case (lb, f) =>
      Parallel(Baseline)(lb, f)
    }: _*
  )
}

This drives me nuts. InParallel and InSequential are private types, so the straight forward : InParallel doesn't work.

Am I blind not to see the solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions