In Flet on Windows, I'm running the calc demo and trying to modify properties of the application window in Python.
How do I change the size of the Flet window in code and specify that it should not be user resizable?
(Ideally this post should be tagged with 'Flet' but the tag doesn't exist yet as the project's in it's infancy and I don't have the 1500 points required to created it.)
You can use this as an example
import flet as ft
def main(page: ft.Page):
page.window.width = 200 # window's width is 200 px
page.window.height = 200 # window's height is 200 px
page.window.resizable = False # window is not resizable
page.update()
ft.app(target=main)
To set the window's size and resizable:
def main(page: Page):
page.window_width = 200 # window's width is 200 px
page.window_height = 200 # window's height is 200 px
page.window_resizable = False # window is not resizable
The flet docs is very nice and easy to read. Please read the Page docs to learn more about "page".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With