SplitHorizontal splits the container along the horizontal axis into two sub containers. The use of this option removes any widget placed at this container, containers with sub containers cannot contain widgets.
(t TopOption, b BottomOption, opts ...SplitOption)
| 414 | // containers. The use of this option removes any widget placed at this |
| 415 | // container, containers with sub containers cannot contain widgets. |
| 416 | func SplitHorizontal(t TopOption, b BottomOption, opts ...SplitOption) Option { |
| 417 | return option(func(c *Container) error { |
| 418 | c.opts.split = splitTypeHorizontal |
| 419 | c.opts.widget = nil |
| 420 | for _, opt := range opts { |
| 421 | if err := opt.setSplit(c.opts); err != nil { |
| 422 | return err |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | if err := c.createFirst(t.tOpts()); err != nil { |
| 427 | return err |
| 428 | } |
| 429 | |
| 430 | return c.createSecond(b.bOpts()) |
| 431 | }) |
| 432 | } |
| 433 | |
| 434 | // ID sets an identifier for this container. |
| 435 | // This ID can be later used to perform dynamic layout changes by passing new |