Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call dialog in the right-click menu #1176

Closed
Dynamith opened this issue Jul 9, 2020 · 4 comments
Closed

Cannot call dialog in the right-click menu #1176

Dynamith opened this issue Jul 9, 2020 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@Dynamith
Copy link

Dynamith commented Jul 9, 2020

Describe the bug:

The functions in TappedSecondary and TappedSecondary in the following code are the same, but TappedSecondary does not display dialog after running, and there is no feedback in cmd.

Example code:

package main

import (
	"errors"

	"fyne.io/fyne"
	"fyne.io/fyne/app"
	"fyne.io/fyne/dialog"
	"fyne.io/fyne/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("Bug0")
	w.Resize(fyne.NewSize(1280, 600))

	w.SetContent(newItem("dialog"))
	w.ShowAndRun()
}

type Item struct {
	widget.Button
}

func newItem(name string) *Item {
	item := &Item{}
	item.ExtendBaseWidget(item)
	item.SetText(name)
	return item
}

func (t *Item) Tapped(_ *fyne.PointEvent) {
	dialog.ShowError(errors.New("test"), fyne.CurrentApp().Driver().AllWindows()[0])
}

func (t *Item) TappedSecondary(pe *fyne.PointEvent) {
	menu := fyne.NewMenu("Right Menu",
		fyne.NewMenuItem("Show", func() {
			dialog.ShowError(errors.New("test"), fyne.CurrentApp().Driver().AllWindows()[0])
		}))
	entryPos := fyne.CurrentApp().Driver().AbsolutePositionForObject(t)
	popUpPos := entryPos.Add(pe.Position)
	c := fyne.CurrentApp().Driver().CanvasForObject(t)
	widget.ShowPopUpMenuAtPosition(menu, c, popUpPos)
}

Device (please complete the following information):

  • OS: [windows10 x64]
  • Version: [1090]
  • Go version: [1.14.4]
  • Fyne version: [1.3.0]
@Dynamith
Copy link
Author

@andydotxyz
Why is there no response? Can it be fixed?
I really need this feature.

@andydotxyz andydotxyz added this to the 1.3.x milestone Jul 11, 2020
@andydotxyz andydotxyz added the bug Something isn't working label Jul 11, 2020
@andydotxyz
Copy link
Member

I’m sure it can be fixed :)

@Dynamith
Copy link
Author

OK, I am looking forward.

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jul 16, 2020
@andydotxyz
Copy link
Member

Available on develop for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants