wails/v3/examples/print
Lea Anthony 2c9d23b040
fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4789)
fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4290)

The print dialog was not opening on macOS because the CGO windowPrint function was passing the wrong pointer type to NSPrintOperation's runOperationModalForWindow method. It was passing the raw void* window instead of the properly cast WebviewWindow* nsWindow.

This also adds a Window.Print() method to the JavaScript runtime, allowing frontend code to trigger the print dialog directly without needing a Go binding.

Changes:
- Fix webview_window_darwin.go to use nsWindow instead of window
- Add WindowPrint constant (51) and handler to messageprocessor_window.go
- Add Print() method to window.ts in the runtime
- Rebuild bundled runtime (runtime.js and runtime.debug.js)
- Add print example in v3/examples/print to demonstrate both Go API and JS runtime methods
- Update API documentation for Window.Print() in both Go and JavaScript references

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-14 15:04:54 +11:00
..
assets fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4789) 2025-12-14 15:04:54 +11:00
.gitignore fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4789) 2025-12-14 15:04:54 +11:00
go.mod fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4789) 2025-12-14 15:04:54 +11:00
go.sum fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4789) 2025-12-14 15:04:54 +11:00
main.go fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4789) 2025-12-14 15:04:54 +11:00