This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author les.bothwell
Recipients les.bothwell, serhiy.storchaka, steve.dower, zach.ware
Date 2014-06-05.07:29:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401953344.56.0.278386188171.issue21665@psf.upfronthosting.co.za>
In-reply-to
Content
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()
History
Date User Action Args
2014-06-05 07:29:04les.bothwellsetrecipients: + les.bothwell, zach.ware, serhiy.storchaka, steve.dower
2014-06-05 07:29:04les.bothwellsetmessageid: <1401953344.56.0.278386188171.issue21665@psf.upfronthosting.co.za>
2014-06-05 07:29:04les.bothwelllinkissue21665 messages
2014-06-05 07:29:03les.bothwellcreate