From 77d416792260c3ca264749b699cfc14f94b6de5e Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Mon, 9 Dec 2024 02:21:07 +0200 Subject: [PATCH] fix py --- examples/main.py | 4 ++-- tauripy/pyproject.toml | 2 +- tauripy/src/tauripy/__init__.py | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/main.py b/examples/main.py index bd90bcb..c16f34a 100644 --- a/examples/main.py +++ b/examples/main.py @@ -8,8 +8,8 @@ def command_callback(message: bytes) -> None: print(f"Command: {message.decode('utf-8')}") -def on_ready(tauric: Tauric) -> None: - tauric.create_window("example_window", "local://index.html") +def on_ready(tauric: 'Tauri') -> None: + tauric.create_window("example_window", "tauric", "local://index.html") def main() -> None: tauric = Tauri("com.tauric.dev", "tauric") diff --git a/tauripy/pyproject.toml b/tauripy/pyproject.toml index 635f740..9894440 100644 --- a/tauripy/pyproject.toml +++ b/tauripy/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "tauripy" -version = "0.1.0-beta.3" +version = "0.1.0-beta.4" description = "Create tauri desktop app in Python" readme = "README.md" authors = [ diff --git a/tauripy/src/tauripy/__init__.py b/tauripy/src/tauripy/__init__.py index e6b2c26..726dad7 100644 --- a/tauripy/src/tauripy/__init__.py +++ b/tauripy/src/tauripy/__init__.py @@ -35,7 +35,8 @@ def __init__(self, identifier: str, product_name: str, icon: str = None) -> None def setup_functions(self) -> None: self.tauric.run.restype = ctypes.c_int - self.tauric.create_window.argtypes = [ctypes.c_char_p, ctypes.c_char_p] + self.tauric.run.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p] + self.tauric.create_window.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p] self.tauric.create_window.restype = None self.tauric.close.restype = None self.tauric.on_ready.restype = None @@ -62,11 +63,12 @@ def mount_frontend(self, path) -> None: path = path.encode('utf-8') self.tauric.mount_frontend(path) - def create_window(self, label: str, url: str) -> None: + def create_window(self, label: str, title: str, url: str) -> None: label_encoded = label.encode('utf-8') url_encoded = url.encode('utf-8') + title = title.encode('utf-8') print('Creating window...') - self.tauric.create_window(label_encoded, url_encoded) + self.tauric.create_window(label_encoded, title, url_encoded) print("Created an example window") def close(self) -> None: