pythonのtkinterでフルスクリーンウィンドウをPCのサブモニターに表示させたい。

実現したいこと

pythonのtkinterでデスクトップアプリを作成しています。
アプリからボタンを押すとフルスクリーンウィンドウが起動する機能を作成しました。
そして立ち上がったフルスクリーンウィンドウをPCのサブモニターに表示させたいです。

発生している問題・分からないこと

フルスクリーンウィンドウをPCのサブモニターに表示させたいのですが、メインモニターに表示されてしまいます。

該当のソースコード

#coding:utf-8 import tkinter as tk from screeninfo import get_monitors # フルスクリーンを表示 def fullscreen(event): full = tk.Toplevel() #full.state("zoomed") # タイトルバーあり #full.geometry("1920x1080+3840+0") # 効果なし full.attributes('-fullscreen', True) full.bind("<Escape>", lambda event: full.destroy()) # Escapeキーでフルスクリーンを終了 # モニター情報を取得(取得できたが使用用途がわからず) monitors = [] display = 1 for m in get_monitors(): monitors.append(m) print(monitors) root = tk.Tk() # ウインドウサイズの固定 root.geometry(f"{300}x{150}+0+0") root.resizable(width = False, height = False) # タイトル root.title("FULLSCCREEN") # フレーム fr_btn = tk.Frame(root) # フルスクリーン -- ボタン fs_btn = tk.Button(fr_btn, width=30, height=3,text="FULLSCCREEN") fs_btn.pack(pady=10) fs_btn.bind("<ButtonRelease>", lambda event: fullscreen(event)) fr_btn.pack(padx=50, pady=30) root.mainloop()

試したこと・調べたこと

上記の詳細・結果

screeninfo でモニター情報を取得する事も出来たのですが、取得した情報をどこにどのように設定すればよいのかわかりません。
解決方法などございましたら、ご教授いただけると幸いです。

補足

特になし

コメントを投稿

0 コメント