Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update no-frame-window.py to resolve deprecation warnings #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions python/controls/window-drag-area/no-frame-window.py
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

page.window.title_bar_hidden = True
page.window.title_bar_buttons_hidden = True

page.add(
Row(
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You dont need to add comments saying this 😅

IconButton(icons.CLOSE, on_click=lambda _: page.window.close()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IconButton(icons.CLOSE, on_click=lambda _: page.window.close()),
IconButton(icons.CLOSE, on_click=lambda e: page.window.close()),

Let's have e there just for good practice.

]
)
)


flet.app(target=main)