Les Bothwell added the comment:
The code below shows a "windows themed" button with 2.7.6 but a plain "tkinter"
button with 2.7.7. Functionality is Ok both cases.
from win32api import GetMonitorInfo, MonitorFromWindow
from win32con import MONITOR_DEFAULTTONEAREST
from Tkinter import *
import ttk
root = Tk()
root.title("Get Desktop Size") # set title
root.resizable(0, 0) # disable resizing (also changes border)
root.attributes("-toolwindow", 1) # remove max and min buttons
hwnd = int(eval(root.wm_frame())) # get the root window handle
txDesk = StringVar()
def OnClick(*args):
hMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST)
Info = GetMonitorInfo(hMonitor)["Work"]
txDesk.set("%d x %d" % (Info[2] - Info[0], Info[3] - Info[1]))
But1 = ttk.Button(root, text="Click me on each monitor", command=OnClick)
Lbl1 = ttk.Label(root, textvariable=txDesk, anchor="center")
txDesk.set('')
But1.pack(side=TOP)
Lbl1.pack(side=TOP)
root.mainloop()
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21665>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com