How to make a window fullscreen in a secondary display with tkinter?

Justino Rodrigues

I know how to make a window fullscreen in the "main" display, but even when moving my app's window to a secondary display connected to my PC, when I call:

self.master.attributes('-fullscreen', True)

to fullscreen that window, it does so in the "main" display and not in the secondary one (the app's window disappears from the secondary display and instantly appears in the "main" one, in fullscreen).

How can I make it fullscreen in the secondary display?

JeanClaudeDaudin

This works on Windows 7: If the second screen width and height are the same as the first one, you can use win1 or win2 geometry of the following code depending its relative position(leftof or rightof) to have a fullscreen in a secondary display:

from Tkinter import *

def create_win():
    def close(): win1.destroy();win2.destroy()
    win1 = Toplevel()
    win1.geometry('%dx%d%+d+%d'%(sw,sh,-sw,0))
    Button(win1,text="Exit1",command=close).pack()
    win2 = Toplevel()
    win2.geometry('%dx%d%+d+%d'%(sw,sh,sw,0))
    Button(win2,text="Exit2",command=close).pack()

root=Tk()
sw,sh = root.winfo_screenwidth(),root.winfo_screenheight()
print "screen1:",sw,sh
w,h = 800,600 
a,b = (sw-w)/2,(sh-h)/2 

Button(root,text="Exit",command=lambda r=root:r.destroy()).pack()
Button(root,text="Create win2",command=create_win).pack()

root.geometry('%sx%s+%s+%s'%(w,h,a,b))
root.mainloop()

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to check if window is on Fullscreen in Tkinter?

From Dev

How to make window fullscreen/maximized in Scene Builder?

From Dev

Tkinter window not filling screen in zoomed state on secondary display

From Dev

How to make UITableViewCell display fullscreen (allow paging)?

From Dev

How to make UITableViewCell display fullscreen (allow paging)?

From Dev

display window on secondary monitor

From Dev

display window on secondary monitor

From Dev

How to make a Tkinter window not resizable?

From Dev

How to display window form fullscreen on second monitor in Qt?

From Dev

C#: How to make window go really fullscreen

From Dev

How do you make a basic fullscreen window in Python?

From Dev

How to center fullscreen window

From Dev

How to get a tkinter window to display in Linux

From Dev

How to focus on a secondary window?

From Dev

Cant exit fullscreen on tkinter window python

From Dev

How to make ViewPager fullscreen?

From Dev

How to make fullscreen in simulator

From Dev

How to display a value from children window to parent window in python tkinter?

From Dev

How to make a program that does not display the console window?

From Dev

How to make YouTube fullscreen actually fullscreen?

From Dev

How to maximize a UWP window (not fullscreen)

From Dev

How to open a window in fullscreen with batch

From Dev

how do i display search results in Python Tkinter window

From Dev

How to display two images on the same Tkinter Toplevel () window

From Dev

How to make my app fullscreen?

From Dev

How to make a batch file fullscreen?

From Dev

How to make a FullScreen Activity on Android

From Dev

How do I make a select statement display as a list when the website is fullscreen?

From Dev

How to make tkinter Window floating in i3 windowmanager

Related Related

  1. 1

    How to check if window is on Fullscreen in Tkinter?

  2. 2

    How to make window fullscreen/maximized in Scene Builder?

  3. 3

    Tkinter window not filling screen in zoomed state on secondary display

  4. 4

    How to make UITableViewCell display fullscreen (allow paging)?

  5. 5

    How to make UITableViewCell display fullscreen (allow paging)?

  6. 6

    display window on secondary monitor

  7. 7

    display window on secondary monitor

  8. 8

    How to make a Tkinter window not resizable?

  9. 9

    How to display window form fullscreen on second monitor in Qt?

  10. 10

    C#: How to make window go really fullscreen

  11. 11

    How do you make a basic fullscreen window in Python?

  12. 12

    How to center fullscreen window

  13. 13

    How to get a tkinter window to display in Linux

  14. 14

    How to focus on a secondary window?

  15. 15

    Cant exit fullscreen on tkinter window python

  16. 16

    How to make ViewPager fullscreen?

  17. 17

    How to make fullscreen in simulator

  18. 18

    How to display a value from children window to parent window in python tkinter?

  19. 19

    How to make a program that does not display the console window?

  20. 20

    How to make YouTube fullscreen actually fullscreen?

  21. 21

    How to maximize a UWP window (not fullscreen)

  22. 22

    How to open a window in fullscreen with batch

  23. 23

    how do i display search results in Python Tkinter window

  24. 24

    How to display two images on the same Tkinter Toplevel () window

  25. 25

    How to make my app fullscreen?

  26. 26

    How to make a batch file fullscreen?

  27. 27

    How to make a FullScreen Activity on Android

  28. 28

    How do I make a select statement display as a list when the website is fullscreen?

  29. 29

    How to make tkinter Window floating in i3 windowmanager

HotTag

Archive