-
Hi all, I'm using Tauri (beta version) to build a project. I'm wondering how to create a window from Rust backend and manipulate the window afterward. I have seen methods like Thanks for reply. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
you have to get an app handle or window handle which you can obtain in any hook on the tauri builder. note: code below doesn't have any arguments just for simplicity, check the urls to see the arguments needed. tauri::Builder::default()
.setup(|app|{
let window = app.create_window(); // https://tauri.studio/en/docs/api/rust/tauri/window/struct.Window#create_window
})
.on_page_load(|window, _| {
let window = window.create_window();
})
.run(); or from js you can just use the import { WebviewWindow } from "@tauri-apps/api/window";
// or `withGlobalTauri: true` in tauri.conf.json
const { WebviewWindow } = window.__TAURI__.window;
new WebviewWindow() // https://tauri.studio/en/docs/api/js/classes/window.webviewwindow/ |
Beta Was this translation helpful? Give feedback.
-
Is there a way to toggle a window's transparency? I know |
Beta Was this translation helpful? Give feedback.
you have to get an app handle or window handle which you can obtain in any hook on the tauri builder.
note: code below doesn't have any arguments just for simplicity, check the urls to see the arguments needed.
or from js you can just use the
WebviewWindow
constructor