NewHeading returns a Heading as expected
This commit is contained in:
parent
f99f60d642
commit
224ca25000
@ -12,10 +12,10 @@ type Heading struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewHeading creates a new section heading. The level can be from 0 to 2.
|
// NewHeading creates a new section heading. The level can be from 0 to 2.
|
||||||
func NewHeading (level int, text string) *Label {
|
func NewHeading (level int, text string) *Heading {
|
||||||
if level < 0 { level = 0 }
|
if level < 0 { level = 0 }
|
||||||
if level > 2 { level = 2 }
|
if level > 2 { level = 2 }
|
||||||
this := &Label { TextBox: tomo.NewTextBox() }
|
this := &Heading { TextBox: tomo.NewTextBox() }
|
||||||
theme.Apply(this, theme.R("objects", "Heading", fmt.Sprint(level)))
|
theme.Apply(this, theme.R("objects", "Heading", fmt.Sprint(level)))
|
||||||
this.SetText(text)
|
this.SetText(text)
|
||||||
return this
|
return this
|
||||||
|
Loading…
Reference in New Issue
Block a user