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 make my app fullscreen?

From Dev

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

From Dev

How to make a batch file fullscreen?

From Dev

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

From Dev

how do i display search results in Python Tkinter window

From Dev

How to make UITableViewCell display fullscreen (allow paging)?

From Dev

How to make ViewPager fullscreen?

From Dev

How to open a window in fullscreen with batch

From Dev

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

From Dev

How to make window fullscreen/maximized in Scene Builder?

From Dev

How to maximize a UWP window (not fullscreen)

From Dev

How to make a FullScreen Activity on Android

From Dev

How to make tkinter Window floating in i3 windowmanager

From Dev

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

From Dev

How to make a Tkinter window not resizable?

From Dev

display window on secondary monitor

From Dev

How to make YouTube fullscreen actually fullscreen?

From Dev

How to get a tkinter window to display in Linux

From Dev

How to make UITableViewCell display fullscreen (allow paging)?

From Dev

How to center fullscreen window

From Dev

How to make fullscreen in simulator

From Dev

display window on secondary monitor

From Dev

How to check if window is on Fullscreen in Tkinter?

From Dev

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

From Dev

Tkinter window not filling screen in zoomed state on secondary display

From Dev

How to focus on a secondary window?

From Dev

C#: How to make window go really fullscreen

From Dev

Cant exit fullscreen on tkinter window python

From Dev

How do you make a basic fullscreen window in Python?

Related Related

  1. 1

    How to make my app fullscreen?

  2. 2

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

  3. 3

    How to make a batch file fullscreen?

  4. 4

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

  5. 5

    how do i display search results in Python Tkinter window

  6. 6

    How to make UITableViewCell display fullscreen (allow paging)?

  7. 7

    How to make ViewPager fullscreen?

  8. 8

    How to open a window in fullscreen with batch

  9. 9

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

  10. 10

    How to make window fullscreen/maximized in Scene Builder?

  11. 11

    How to maximize a UWP window (not fullscreen)

  12. 12

    How to make a FullScreen Activity on Android

  13. 13

    How to make tkinter Window floating in i3 windowmanager

  14. 14

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

  15. 15

    How to make a Tkinter window not resizable?

  16. 16

    display window on secondary monitor

  17. 17

    How to make YouTube fullscreen actually fullscreen?

  18. 18

    How to get a tkinter window to display in Linux

  19. 19

    How to make UITableViewCell display fullscreen (allow paging)?

  20. 20

    How to center fullscreen window

  21. 21

    How to make fullscreen in simulator

  22. 22

    display window on secondary monitor

  23. 23

    How to check if window is on Fullscreen in Tkinter?

  24. 24

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

  25. 25

    Tkinter window not filling screen in zoomed state on secondary display

  26. 26

    How to focus on a secondary window?

  27. 27

    C#: How to make window go really fullscreen

  28. 28

    Cant exit fullscreen on tkinter window python

  29. 29

    How do you make a basic fullscreen window in Python?

HotTag

Archive