h-1.flet.3/test_size_5.py
2026-02-20 23:24:01 +09:00

32 lines
1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
ウインドウサイズテスト - 手法5: 最もシンプル
"""
import flet as ft
def main(page: ft.Page):
# ウィンドウサイズ設定 - 手法5最もシンプル
page.title = "サイズテスト5"
page.window.width = 300
page.window.height = 500
# コンテンツ
page.add(
ft.Column([
ft.Text("手法5: page.windowプロパティシンプル", size=18, weight=ft.FontWeight.BOLD),
ft.Text("page.window.width = 300"),
ft.Text("page.window.height = 500"),
ft.Button("テストボタン", on_click=lambda _: print("クリックされました")),
ft.Container(
content=ft.Text("コンテナテスト", color=ft.Colors.WHITE),
bgcolor=ft.Colors.ORANGE,
padding=20,
width=200,
height=100
),
ft.Text("この手法が最も確実", size=14, color=ft.Colors.GREEN)
], spacing=10)
)
if __name__ == "__main__":
ft.run(main)