diff --git a/button.go b/button.go index 604364d..56d1c0c 100644 --- a/button.go +++ b/button.go @@ -29,7 +29,6 @@ func NewButton (text string) *Button { label: NewLabel(text), } box.SetRole(tomo.R("objects", "Button", "")) - tomo.Apply(box) box.label.SetAlign(tomo.AlignMiddle, tomo.AlignMiddle) box.SetLayout(buttonLayout) box.SetText(text) diff --git a/checkbox.go b/checkbox.go index 040ed10..868dfde 100644 --- a/checkbox.go +++ b/checkbox.go @@ -19,7 +19,6 @@ func NewCheckbox (value bool) *Checkbox { Box: tomo.NewBox(), } box.SetRole(tomo.R("objects", "Checkbox", "")) - tomo.Apply(box) box.SetValue(false) box.OnMouseUp(box.handleMouseUp) diff --git a/heading.go b/heading.go index d9dfbe1..5e74683 100644 --- a/heading.go +++ b/heading.go @@ -16,7 +16,6 @@ func NewHeading (level int, text string) *Heading { if level > 2 { level = 2 } this := &Heading { TextBox: tomo.NewTextBox() } this.SetRole(tomo.R("objects", "Heading", fmt.Sprint(level))) - tomo.Apply(this) this.SetText(text) return this } diff --git a/icon.go b/icon.go index 74bc45a..e00cb44 100644 --- a/icon.go +++ b/icon.go @@ -16,7 +16,6 @@ func NewIcon (id tomo.Icon, size tomo.IconSize) *Icon { Box: tomo.NewBox(), } this.SetRole(tomo.R("objects", "Icon", size.String())) - tomo.Apply(this) this.SetTexture(id.Texture(size)) return this } @@ -27,7 +26,6 @@ func NewMimeIcon (mime data.Mime, size tomo.IconSize) *Icon { Box: tomo.NewBox(), } this.SetRole(tomo.R("objects", "Icon", size.String())) - tomo.Apply(this) this.SetTexture(tomo.MimeIcon(mime, size)) return this } diff --git a/label.go b/label.go index fd2ff52..a3f7806 100644 --- a/label.go +++ b/label.go @@ -11,7 +11,6 @@ type Label struct { func NewLabel (text string) *Label { this := &Label { TextBox: tomo.NewTextBox() } this.SetRole(tomo.R("objects", "Label", "")) - tomo.Apply(this) this.SetText(text) return this } diff --git a/labelcheckbox.go b/labelcheckbox.go index a15bc64..85d4d8b 100644 --- a/labelcheckbox.go +++ b/labelcheckbox.go @@ -21,7 +21,6 @@ func NewLabelCheckbox (value bool, text string) *LabelCheckbox { label: NewLabel(text), } box.SetRole(tomo.R("objects", "LabelCheckbox", "")) - tomo.Apply(box) box.label.SetAlign(tomo.AlignStart, tomo.AlignMiddle) box.Add(box.checkbox) box.Add(box.label) diff --git a/menu.go b/menu.go index 81ce649..acfe622 100644 --- a/menu.go +++ b/menu.go @@ -41,7 +41,6 @@ func NewMenu (anchor tomo.Object, items ...tomo.Object) (*Menu, error) { if !menu.torn { menu.tearLine = tomo.NewBox() menu.tearLine.SetRole(tomo.R("objects", "TearLine", "")) - tomo.Apply(menu.tearLine) menu.tearLine.SetFocusable(true) menu.tearLine.OnKeyUp(func (key input.Key, numberPad bool) { if key != input.KeyEnter && key != input.Key(' ') { return } @@ -67,7 +66,6 @@ func NewMenu (anchor tomo.Object, items ...tomo.Object) (*Menu, error) { } } menu.rootContainer.SetRole(tomo.R("objects", "Container", "menu")) - tomo.Apply(menu.rootContainer) menu.Window.SetRoot(menu.rootContainer) return menu, nil diff --git a/menuitem.go b/menuitem.go index 6f37bf6..913069d 100644 --- a/menuitem.go +++ b/menuitem.go @@ -26,7 +26,6 @@ func NewMenuItem (text string) *MenuItem { icon: NewIcon("", tomo.IconSizeSmall), } box.SetRole(tomo.R("objects", "MenuItem", "")) - tomo.Apply(box) box.label.SetAlign(tomo.AlignStart, tomo.AlignMiddle) box.SetLayout(layouts.NewGrid([]bool { false, true }, []bool { true })) diff --git a/numberinput.go b/numberinput.go index 34fc709..1ec3d89 100644 --- a/numberinput.go +++ b/numberinput.go @@ -29,7 +29,6 @@ func NewNumberInput (value float64) *NumberInput { decrement: NewButton(""), } box.SetRole(tomo.R("objects", "NumberInput", "")) - tomo.Apply(box) box.Add(box.input) box.Add(box.decrement) box.Add(box.increment) diff --git a/scrollbar.go b/scrollbar.go index cbbf95b..1554ab5 100644 --- a/scrollbar.go +++ b/scrollbar.go @@ -47,9 +47,7 @@ func newScrollbar (orient string) *Scrollbar { this.OnScroll(this.handleScroll) this.handle.SetRole(tomo.R("objects", "SliderHandle", orient)) - tomo.Apply(this.handle) this.SetRole(tomo.R("objects", "Slider", orient)) - tomo.Apply(this) return this } diff --git a/scrollcontainer.go b/scrollcontainer.go index e91d350..b7751b3 100644 --- a/scrollcontainer.go +++ b/scrollcontainer.go @@ -61,7 +61,6 @@ func NewScrollContainer (sides ScrollSide) *ScrollContainer { this.CaptureScroll(true) this.OnScroll(this.handleScroll) this.SetRole(tomo.R("objects", "ScrollContainer", sides.String())) - tomo.Apply(this) this.SetLayout(this.layout) return this } diff --git a/separator.go b/separator.go index b2a5143..6ad5b21 100644 --- a/separator.go +++ b/separator.go @@ -13,6 +13,5 @@ func NewSeparator () *Separator { Box: tomo.NewBox(), } this.SetRole(tomo.R("objects", "Separator", "")) - tomo.Apply(this) return this } diff --git a/slider.go b/slider.go index 1865f4f..0982de7 100644 --- a/slider.go +++ b/slider.go @@ -53,9 +53,7 @@ func newSlider (orient string, value float64) *Slider { this.OnScroll(this.handleScroll) this.handle.SetRole(tomo.R("objects", "SliderHandle", orient)) - tomo.Apply(this.handle) this.SetRole(tomo.R("objects", "Slider", orient)) - tomo.Apply(this) return this } diff --git a/textinput.go b/textinput.go index 6f4f620..65cffc3 100644 --- a/textinput.go +++ b/textinput.go @@ -20,7 +20,6 @@ type TextInput struct { func NewTextInput (text string) *TextInput { this := &TextInput { TextBox: tomo.NewTextBox() } this.SetRole(tomo.R("objects", "TextInput", "")) - tomo.Apply(this) this.SetAlign(tomo.AlignStart, tomo.AlignMiddle) this.SetText(text) this.SetFocusable(true) diff --git a/textview.go b/textview.go index fca4b92..de386c1 100644 --- a/textview.go +++ b/textview.go @@ -12,7 +12,6 @@ type TextView struct { func NewTextView (text string) *TextView { this := &TextView { TextBox: tomo.NewTextBox() } this.SetRole(tomo.R("objects", "TextView", "")) - tomo.Apply(this) this.SetFocusable(true) this.SetSelectable(true) this.SetText(text)