Opened 13 years ago

Closed 4 years ago

#22994 closed defect (fixed)

tk +quartz: strange focus behaviour on 10.4/PPC

Reported by: christopherglong@… Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: tiger Cc: petrrr, mojca (Mojca Miklavec)
Port: py-tkinter tk


I have a PowerPC computer running 10.4 Tiger. I can't seem to get py-tkinter to work properly. When I try testing it using the following code, I get different results, depending on which variants of tk I use:

import _tkinter
import Tkinter

When I try tk +darwin +quartz, I get the attached window, which stops responding and has to be force quit.

When I try simply tk +darwin, I get this error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/", line 3667, in _test
    root = Tk()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/", line 1569, in __init__ = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":0"

Any ideas?

Attachments (1)

window.png (12.4 KB) - added by christopherglong@… 13 years ago.
Result of tk +darwin +quartz

Download all attachments as: .zip

Change History (13)

Changed 13 years ago by christopherglong@…

Attachment: window.png added

Result of tk +darwin +quartz

comment:1 Changed 13 years ago by christopherglong@…

I ran the same test on python26 and got the same results. Therefore, I think the problem isn't with py-tkinter, but rather with tk. Strangely, unlike with most tickets regarding tk such as #22180, I have no problem building it, just using it.

comment:2 Changed 13 years ago by mf2k (Frank Schima)

Cc: christopherglong@… removed
Owner: changed from macports-tickets@… to mww@…
Port: tk added

FYI, your example works fine for me with python26 on Snow Leopard. That exact dialog box appears but not in aqua because i have the default tk (i.e. X11) installed:

$ port installed tk
The following ports are currently installed:
  tk @8.5.8_0+darwin (active)

What version of X11 are you running? I'm not even sure which version of XQuartz runs on Tiger.

Also, I know it is not clear, but you should never select platform variants like +darwin. Those are used automatically as needed by port.

comment:3 in reply to:  2 Changed 13 years ago by christopherglong@…

Yeah, it works fine on my SL machine too. What's strangest to me is that I completely reinstalled every single port on my Tiger machine and it still gives me these results. When I open the About window for in /Applications/Utilities/ on 10.4, I get:

X11 1.1.3 - XFree86 4.4.0

And yeah, I know to not manually add platform variants when installing ports; it just looked funny here without it. ;)

comment:4 Changed 13 years ago by christopherglong@…

So, I started tinkering with this some more, specifically with wish. I found some interesting observations:

Running wish with tk +quartz gives some strange results. Specifically, the graphics window appears, and the command prompt works. However, I still can't give focus to the graphics window; when I hover over it, the cursor changes to a beachball (the Dock and Activity Monitor report it as not responding). Despite this, it still responds to commands sent to it from the Terminal. The window size changes depending on the length of labels placed into it. It does not redraw automatically; labels and buttons only become visible when a new object has been added to it or when Exposé is activated.

Running wish with regular tk returns the following error message:

Application initialization failed: couldn't connect to display ":0"

However, if I open first manually, it runs perfectly (whether it is launched from or xterm). Having open also fixes my original Python command (at least with regular tk). Like #17463, it minimizes upon launch, but still behaves normally.

comment:5 Changed 12 years ago by jmroot (Joshua Root)

Summary: py-tkinter 2.4.6: Fails on 10.4/PPCtk +quartz: strange focus behaviour on 10.4/PPC

As you've discovered, Tiger doesn't automatically launch X11 for you. So that just leaves the +quartz issues.

comment:6 Changed 12 years ago by jmroot (Joshua Root)

Keywords: tiger added

comment:7 Changed 8 years ago by petrrr

Cc: petr@… added

Cc Me!

comment:8 Changed 8 years ago by jmroot (Joshua Root)

Python 2.4 is just about to go away. Is this reproducible with a recent python and current tk?

comment:9 Changed 6 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:10 Changed 6 years ago by mf2k (Frank Schima)

Owner: mww@… deleted
Status: newassigned

See #53012.

comment:11 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Owner: set to MarcusCalhoun-Lopez
Status: assignedaccepted

comment:12 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: acceptedclosed

This ticket is no longer relevant since the +quartz variant no longer exists on older systems.

Note: See TracTickets for help on using tickets.