From 7f6e34725a971e3051fd87eb161a54eae0a166f5 Mon Sep 17 00:00:00 2001 From: non-npc <101848445+non-npc@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:49:15 -0400 Subject: [PATCH] Update no-frame-window.py to resolve deprecation warnings resolved the following deprecation warnings: window_title_bar_hidden() window_title_bar_buttons_hidden() window_close() --- python/controls/window-drag-area/no-frame-window.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/python/controls/window-drag-area/no-frame-window.py b/python/controls/window-drag-area/no-frame-window.py index c2b34323..7ce6df2f 100644 --- a/python/controls/window-drag-area/no-frame-window.py +++ b/python/controls/window-drag-area/no-frame-window.py @@ -1,10 +1,10 @@ import flet from flet import Container, IconButton, Page, Row, Text, WindowDragArea, colors, icons - def main(page: Page): - page.window_title_bar_hidden = True - page.window_title_bar_buttons_hidden = True + # Use the updated properties for window title bar settings + page.window.title_bar_hidden = True + page.window.title_bar_buttons_hidden = True page.add( Row( @@ -19,10 +19,11 @@ def main(page: Page): ), expand=True, ), - IconButton(icons.CLOSE, on_click=lambda _: page.window_close()), + # Use the updated method to close the window + IconButton(icons.CLOSE, on_click=lambda _: page.window.close()), ] ) ) - flet.app(target=main) +