can someone please help me how to solve this problem so that I don't get this error #4406
AriBermeki
started this conversation in
General
Replies: 2 comments 1 reply
-
Old versionfrom pycore import PyNexium
from pathlib import Path
path = Path(__file__).parent / "out"
icon_path = Path(__file__).parent / "logo.png"
app = PyNexium()
app.with_theme(theme="light")
app.with_title(title="Nextjs Application with Python")
app.with_custom_protocol(index_page="index.html", path=str(path))
app.with_window_icon(icon=str(icon_path))
app.with_set_cursor_icon(cursor_type="Crosshair")
app.with_evaluate_script(eval_code="console.log('Hallo')")
def page(url:str):
import json
if url.startswith("#PYWRY_RESULT"):
d = url.split(':')
data = json.load(d[1])
print(data)
app.with_ipc_handler(ipc_handler=page)
def on_startup_event():
print("application startup")
def on_shutdown_event():
print("application shutdown")
if __name__ == "__main__":
app.run(json_data="",on_startup_event=on_startup_event,on_shutdown_event=on_shutdown_event)
|
Beta Was this translation helpful? Give feedback.
0 replies
-
The solution is to take arguments by-reference instead of by-value: #[pyo3(signature = (window_attribute, webview_attribute, _web_context=None))]
pub fn new(
window_attribute: &WindowFrame, // <-- added & here
webview_attribute: &WebViewFrame, // <-- and here
_web_context: Option<bool>,
) -> PyFrame { ... this is probably a case where we can now emit improved diagnostics, cc @mejrs |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My Planning
I have developed an implementation in Rust that allows Python developers to create webview-based desktop applications, including system tray integration. When I am told that libraries like eel or pywebview already exist, I would like to point out that these libraries use an additional micro web server (bottle) and may not have all the required methods and do not provide access to the system tray. My solution does not need an additional server as it communicates directly with the operating system's webview engine and has over 150 methods. I have not listed this multitude of methods further to keep the code clear.
Currently I am encountering a problem related to Rust and PyO3 where the Rust analyzer is showing an error.
I do not know how to solve this problem using pyo3.
Beta Was this translation helpful? Give feedback.
All reactions