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

Getting error: 'NoneType' object has no attribute 'frame' #1584

Open
lior-ps opened this issue Jan 22, 2025 · 4 comments
Open

Getting error: 'NoneType' object has no attribute 'frame' #1584

lior-ps opened this issue Jan 22, 2025 · 4 comments

Comments

@lior-ps
Copy link

lior-ps commented Jan 22, 2025

The following code on Mac gets the error in the title:

import webview

def gui_loop_started():
import AppKit
AppKit.NSApp.setActivationPolicy_(1)

self._window = webview.create_window(
"",
draggable=True,
frameless=True,
hidden=True,
js_api=self,
on_top=True,
resizable=False,
transparent=sys.platform != "win32"
)

webview.start(func=gui_loop_started)

@r0x0r
Copy link
Owner

r0x0r commented Jan 22, 2025

Your code does not make sense. You have to create a window first

@lior-ps
Copy link
Author

lior-ps commented Jan 22, 2025

fixed the code example

@r0x0r
Copy link
Owner

r0x0r commented Jan 22, 2025

Your code is not runnable nor standalone, so I still do not know what you are trying to achieve. But the code below runs fine on my machine

import webview

def gui_loop_started():
  import AppKit
  AppKit.NSApp.setActivationPolicy_(1)

_window = webview.create_window(
  "",
  html="<h1>Hello, World!</h1>",
  draggable=True,
  frameless=True,
  on_top=True,
  resizable=False,
)

webview.start(gui_loop_started)

@lior-ps
Copy link
Author

lior-ps commented Jan 22, 2025

it works for me as well
it happened only when loading it from a LaunchDaemon in mac right after reboot

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

No branches or pull requests

2 participants