Skip to content

Commit

Permalink
Remove this code, it belongs in a docs tutorial I think
Browse files Browse the repository at this point in the history
Or a simpler version will be added to a menu demo
  • Loading branch information
andydotxyz committed Dec 17, 2024
1 parent 15465ee commit d0d9198
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions cmd/fyne_demo/tutorials/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,6 @@ func makeActivityTab(win fyne.Window) fyne.CanvasObject {
}))))
}

// TODO find a new home for this example
//shareItem := fyne.NewMenuItem("Share via", nil)
//shareItem.ChildMenu = fyne.NewMenu("",
// fyne.NewMenuItem("Twitter", func() { fmt.Println("context menu Share->Twitter") }),
// fyne.NewMenuItem("Reddit", func() { fmt.Println("context menu Share->Reddit") }),
//)
//menuLabel := newContextMenuButton("tap me for pop-up menu with submenus", fyne.NewMenu("",
// fyne.NewMenuItem("Copy", func() { fmt.Println("context menu copy") }),
// shareItem,
//))
//

func makeCardTab(_ fyne.Window) fyne.CanvasObject {
card1 := widget.NewCard("Book a table", "Which time suits?",
widget.NewRadioGroup([]string{"6:30pm", "7:00pm", "7:45pm"}, func(string) {}))
Expand Down Expand Up @@ -482,23 +470,6 @@ func widgetScreen(_ fyne.Window) fyne.CanvasObject {
return container.NewCenter(content)
}

type contextMenuButton struct {
widget.Button
menu *fyne.Menu
}

func (b *contextMenuButton) Tapped(e *fyne.PointEvent) {
widget.ShowPopUpMenuAtPosition(b.menu, fyne.CurrentApp().Driver().CanvasForObject(b), e.AbsolutePosition)
}

func newContextMenuButton(label string, menu *fyne.Menu) *contextMenuButton {
b := &contextMenuButton{menu: menu}
b.Text = label

b.ExtendBaseWidget(b)
return b
}

type numEntry struct {
widget.Entry
}
Expand Down

0 comments on commit d0d9198

Please sign in to comment.