From michael.odonnell at uam.es Tue Oct 9 19:19:37 2007 From: michael.odonnell at uam.es (Michael O'Donnell) Date: Tue, 9 Oct 2007 19:19:37 +0200 Subject: [Tkinter-discuss] Unicode in MacOSX: any progress? Message-ID: <47e491110710091019q24a76571hc56308210e9c0e18@mail.gmail.com> Dear all, I develop an application for linguistic annotation, using python/tkinter, and have just extended my code to support unicode text files. All went fine on the Windows version (where I develop), but when I took my code over to MacOS (Tiger, with python 2.5.1), I find Tkinter cannot display unicode under MacOS. A previous posting (mikegasser at sbcglobal.net) almost a year ago gave a simple example: #========================= from Tkinter import * import tkFont root = Tk() myFont = tkFont.Font(size=18) w = Label(root, text=u'Bun\u0103-diminea\u021ba, lume', font=myFont) w.pack() root.mainloop() #========================= This works fine under Windows, but displays squares for the unicode chars under MacOSX. This has not been fixed in the last year. Are there any solutions to this problem? Mick From mkieverpy at tlink.de Wed Oct 10 12:00:39 2007 From: mkieverpy at tlink.de (mkieverpy at tlink.de) Date: Wed, 10 Oct 2007 10:00:39 -0000 Subject: [Tkinter-discuss] Unicode in MacOSX: any progress? Message-ID: <20071010074927.5FB96BAD4@mail.terralink.de> Hello Michael, in my answer back in october 2006 to Mike Gasser on this list, I referred to a thread I found here: http://aspn.activestate.com/ASPN/Mail/Message/tcl-mac/2865240 This thread discusses a patch for tk 8.4.9 to enable support for something called "Apple Type Services for Unicode Imaging" (ATSUI). Being also somewhat interested I looked into the ChangeLogs of the current releases of tk. From the info found there I guess that this patch has never been incorporated in the 8.4 branch (No mention of it in the current 8.4.16 release). But it is mentioned in the current 8.5 Beta release. This looks like you have to move to 8.5 for unicode on MacOSX (and see what other things in Tkinter break :-) or find the patch and do it yourself for 8.4. BTW Mike Gasser never reported success/failure to the list. I would be very interested to hear if and how it works for you. Matthias Kievernagel mkiever-at-web-dot-de From michael.odonnell at uam.es Wed Oct 10 13:04:47 2007 From: michael.odonnell at uam.es (Michael O'Donnell) Date: Wed, 10 Oct 2007 13:04:47 +0200 Subject: [Tkinter-discuss] Unicode in MacOSX: any progress? Message-ID: <47e491110710100404v30db473ei9829c7d17c38ce49@mail.gmail.com> Thanks Matthias, I had checked out the tcl/tk8.5 sources, and saw that the font rendering on Macs does indeed use the ATSU code. However, I fear to try to integrate tcl/tk8.5 with Tkinter, and will wait for Tkinter itself to switch to tcl/tk8.5 (hopefully next year?) The ATSU patch itself: I cannot find it - all links it it seem to lead to dead pages. Anyone know a url from which i can download it? Mick > From: mkieverpy at tlink.de > Subject: Re: [Tkinter-discuss] Unicode in MacOSX: any progress? > To: tkinter-discuss at python.org > Message-ID: <20071010074927.5FB96BAD4 at mail.terralink.de> > Content-Type: text/plain; charset="utf-8" > > Hello Michael, > > in my answer back in october 2006 to Mike Gasser on this list, > I referred to a thread I found here: > http://aspn.activestate.com/ASPN/Mail/Message/tcl-mac/2865240 > This thread discusses a patch for tk 8.4.9 to enable support > for something called "Apple Type Services for Unicode Imaging" (ATSUI). > Being also somewhat interested I looked into the ChangeLogs > of the current releases of tk. From the info found there > I guess that this patch has never been incorporated in the 8.4 branch > (No mention of it in the current 8.4.16 release). > But it is mentioned in the current 8.5 Beta release. > > This looks like you have to move to 8.5 for unicode on MacOSX > (and see what other things in Tkinter break :-) > or find the patch and do it yourself for 8.4. > > BTW Mike Gasser never reported success/failure to the list. > I would be very interested to hear if and how it works for you. > > > Matthias Kievernagel > mkiever-at-web-dot-de > From nicholaskriz at gmail.com Sat Oct 13 10:52:43 2007 From: nicholaskriz at gmail.com (Nicholas) Date: Sat, 13 Oct 2007 03:52:43 -0500 Subject: [Tkinter-discuss] widget focus switching problems. Message-ID: I'm having difficulty switching focus between widgets in my program. This is a mostly non-functioning GUI to be used for database creation, saving and retreival. The code currently looks horrifyingly unPythonic since I'm very new to this and I'm just kind of hacking my way through it. It's also several hundred more lines than I should put in here. My major question is if there is a Python or Tkinter piece of code that will excecute itself as though I had pressed the tab button? In other words, I'd like to bind the return key, when pressed in my Entry box, to switch focus (or Tab) to the next item in the focus loop. I have the focus turned off for all other widgets aside from the ones created by the function below and one button (the one that will save the entries to the db). Sorry if this is long-winded, but I'm not sure what I'm talking about enough to be concise. Anyway, here's the code so far and what I think it does: ########################## variables = [] # clears previously collected values for field in SHORTKEYS: # iterates over a list of 40 items ent = Entry(rite) # creates the entry box ent.pack(side = TOP, fill = X) # packs the entry box if field == 'name': # 'name' is the first entry box, ent.focus_set() # so it gets focus on startup ent.bind('', return_pressed) # binds on all entry boxes var = StringVar() # ent.config(textvariable=var) # all the other lines convert the entries variables.append(var) # to a list I can use later. return variables # ########################## Any help would be greatly appreciated. Thanks, Nick From klappnase at web.de Mon Oct 15 20:54:22 2007 From: klappnase at web.de (Michael Lange) Date: Mon, 15 Oct 2007 20:54:22 +0200 Subject: [Tkinter-discuss] widget focus switching problems. In-Reply-To: References: Message-ID: <20071015205422.6f92fb4e.klappnase@web.de> On Sat, 13 Oct 2007 03:52:43 -0500 Nicholas wrote: > I'm having difficulty switching focus between widgets in my program. This > is a mostly non-functioning GUI to be used for database creation, saving > and retreival. The code currently looks horrifyingly unPythonic since I'm > very new to this and I'm just kind of hacking my way through it. It's also > several hundred more lines than I should put in here. My major question is > if there is a Python or Tkinter piece of code that will excecute itself as > though I had pressed the tab button? In other words, I'd like to bind the > return key, when pressed in my Entry box, to switch focus (or Tab) to the > next item in the focus loop. I have the focus turned off for all other > widgets aside from the ones created by the function below and one button > (the one that will save the entries to the db). Sorry if this is > long-winded, but I'm not sure what I'm talking about enough to be concise. > Anyway, here's the code so far and what I think it does: > > ########################## > > variables = [] # clears previously collected values > for field in SHORTKEYS: # iterates over a list of 40 items > ent = Entry(rite) # creates the entry box > ent.pack(side = TOP, fill = X) # packs the entry box > if field == 'name': # 'name' is the first entry box, > ent.focus_set() # so it gets focus on startup > ent.bind('', return_pressed) # binds on all entry > boxes > var = StringVar() # > ent.config(textvariable=var) # all the other lines convert the entries > variables.append(var) # to a list I can use later. > return variables # > Hi Nick, you will want to use the widget's event_generate() method to emulate the Tab-keystroke, so your callback might look like: def return_pressed(event): event.widget.event_generate('') return 'break' The "return 'break'" statement stops the event from triggering its default callback (if any). I hope this helps. Michael From michael.odonnell at uam.es Tue Oct 16 19:08:46 2007 From: michael.odonnell at uam.es (Michael O'Donnell) Date: Tue, 16 Oct 2007 19:08:46 +0200 Subject: [Tkinter-discuss] Tkinter on MacOS 10.3.9 Message-ID: <47e491110710161008y5ac803fbif422835e47aaacba@mail.gmail.com> Dear all, I made a standalone application using py2app on a Mac running OS 10.4.9, using Python 2.51, using Tkinter. It works fine on Macs of the 10.4.x vintage. However, a user in China reports the following crash on startup: ImportError: dlcompat: dyld: /Users/bernadetteho/Desktop/UAMCorpusTool.app/Contents/MacOS/UAMCorpusTool can't open library: /Library/Frameworks/Tk.framework/Versions/8.4/Tk (No such file or directory, errno = 2) and the Corpus Tool had to be terminated. Anyone know how to solve this problem? I don't have access to OS 10.3.9, so cannot check it out. Could I just zip up the contents of my own /System/Library/Frameworks/Tk.framework/ and send that to her to install? Would that work? I tried deleting my Tcl and Tk frameworks on my own system and then installing TclTkAqua-8.4.10 from the following url, and then trying my own application, but it reported incompatible builds: http://prdownloads.sourceforge.net/tcltkaqua/TclTkAqua-8.4.10.dmg?download Mick From kw at codebykevin.com Tue Oct 16 19:16:33 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 16 Oct 2007 13:16:33 -0400 Subject: [Tkinter-discuss] Tkinter on MacOS 10.3.9 In-Reply-To: <47e491110710161008y5ac803fbif422835e47aaacba@mail.gmail.com> References: <47e491110710161008y5ac803fbif422835e47aaacba@mail.gmail.com> Message-ID: <4714F1F1.60906@codebykevin.com> Michael O'Donnell wrote: > Dear all, > > I made a standalone application using py2app on a Mac running > OS 10.4.9, using Python 2.51, using Tkinter. > > It works fine on Macs of the 10.4.x vintage. However, a user > in China reports the following crash on startup: > > ImportError: dlcompat: dyld: > /Users/bernadetteho/Desktop/UAMCorpusTool.app/Contents/MacOS/UAMCorpusTool > can't open library: /Library/Frameworks/Tk.framework/Versions/8.4/Tk > (No such file or directory, errno = 2) and the Corpus Tool had to be > terminated. > > Anyone know how to solve this problem? > > I don't have access to OS 10.3.9, so cannot check it out. > > Could I just zip up the contents of my own > /System/Library/Frameworks/Tk.framework/ > and send that to her to install? Would that work? > > I tried deleting my Tcl and Tk frameworks > on my own system and then installing TclTkAqua-8.4.10 from the following url, > and then trying my own application, but it reported incompatible builds: > > http://prdownloads.sourceforge.net/tcltkaqua/TclTkAqua-8.4.10.dmg?download > The user needs to download Tcl/Tk Aqua from the site you referenced and install it on her system. Panther doesn't come with Tk by default. -- Kevin Walzer Code by Kevin http://www.codebykevin.com