Skip to content

Commit

Permalink
fix py
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Dec 9, 2024
1 parent 5341f16 commit 77d4167
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tauripy/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
8 changes: 5 additions & 3 deletions tauripy/src/tauripy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 77d4167

Please sign in to comment.