msg219775 - (view) |
Author: Les Bothwell (les.bothwell) |
Date: 2014-06-04 23:18 |
I developed a number of small apps using ttk in 2.7.6. After installing 2.7.7 all the ttk widgets look like standard Tkinter ones. I reverted to 2.7.6 and everything looks Ok again. (I tried reinstalling 2.7.7 again with the same result)
Windows 7 X64 using 32 bit python.
|
msg219779 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2014-06-05 04:49 |
Could you please provide minimal example?
|
msg219781 - (view) |
Author: Les Bothwell (les.bothwell) |
Date: 2014-06-05 07:29 |
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()
|
msg219783 - (view) |
Author: Les Bothwell (les.bothwell) |
Date: 2014-06-05 07:57 |
Here's an even simpler example (from book: Modern Tkinter for busy python programmers).
from Tkinter import *
import ttk
root = Tk()
ttk.Button(root, text="Hello World!").grid()
root.mainloop()
I have screenshots of both progs for 2.7.6 and 2.7.7 if interested.
|
msg219785 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2014-06-05 08:17 |
Thanks. It looks themed on Linux. Looks as this is Windows specific issue.
|
msg219819 - (view) |
Author: Zachary Ware (zach.ware) * |
Date: 2014-06-05 15:25 |
I can confirm this on the current 2.7 branch and, oddly, on a fresh build of v2.7.6. This looks like it was caused by the way Tcl/Tk was compiled, specifically the 'COMPILERFLAGS=-DWINVER=0x0500' and 'OPTS=noxp' options which are supposed to be for Win2k support. Removing just 'OPTS=noxp' causes a compilation failure (due to WINVER redefinition), but removing both makes ttk work properly.
Steve: how did you compile Tcl/Tk for the 2.7.7 installer?
Martin: how have you compiled Tcl/Tk for past installers? In particular, Python 3.2's ttk works perfectly Win2k, but is properly themed on Windows 7, which leads me to believe that you did not use the 'Win2k compatibility' options.
|
msg219826 - (view) |
Author: Roundup Robot (python-dev) |
Date: 2014-06-05 17:02 |
New changeset baac4ea2901b by Zachary Ware in branch '3.4':
Clean up Tcl/Tk building in the Windows buildbot scripts.
http://hg.python.org/cpython/rev/baac4ea2901b
New changeset b3063de0dbd9 by Zachary Ware in branch 'default':
Issue #21665: Don't use 'OPTS=noxp' when compiling Tk.
http://hg.python.org/cpython/rev/b3063de0dbd9
|
msg219856 - (view) |
Author: Steve Dower (steve.dower) * |
Date: 2014-06-05 23:29 |
I compiled with COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=0 for tcl and tix, and with just COMPILERFLAGS=-DWINVER=0x0500 DEBUG=0 for tk. These should have matched the buildbot scripts, and I'm fairly sure they haven't changed since 2.7.6, which means the newer tk/tcl versions probably need different options.
|
msg219859 - (view) |
Author: Zachary Ware (zach.ware) * |
Date: 2014-06-06 01:58 |
Are you sure you didn't swap that; OPTS=noxp for Tk and no OPTS for the other two? OPTS=noxp would do nothing for Tcl and Tix (and might cause errors, I'm not sure), and not giving OPTS=noxp along with WINVER=0x0500 would definitely have caused an error building Tk, cutting compilation short before most of ttk could be compiled (if I remember my test from this morning correctly).
(For the record, my testing this morning included completely fresh builds of the tip of 2.7 with Tcl/Tk 8.5.15, tip of 2.7 with Tcl/Tk 8.5.2, v2.7.6 (which had Tcl/Tk 8.5.2), and default with Tcl/Tk 8.6.1, all built using the buildbot scripts, and all showed Les's issue. I removed the noxp option in each case, and ttk worked correctly in each. To me, that says that our buildbot scripts have been wrong for a long time, but fortunately Martin has been using better options when he has built installers in the past, though I'd still like confirmation on that before I make any changes to 2.7's buildbot scripts. Since there's no concern about keeping Win2k compatibility on 3.4 and default, I went ahead and fixed those this morning.)
|
msg219910 - (view) |
Author: Steve Dower (steve.dower) * |
Date: 2014-06-07 03:35 |
You're right, I had OPTS for tk and tix. I think I'm going to modify my build scripts to use the buildbot scripts wherever possible. I also need to parameterise msi.py a bit so I don't have to modify it for releases.
|
msg219913 - (view) |
Author: Steve Dower (steve.dower) * |
Date: 2014-06-07 04:48 |
The buildbot scripts don't build tix and the build_tkinter.py script has a blatant error which prevents it from ever working (and old version numbers). I have no experience with the buildbots, but I don't see how they can possibly be producing correct builds of tk and friends.
Am I missing something?
|
msg219915 - (view) |
Author: Zachary Ware (zach.ware) * |
Date: 2014-06-07 05:01 |
Tix was finally added to the pcbuild solution for 3.5 a couple months
ago, until that point it was never built on the buildbots. If my
understanding of history is correct, build_tkinter.py has never been
used regularly, but was an initial push towards building Tcl/Tk/Tix
the same way OpenSSL is built in <3.4. See #15968 and #21141 if you
want more information on the situation in 3.5. The buildbot scripts
for 2.7 and 3.4 do build usable, debug versions of Tcl and Tk, though.
The lack of Tix is hard to notice since there are absolutely no tests
for it yet.
I'm wary of backporting the Tcl/Tk/Tix building changes, especially to
2.7, but it should be possible to tack Tix onto the current buildbot
scripts. I'll open an issue for that.
|
msg219917 - (view) |
Author: Steve Dower (steve.dower) * |
Date: 2014-06-07 05:16 |
That's fine for 2.7.
I'm working on streamlining the project files for 3.5 to make my life easier dealing with both installers and the multiple compiler situation, so I'll no doubt poke that project at some point until my grand vision of single-click-install-build-sign-test comes true :)
|
msg223675 - (view) |
Author: Zachary Ware (zach.ware) * |
Date: 2014-07-22 17:17 |
2.7.8 seems fine and there haven't been any reports about Tkinter not working on Win2k yet, so I'll go ahead and change the 2.7 buildbot scripts and close the issue.
|
msg223677 - (view) |
Author: Roundup Robot (python-dev) |
Date: 2014-07-22 17:28 |
New changeset 73fcf00b9e0c by Zachary Ware in branch '2.7':
Closes #21665: Don't use OPTS=noxp or -DWINVER=0x0500 when compiling Tcl/Tk
http://hg.python.org/cpython/rev/73fcf00b9e0c
|
|
Date |
User |
Action |
Args |
2022-04-11 14:58:04 | admin | set | github: 65864 |
2014-07-22 17:28:28 | python-dev | set | status: open -> closed resolution: fixed messages:
+ msg223677
stage: resolved |
2014-07-22 17:17:43 | zach.ware | set | assignee: zach.ware messages:
+ msg223675 |
2014-06-07 05:16:48 | steve.dower | set | messages:
+ msg219917 |
2014-06-07 05:01:57 | zach.ware | set | messages:
+ msg219915 |
2014-06-07 04:48:05 | steve.dower | set | messages:
+ msg219913 |
2014-06-07 03:35:15 | steve.dower | set | messages:
+ msg219910 |
2014-06-06 01:58:35 | zach.ware | set | messages:
+ msg219859 |
2014-06-05 23:29:51 | steve.dower | set | messages:
+ msg219856 |
2014-06-05 17:02:04 | python-dev | set | nosy:
+ python-dev messages:
+ msg219826
|
2014-06-05 15:25:14 | zach.ware | set | nosy:
+ loewis messages:
+ msg219819
|
2014-06-05 08:17:45 | serhiy.storchaka | set | messages:
+ msg219785 |
2014-06-05 07:57:07 | les.bothwell | set | messages:
+ msg219783 |
2014-06-05 07:29:04 | les.bothwell | set | messages:
+ msg219781 |
2014-06-05 04:49:55 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages:
+ msg219779
|
2014-06-04 23:34:34 | ned.deily | set | nosy:
+ zach.ware, steve.dower
|
2014-06-04 23:18:32 | les.bothwell | create | |