Message219781
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() |
|
Date |
User |
Action |
Args |
2014-06-05 07:29:04 | les.bothwell | set | recipients:
+ les.bothwell, zach.ware, serhiy.storchaka, steve.dower |
2014-06-05 07:29:04 | les.bothwell | set | messageid: <1401953344.56.0.278386188171.issue21665@psf.upfronthosting.co.za> |
2014-06-05 07:29:04 | les.bothwell | link | issue21665 messages |
2014-06-05 07:29:03 | les.bothwell | create | |
|