Skip to content

Commit

Permalink
docs(README): Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom5521 committed Jul 22, 2024
1 parent 628112b commit cb600e9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ func activate(app *gtk.Application) {
})

factory := gtk.NewSignalListItemFactory()
factory.ConnectSetup(func(listitem *gtk.ListItem) {
listitem.SetChild(gtk.NewLabel(""))
factory.ConnectSetup(func(listitem *glib.Object) {
listitem.Cast().(*gtk.ListItem).SetChild(gtk.NewLabel(""))
})
factory.ConnectBind(func(listitem *gtk.ListItem) {
obj := listitem.Item().Cast().(*gtk.StringObject)
listitem.Child().(*gtk.Label).SetText(obj.String())
obj := listitem.Cast().(*gtk.ListItem).Item().Cast().(*gtk.StringObject)
listitem.Cast().(*gtk.ListItem).Child().(*gtk.Label).SetText(obj.String())
})

list := gtk.NewListView(selectionModel, &factory.ListItemFactory)
Expand Down Expand Up @@ -100,10 +100,10 @@ func activate(app *gtk.Application) {
list := widgets.NewList[Person](
items,
widgets.SelectionSingle,
func(li *gtk.ListItem) {
func(li gtool.ListItem) {
li.SetChild(gtk.NewLabel(""))
},
func(li *gtk.ListItem, p Person) {
func(li gtool.ListItem, p Person) {
li.Child().(*gtk.Label).SetText(p.Name)
},
)
Expand Down

0 comments on commit cb600e9

Please sign in to comment.