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

Improved window parameter handling #3457

Open
wants to merge 1 commit into
base: v3-alpha
Choose a base branch
from

Conversation

leaanthony
Copy link
Member

Original PR: #3424

Description

** This PR has been opened up to start a discussion on what the right solution is **

There will be times when you want to know what window made a call to a bound method. This PR offers 2 solutions for 2 different scenarios:

  1. When a bound method uses a standard context.Context in the first parameter, the context will have a value "window" which will return the calling window.
  2. For scenarios where you want to call these methods from Go, you can simply use an application.Window as the first parameter. It will always be populated with the calling window if called from JS.

The binding example has been updated to show both usages.

Copy link

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5f89fde
Status: ✅  Deploy successful!
Preview URL: https://fa50aa13.wails.pages.dev
Branch Preview URL: https://v3-alpha-feature-new-window.wails.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant