Searcher size

This commit is contained in:
2025-08-14 14:47:55 -05:00
parent acfe8be93d
commit 061bf1b37d
2 changed files with 24 additions and 3 deletions

View File

@@ -58,14 +58,26 @@ func (s *UiScreen) Init(ui *Ui) {
dat = append(dat, RandomString(15))
}
searcher.SetData(dat)
searcher.SetSelectFunc(func(idx int, v string) bool {
s.log.Log("Searcher Value Selected: %s", v)
return true
})
searcher.SetH(10)
hl.Add(searcher)
db := w.NewButton("test-bd-1", ui.style)
db.SetLabel("Button 1")
db.SetOnPressed(
db.SetOnPressed(func() bool {
s.log.Log("Button 1 Pressed")
return true
})
hl.Add(db)
db = w.NewButton("test-bd-2", ui.style)
db.SetLabel("Button 2")
db.SetOnPressed(func() bool {
s.log.Log("Button 2 Pressed")
return true
})
hl.Add(db)
s.ll.Add(hl)
@@ -76,11 +88,19 @@ func (s *UiScreen) Init(ui *Ui) {
btnCancel := w.NewButton("btn-cancel", ui.style)
btnCancel.SetLabel("Cancel")
btnCancel.SetOnPressed(func() bool {
s.log.Log("Cancel Pressed")
return true
})
btnL.Add(btnCancel)
btnL.AddFlag(btnCancel, w.LFAlignVBottom)
btnOk := w.NewButton("btn-ok", ui.style)
btnOk.SetLabel("Ok")
btnOk.SetOnPressed(func() bool {
s.log.Log("Ok Pressed")
return true
})
btnL.Add(btnOk)
btnL.AddFlag(btnOk, w.LFAlignVBottom)
s.ll.Add(btnL)