{"record":{"id":"1903127ecbfc8087","repo":"wailsapp/wails","slug":"implement-me-190312","errorCode":null,"errorMessage":"Implement me","messagePattern":"Implement me","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/pkg/application/menuitem_linux.go","lineNumber":338,"sourceCode":"\t\t\tcurrentWindow := globalApplication.Window.Current()\n\t\t\tif currentWindow != nil {\n\t\t\t\tcurrentWindow.Zoom()\n\t\t\t}\n\t\t})\n}\n\nfunc newFullScreenMenuItem() *MenuItem {\n\treturn NewMenuItem(\"Fullscreen\").\n\t\tOnClick(func(ctx *Context) {\n\t\t\tcurrentWindow := globalApplication.Window.Current()\n\t\t\tif currentWindow != nil {\n\t\t\t\tcurrentWindow.Fullscreen()\n\t\t\t}\n\t\t})\n}\n\nfunc newPrintMenuItem() *MenuItem {\n\tpanic(\"Implement me\")\n}\n\nfunc newPageLayoutMenuItem() *MenuItem {\n\tpanic(\"Implement me\")\n}\n\nfunc newShowAllMenuItem() *MenuItem {\n\tpanic(\"Implement me\")\n}\n\nfunc newBringAllToFrontMenuItem() *MenuItem {\n\tpanic(\"Implement me\")\n}\n\nfunc newNewFileMenuItem() *MenuItem {\n\tpanic(\"Implement me\")\n}\n","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/wailsapp/wails/blob/0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3/v3/pkg/application/menuitem_linux.go#L320-L356","documentation":"newPrintMenuItem (v3/pkg/application/menuitem_linux.go:338) is an unimplemented Linux stub for the Print role helper; its body is only panic(\"Implement me\"). Linux has no shared native print action for webview apps in the Wails GTK4 port, so the platform helper was left as a stub. The exported NewPrintMenuItem() (menuitem_roles.go:281) returns a normal item with a Ctrl+P accelerator and does not panic, so only code that calls this unexported helper crashes.","triggerScenarios":"Internal/contributor code invoking newPrintMenuItem() when assembling a default File menu on Linux; a fork that routes NewRole(Print) to the lowercase Linux helper; porting from menuitem_darwin.go where a real selector-based print action exists.","commonSituations":"Building a cross-platform File menu with a Print entry and testing custom role wiring on Linux; Wails GTK4 port development; copy-pasting dispatcher patterns from other platforms into menuitem_linux.go.","solutions":["Use the exported NewPrintMenuItem() or NewRole(Print) — they produce a plain menu item and never hit the stub.","If implementing for the platform, return NewMenuItem(\"Print\").SetAccelerator(\"CmdOrCtrl+p\") with an OnClick that triggers window.print() via the webview.","Leave role dispatch to NewRole's switch (menuitem.go:192) which only uses the safe exported constructors.","Check upstream Wails issues for the Linux menu-role completion epic before adding wiring yourself."],"exampleFix":"// before\nfunc newPrintMenuItem() *MenuItem {\n\tpanic(\"Implement me\")\n}\n\n// after\nfunc newPrintMenuItem() *MenuItem {\n\treturn NewMenuItem(\"Print\").\n\t\tSetAccelerator(\"CmdOrCtrl+p\").\n\t\tOnClick(func(ctx *Context) {\n\t\t\tif w := globalApplication.Window.Current(); w != nil {\n\t\t\t\t_ = w.ExecJS(\"window.print()\")\n\t\t\t}\n\t\t})\n}","handlingStrategy":"validation","validationCode":"// Use the public API which is implemented on all platforms:\nmenu.AddRole(app.Print)          // generic item with Ctrl+P\nitem := app.NewPrintMenuItem()   // same, explicit form","typeGuard":null,"tryCatchPattern":"defer func() {\n\tif r := recover(); r != nil {\n\t\tlog.Printf(\"print menu item unavailable on this platform: %v\", r)\n\t}\n}()\nmenu.AddRole(app.Print)","preventionTips":["Use NewRole(Print) or NewPrintMenuItem() instead of platform helpers.","Attach your own OnClick (e.g. window.print()) for actual printing behavior.","Smoke-test File menus on Linux in CI.","Keep Wails current; role support gaps close over time."],"tags":["linux","gtk4","menus","not-implemented","panic","printing"],"backgroundTag":null,"analyzedSha":"0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3","analyzedAt":"2026-08-15T14:17:36.034Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}