From Vasilis.Vlachoudis at cern.ch Fri Feb 3 11:35:53 2017 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Fri, 3 Feb 2017 16:35:53 +0000 Subject: [Tkinter-discuss] Define height in a row of a grid manager Message-ID: <0BC70B5D93E054469872FFD0FE07220E01B3320BAC@CERNXCHG53.cern.ch> Dear all, I am trying to optimize the screen space use in a small screen QVGA mounted on a RPi On the first row (using the grid manager) I display the time with big fonts. The space allocated for the row includes, correctly includes the descent of the font however in the case of numbers its an empty space. So its loosing a lot of useful screen space there. Is there a way to force the height of a single row in the grid manager to be equal to the font ascent only? Thanks in advance Vasillis -------------- next part -------------- An HTML attachment was scrubbed... URL: From klappnase at web.de Fri Feb 3 19:36:22 2017 From: klappnase at web.de (Michael Lange) Date: Sat, 4 Feb 2017 01:36:22 +0100 Subject: [Tkinter-discuss] Define height in a row of a grid manager In-Reply-To: <0BC70B5D93E054469872FFD0FE07220E01B3320BAC@CERNXCHG53.cern.ch> References: <0BC70B5D93E054469872FFD0FE07220E01B3320BAC@CERNXCHG53.cern.ch> Message-ID: <20170204013622.87dcdb75627aa9d581af439f@web.de> Hi, On Fri, 3 Feb 2017 16:35:53 +0000 Vasilis Vlachoudis wrote: > Dear all, > > I am trying to optimize the screen space use in a small screen QVGA > mounted on a RPi > > On the first row (using the grid manager) I display the time with big > fonts. The space allocated for the row includes, correctly includes the > descent of the font however in the case of numbers its an empty space. > So its loosing a lot of useful screen space there. > > Is there a way to force the height of a single row in the grid manager > to be equal to the font ascent only? I am not entirely sure about this, but if I understand you correctly I think that it might actually not be grid who consumes the "excess" space, but the Label (or whichever) widget that you use to display the digits. If this assumption is true, a workaround might be to use a Canvas of pre-defined height instead and place the time-string with a pixel-sized font into properly calculated coordinates. I did not test this though, just a random thought :-) Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. The more complex the mind, the greater the need for the simplicity of play. -- Kirk, "Shore Leave", stardate 3025.8 From Vasilis.Vlachoudis at cern.ch Sat Feb 4 05:16:01 2017 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Sat, 4 Feb 2017 10:16:01 +0000 Subject: [Tkinter-discuss] Define height in a row of a grid manager In-Reply-To: <20170204013622.87dcdb75627aa9d581af439f@web.de> References: <0BC70B5D93E054469872FFD0FE07220E01B3320BAC@CERNXCHG53.cern.ch>, <20170204013622.87dcdb75627aa9d581af439f@web.de> Message-ID: <0BC70B5D93E054469872FFD0FE07220E01B33261EE@CERNXCHG53.cern.ch> Hi Michael, I was just trying to reply to my self with the solution I've found, while I received your email :) I was using the Canvas in the begging, but it was complicating quite my code, so I tried to avoid it. However I found a solution maybe not the most elegant, but it works. According to the documentation of tk label the "height" option is in text units unless if an image is associated with the label, then it is in screen units. So I've created a dummy image of 1x1 pixels as transparent gif and added it as image/text compound in the label see the code below. import tkFont from Tkinter import * ONEPIXEL=r"R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" def function(event=None): print time.winfo_geometry() print time.winfo_geometry() print date.winfo_geometry() if __name__ == "__main__": tk=Tk() onepixel=PhotoImage(data=ONEPIXEL) timefont = tkFont.Font(family="Helvetica",size=-96) ascent = timefont.metrics()['ascent'] print "ascent=",ascent time = Label(tk, text="10:21:46", image=onepixel, compound=LEFT, font=timefont, background="Yellow", height=ascent ) time.grid(row=0, column=0, sticky=N+EW) time.bind("<1>", function) date = Label(tk, text="Sat 04 Feb 2017", font="Helevetica -25", background="Cyan") date.grid(row=1, column=0, sticky=NSEW) tk.grid_rowconfigure(0, minsize=10) tk.mainloop() ________________________________________ From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Michael Lange [klappnase at web.de] Sent: Saturday, February 04, 2017 01:36 To: tkinter-discuss at python.org Subject: Re: [Tkinter-discuss] Define height in a row of a grid manager Hi, On Fri, 3 Feb 2017 16:35:53 +0000 Vasilis Vlachoudis wrote: > Dear all, > > I am trying to optimize the screen space use in a small screen QVGA > mounted on a RPi > > On the first row (using the grid manager) I display the time with big > fonts. The space allocated for the row includes, correctly includes the > descent of the font however in the case of numbers its an empty space. > So its loosing a lot of useful screen space there. > > Is there a way to force the height of a single row in the grid manager > to be equal to the font ascent only? I am not entirely sure about this, but if I understand you correctly I think that it might actually not be grid who consumes the "excess" space, but the Label (or whichever) widget that you use to display the digits. If this assumption is true, a workaround might be to use a Canvas of pre-defined height instead and place the time-string with a pixel-sized font into properly calculated coordinates. I did not test this though, just a random thought :-) Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. The more complex the mind, the greater the need for the simplicity of play. -- Kirk, "Shore Leave", stardate 3025.8 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org https://mail.python.org/mailman/listinfo/tkinter-discuss From klappnase at web.de Tue Feb 7 05:19:40 2017 From: klappnase at web.de (Michael Lange) Date: Tue, 7 Feb 2017 11:19:40 +0100 Subject: [Tkinter-discuss] Define height in a row of a grid manager In-Reply-To: <0BC70B5D93E054469872FFD0FE07220E01B33261EE@CERNXCHG53.cern.ch> References: <0BC70B5D93E054469872FFD0FE07220E01B3320BAC@CERNXCHG53.cern.ch> <20170204013622.87dcdb75627aa9d581af439f@web.de> <0BC70B5D93E054469872FFD0FE07220E01B33261EE@CERNXCHG53.cern.ch> Message-ID: <20170207111940.b2393a247fee125a59e39db2@web.de> Hi, On Sat, 4 Feb 2017 10:16:01 +0000 Vasilis Vlachoudis wrote: > Hi Michael, > > I was just trying to reply to my self with the solution I've found, > while I received your email :) I was using the Canvas in the begging, > but it was complicating quite my code, so I tried to avoid it. However > I found a solution maybe not the most elegant, but it works. According > to the documentation of tk label the "height" option is in text units > unless if an image is associated with the label, then it is in screen > units. So I've created a dummy image of 1x1 pixels as transparent gif > and added it as image/text compound in the label see the code below. (...) Actually I think this is pretty elegant, much better than bothering with Canvas text items :-) If every pixel counts, you could btw save two more vertically if you set pady=0 in the Label constructor (at least here on X the default appears to be pady=1). If horizontal pixels count also you could of course use padx=0, too and replace the ONEPIXEL image data with an empty string to save three more horizontal pixels. Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Too much of anything, even love, isn't necessarily a good thing. -- Kirk, "The Trouble with Tribbles", stardate 4525.6 From Vasilis.Vlachoudis at cern.ch Sun Feb 12 04:35:52 2017 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Sun, 12 Feb 2017 09:35:52 +0000 Subject: [Tkinter-discuss] Define height in a row of a grid manager In-Reply-To: <20170207111940.b2393a247fee125a59e39db2@web.de> References: <0BC70B5D93E054469872FFD0FE07220E01B3320BAC@CERNXCHG53.cern.ch> <20170204013622.87dcdb75627aa9d581af439f@web.de> <0BC70B5D93E054469872FFD0FE07220E01B33261EE@CERNXCHG53.cern.ch>, <20170207111940.b2393a247fee125a59e39db2@web.de> Message-ID: <0BC70B5D93E054469872FFD0FE07220E01B3342C49@CERNXCHG53.cern.ch> I didn't know that I could set it as empty string the image. I will try it. Thanks Vasilis ________________________________________ From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Michael Lange [klappnase at web.de] Sent: Tuesday, February 07, 2017 11:19 To: tkinter-discuss at python.org Subject: Re: [Tkinter-discuss] Define height in a row of a grid manager Hi, On Sat, 4 Feb 2017 10:16:01 +0000 Vasilis Vlachoudis wrote: > Hi Michael, > > I was just trying to reply to my self with the solution I've found, > while I received your email :) I was using the Canvas in the begging, > but it was complicating quite my code, so I tried to avoid it. However > I found a solution maybe not the most elegant, but it works. According > to the documentation of tk label the "height" option is in text units > unless if an image is associated with the label, then it is in screen > units. So I've created a dummy image of 1x1 pixels as transparent gif > and added it as image/text compound in the label see the code below. (...) Actually I think this is pretty elegant, much better than bothering with Canvas text items :-) If every pixel counts, you could btw save two more vertically if you set pady=0 in the Label constructor (at least here on X the default appears to be pady=1). If horizontal pixels count also you could of course use padx=0, too and replace the ONEPIXEL image data with an empty string to save three more horizontal pixels. Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Too much of anything, even love, isn't necessarily a good thing. -- Kirk, "The Trouble with Tribbles", stardate 4525.6 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org https://mail.python.org/mailman/listinfo/tkinter-discuss From cabraut at yahoo.com Wed Feb 22 09:28:24 2017 From: cabraut at yahoo.com (CAB) Date: Wed, 22 Feb 2017 14:28:24 +0000 (UTC) Subject: [Tkinter-discuss] file dialog changes References: <2098379371.2672681.1487773704567.ref@mail.yahoo.com> Message-ID: <2098379371.2672681.1487773704567@mail.yahoo.com> Hi, All, I have been happily developing applications in a Win32/Python 2.7 environment for years, now.? I recently decided I needed to update multiple python packages, so I installed Anaconda on my Win7 computer.? Everything is more or less fine (once I dealt with some backward compatibility issues), but I noticed that the file dialogs called by tkinter are different now.? Here is what askopenfilename used to look like:I like it! But here is the new version:Blech! I have googled the bejeezus out of this, but I can't find an explanation for the difference.? I think it must boil down to differences in Tk/Tcl, or a setting therein, or possibly pywin32.? But I just haven't been able to figure it out.? Obviously, I'd like to go back to the old appearance. If anyone has any suggestions to fix this problem, I would be most appreciative. Best,Chad -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 136000 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53621 bytes Desc: not available URL: From aivar.annamaa at gmail.com Wed Feb 22 10:18:09 2017 From: aivar.annamaa at gmail.com (Aivar Annamaa) Date: Wed, 22 Feb 2017 17:18:09 +0200 Subject: [Tkinter-discuss] How to get symbolic links from filedialog.askopenfilename? Message-ID: <671818cd-0956-3fde-a91e-8b13f1f6ca8f@gmail.com> Hi! Looks like tkinter.filedialog.askopenfilename (Tk 8.5) expands symbolic links (at least on Mac). Any ideas how to avoid this and get the selected link itself? Best regards, Aivar From jepler at unpythonic.net Wed Feb 22 12:28:47 2017 From: jepler at unpythonic.net (Jeff Epler) Date: Wed, 22 Feb 2017 11:28:47 -0600 Subject: [Tkinter-discuss] Looking for maintainer / hosting for tkinter wiki Message-ID: <20170222172847.GD29735@unpythonic.net> Hello all. I have run a tkinter wiki (https://tkinter.unpythonic.net/) for many years. It doesn't see much traffic, and my interests and hobby time allocation haven't really aligned with it for quite some time. Consequently, I am looking for someone to take over maintainance and hosting of the site. Right now it is hosted on atlantic.net with a "GO"-size instance (1 vCPI, 256MB RAM, 10GB disk) running debian jessie x86_64 and moin 1.9.x. Webserver is apache2. Letsencrypt is used for the https certificate, via the 'simp_le' client. Looking at one day's apache logs there are <3000 HTTP requests per day. I can supply a copy of the full disk or just the webroot for tkinter (5.7GB and 1.4GB respectively, uncompressed), or rsync/root access for a new maintainer to effect transfer to a new system. (Unfortunately, atlantic.net's API doesn't seem to support transferring to another user, which otherwise would be a great way for a new maintainer to take over the system) If possible I'd like to terminate my maintainance and hosting of tkinter.unpythonic.net "sometime this spring". I am holding on to unpythonic.net, so I can probably supply redirection (either by a DNS CNAME or a HTTP 302 redirect) indefinitely, but will commit to doing it for at least 2 years. If you would like to take over this duty, please contact me off-list and make sure to include the words "tkinter wiki" in the subject line. If another maintainer doesn't step up, I may pull the plug on the wiki sometime after May 31, 2017. Jeff From emilianogavilan at gmail.com Thu Feb 23 06:54:54 2017 From: emilianogavilan at gmail.com (Emiliano Gavilan) Date: Thu, 23 Feb 2017 08:54:54 -0300 Subject: [Tkinter-discuss] file dialog changes In-Reply-To: <2098379371.2672681.1487773704567@mail.yahoo.com> References: <2098379371.2672681.1487773704567.ref@mail.yahoo.com> <2098379371.2672681.1487773704567@mail.yahoo.com> Message-ID: The "problem" seems to be Tcl/Tk tip 432 ( http://www.tcl.tk/cgi-bin/tct/tip/432 ). Apparently your "new" installation provides an older version of Tk. You need Tcl/Tk 8.6.3 or newer to see the modern dialogs. Regards Emiliano 2017-02-22 11:28 GMT-03:00 CAB via Tkinter-discuss < tkinter-discuss at python.org>: > Hi, All, > > I have been happily developing applications in a Win32/Python 2.7 > environment for years, now. I recently decided I needed to update multiple > python packages, so I installed Anaconda on my Win7 computer. Everything > is more or less fine (once I dealt with some backward compatibility > issues), but I noticed that the file dialogs called by tkinter are > different now. Here is what askopenfilename used to look like: > [image: Inline image] > I like it! > > But here is the new version: > [image: Inline image] > Blech! > > I have googled the bejeezus out of this, but I can't find an explanation > for the difference. I think it must boil down to differences in Tk/Tcl, or > a setting therein, or possibly pywin32. But I just haven't been able to > figure it out. Obviously, I'd like to go back to the old appearance. > > If anyone has any suggestions to fix this problem, I would be most > appreciative. > > Best, > Chad > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53621 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 136000 bytes Desc: not available URL: From cabraut at yahoo.com Thu Feb 23 09:27:42 2017 From: cabraut at yahoo.com (CAB) Date: Thu, 23 Feb 2017 14:27:42 +0000 (UTC) Subject: [Tkinter-discuss] file dialog changes In-Reply-To: References: <2098379371.2672681.1487773704567.ref@mail.yahoo.com> <2098379371.2672681.1487773704567@mail.yahoo.com> Message-ID: <2114375393.3492511.1487860063015@mail.yahoo.com> Thanks for looking into this, Emiliano! But this is where things get weird.? Both versions appear to be running variants of Tcl/Tk 8.5.? The "old" version is 8.5.2, whereas the "new" one is 8.5.15.? The simpler dialog thus appears to be either a bug in the newer versions or a feature that was consciously chosen by the developers. Now, here is something fun.? The application I use to freeze my code is PyInstaller.? This writes everything needed for my app in a folder that I can distribute.? In that folder, I see subfolders called "tk" and "tcl", as well as files called "_tkinter.pyd", "tcl85.dll" and "tk85.dll".? If I freeze using the new Python and then replace those five items with the same items that were included in from an older Pytinstaller session, I get my dialogs back. For now, this is the solution that I'm going to use.? I'll post if I find problems, and I'll keep my fingers crossed that eventually Anaconda will distribute Tcl/Tk 8.6.3+. Best,Chad From: Emiliano Gavilan To: CAB Cc: "tkinter-discuss at python.org" Sent: Thursday, February 23, 2017 5:54 AM Subject: Re: [Tkinter-discuss] file dialog changes The "problem" seems to be Tcl/Tk tip 432 ( http://www.tcl.tk/cgi-bin/tct/tip/432 ). Apparently your "new" installation provides an older version of Tk. You need Tcl/Tk 8.6.3 or newer to see the modern dialogs. Regards Emiliano 2017-02-22 11:28 GMT-03:00 CAB via Tkinter-discuss : Hi, All, I have been happily developing applications in a Win32/Python 2.7 environment for years, now.? I recently decided I needed to update multiple python packages, so I installed Anaconda on my Win7 computer.? Everything is more or less fine (once I dealt with some backward compatibility issues), but I noticed that the file dialogs called by tkinter are different now.? Here is what askopenfilename used to look like:I like it! But here is the new version:Blech! I have googled the bejeezus out of this, but I can't find an explanation for the difference.? I think it must boil down to differences in Tk/Tcl, or a setting therein, or possibly pywin32.? But I just haven't been able to figure it out.? Obviously, I'd like to go back to the old appearance. If anyone has any suggestions to fix this problem, I would be most appreciative. Best,Chad ______________________________ _________________ Tkinter-discuss mailing list Tkinter-discuss at python.org https://mail.python.org/ mailman/listinfo/tkinter- discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53621 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 136000 bytes Desc: not available URL: