pythonflutterwindowresizewindow-resize

How do I change the size of the Flet window on Windows or specify that it is not resizable?


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.)


Solution

  • 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)