Skip to content

Commit

Permalink
ui: Implement unmounting for ListBox. #22
Browse files Browse the repository at this point in the history
  • Loading branch information
roblillack committed Jun 28, 2024
1 parent 90f2a07 commit 6f7e570
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ui/listbox_cocoa.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,12 @@ func (c *ListBox) Mount(parent spot.Control) any {

return c.ref
}

func (c *ListBox) Unmount() {
if c.ref == nil {
return
}

c.ref.Remove()
c.ref = nil
}
7 changes: 7 additions & 0 deletions ui/listbox_fltk.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,10 @@ func (c *ListBox) Mount(parent spot.Control) any {

return c.ref
}

func (c *ListBox) Unmount() {
if c.ref != nil {
c.ref.Destroy()
c.ref = nil
}
}

0 comments on commit 6f7e570

Please sign in to comment.