From pierre.dagenais at ncf.ca Tue Feb 4 21:08:53 2014 From: pierre.dagenais at ncf.ca (Pierre Dagenais) Date: Tue, 04 Feb 2014 15:08:53 -0500 Subject: [Tkinter-discuss] root Message-ID: <52F148D5.9090803@ncf.ca> This program, example1.py: > from tkinter import * > > root = Tk() > canvas = Canvas() > canvas.pack() > > root.mainloop() and this one, example2.py: > from tkinter import * > > canvas = Canvas() > canvas.pack() > > mainloop() do exactly the same thing, as far as I can tell. Yet, most examples I find on the net use the first form. Why? I must be missing something, but I can't figure what is the utility of root. Can you help? PierreD. From pierre.dagenais at ncf.ca Tue Feb 4 22:29:48 2014 From: pierre.dagenais at ncf.ca (Pierre Dagenais) Date: Tue, 04 Feb 2014 16:29:48 -0500 Subject: [Tkinter-discuss] root In-Reply-To: References: <52F148D5.9090803@ncf.ca> Message-ID: <52F15BCC.7000204@ncf.ca> On 14-02-04 04:07 PM, Bryan Oakley wrote: > You must have a root window. If you do not create one, one will be created > for you. That's just how tkinter works. > > PEP-20 says "Explicit is better than implicit", so explicitly creating the > root window is better than letting tkinter implicitly create it for you. > Makes a lot of sense! Thank you, > > On Tue, Feb 4, 2014 at 2:08 PM, Pierre Dagenais wrote: > >> This program, example1.py: >> >>> from tkinter import * >>> >>> root = Tk() >>> canvas = Canvas() >>> canvas.pack() >>> >>> root.mainloop() >> >> >> and this one, example2.py: >> >>> from tkinter import * >>> >>> canvas = Canvas() >>> canvas.pack() >>> >>> mainloop() >> >> do exactly the same thing, as far as I can tell. Yet, most examples I >> find on the net use the first form. Why? >> I must be missing something, but I can't figure what is the utility of >> root. Can you help? >> >> PierreD. >> _______________________________________________ >> Tkinter-discuss mailing list >> Tkinter-discuss at python.org >> https://mail.python.org/mailman/listinfo/tkinter-discuss >> > From Vasilis.Vlachoudis at cern.ch Fri Feb 7 17:46:58 2014 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Fri, 7 Feb 2014 16:46:58 +0000 Subject: [Tkinter-discuss] Interrupt a long process Message-ID: <0BC70B5D93E054469872FFD0FE07220EC0692F3E@PLOXCHG14.cern.ch> Hi all, in my canvas sometimes it happens to have a long process to insert lots of items. This typically takes a lot of time (up to min) so I want to give the possibility to the user to interrupt this process. And since I am adding to the Canvas I cannot push it on a thread. So in the main thread, in the big loop, once I exceed a certain time I display a button to interrupt the long process and I call the update_idletasks() periodically. However it is not possible for the user to click on the button. It seems that the update_idletasks doesn't update the "Button-1" messages How can I do it? Thanks in advance Vasilis -------------- next part -------------- An HTML attachment was scrubbed... URL: From klappnase at web.de Fri Feb 7 19:37:17 2014 From: klappnase at web.de (Michael Lange) Date: Fri, 7 Feb 2014 19:37:17 +0100 Subject: [Tkinter-discuss] Interrupt a long process In-Reply-To: <0BC70B5D93E054469872FFD0FE07220EC0692F3E@PLOXCHG14.cern.ch> References: <0BC70B5D93E054469872FFD0FE07220EC0692F3E@PLOXCHG14.cern.ch> Message-ID: <20140207193717.08e111f2ebd80dd75d8d7f70@web.de> Hi, On Fri, 7 Feb 2014 16:46:58 +0000 Vasilis Vlachoudis wrote: > Hi all, > > in my canvas sometimes it happens to have a long process to insert lots > of items. > > This typically takes a lot of time (up to min) so I want to give the > possibility to the user to interrupt this process. > And since I am adding to the Canvas I cannot push it on a thread. > > So in the main thread, in the big loop, once I exceed a certain time > I display a button to interrupt the long process and I call the > update_idletasks() periodically. However it is not possible for the > user to click on the button. > > It seems that the update_idletasks doesn't update the "Button-1" > messages How can I do it? sounds like this is one of the rare cases where you will have to use update() instead of update_idletasks() Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. We Klingons believe as you do -- the sick should die. Only the strong should live. -- Kras, "Friday's Child", stardate 3497.2 From bha100710 at gmail.com Tue Feb 11 10:19:31 2014 From: bha100710 at gmail.com (Bhaskar Chaudhary) Date: Tue, 11 Feb 2014 14:49:31 +0530 Subject: [Tkinter-discuss] Differences on Mac and Windows Message-ID: Hi The following piece of code displays correctly on Windows PC but it displays all messed up in OS X (10.9.1 and others) as shown in attachment below. from Tkinter import * root = Tk() root.geometry('142x280+150+200') root.configure(background='#4D4D4D') mytext = Text(root, background='#101010', foreground="#D6D6D6", borderwidth=18, relief='sunken',width=16, height=5, font="Times 8 bold" ) mytext.insert(END, "Style is knowing \nwho you are, what \nyou want to say, \nand not giving a \ndamn.") mytext.grid(row=0, column=0, columnspan=6, padx=5, pady=5) root.mainloop() Any reasons why it shows the way it does on Mac. Thanks. Version Info: Python 2.7.3 >>>> Tkinter.__version__ > '$Revision: 81008 $' >>>> Tkinter.TclVersion > 8.5 >>>> Tkinter.TkVersion > 8.5 regards Bhaskar Chaudhary -------------- next part -------------- A non-text attachment was scrubbed... Name: tkwindows.png Type: image/png Size: 5184 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tkmac.png Type: image/png Size: 5908 bytes Desc: not available URL: From klappnase at web.de Tue Feb 11 11:25:45 2014 From: klappnase at web.de (Michael Lange) Date: Tue, 11 Feb 2014 11:25:45 +0100 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: References: Message-ID: <20140211112545.05395d908c06df4d79da5d3d@web.de> Hi, On Tue, 11 Feb 2014 14:49:31 +0530 Bhaskar Chaudhary wrote: > Hi > > The following piece of code displays correctly on Windows PC but it > displays all messed up in OS X (10.9.1 and others) as shown in > attachment below. (...) > > Any reasons why it shows the way it does on Mac. > Thanks. > I think "all messed up" is a little harsh for the mac screenshot ;) Just a guess: the difference in the appearance of the border and the font might be caused by a different dpi value in use by your windows and OSX systems. You can check the respective values by adding the line print 'DPI value: %f' % root.winfo_fpixels('1i') to your example. You can even force your application to use a custom dpi value, if you do root.tk.call('tk', 'scaling', '-displayof', '.', dpi_value / 72.0) _before_ creating any of root's child widgets. As far as the font size is concerned, you can use pixel sized fonts to minimize the risk of your font appearance getting spoiled by dpi settings; to do so simply use a negative size value, as in "Times -8 bold". Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Our way is peace. -- Septimus, the Son Worshiper, "Bread and Circuses", stardate 4040.7. From Vasilis.Vlachoudis at cern.ch Fri Feb 14 10:57:15 2014 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Fri, 14 Feb 2014 09:57:15 +0000 Subject: [Tkinter-discuss] Interrupt a long process In-Reply-To: <20140207193717.08e111f2ebd80dd75d8d7f70@web.de> References: <0BC70B5D93E054469872FFD0FE07220EC0692F3E@PLOXCHG14.cern.ch>, <20140207193717.08e111f2ebd80dd75d8d7f70@web.de> Message-ID: <0BC70B5D93E054469872FFD0FE07220EC06FAB28@CERNXCHG54.cern.ch> Thank you, it worked! Vasilis ________________________________________ From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Michael Lange [klappnase at web.de] Sent: 07 February 2014 19:37 To: tkinter-discuss at python.org Subject: Re: [Tkinter-discuss] Interrupt a long process Hi, On Fri, 7 Feb 2014 16:46:58 +0000 Vasilis Vlachoudis wrote: > Hi all, > > in my canvas sometimes it happens to have a long process to insert lots > of items. > > This typically takes a lot of time (up to min) so I want to give the > possibility to the user to interrupt this process. > And since I am adding to the Canvas I cannot push it on a thread. > > So in the main thread, in the big loop, once I exceed a certain time > I display a button to interrupt the long process and I call the > update_idletasks() periodically. However it is not possible for the > user to click on the button. > > It seems that the update_idletasks doesn't update the "Button-1" > messages How can I do it? sounds like this is one of the rare cases where you will have to use update() instead of update_idletasks() Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. We Klingons believe as you do -- the sick should die. Only the strong should live. -- Kras, "Friday's Child", stardate 3497.2 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org https://mail.python.org/mailman/listinfo/tkinter-discuss From bha100710 at gmail.com Fri Feb 14 15:20:13 2014 From: bha100710 at gmail.com (Bhaskar Chaudhary) Date: Fri, 14 Feb 2014 19:50:13 +0530 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: <20140211112545.05395d908c06df4d79da5d3d@web.de> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> Message-ID: Hello Thanks Michael for the suggestions. I tried inserting root.tk.call('tk', 'scaling', '-displayof', '.', root.winfo_fpixels('1i') / 72.0) before adding any children to the root. I also tried using negative size value ("Times -8 bold") as suggested. Neither of the two made any difference on a Mac. It still looks the way as shown in attachment. Any more suggestions on how to correct this issue will be really appreciated. regards Bhaskar Chaudhary On 2/11/14, Michael Lange wrote: > Hi, > > On Tue, 11 Feb 2014 14:49:31 +0530 > Bhaskar Chaudhary wrote: > >> Hi >> >> The following piece of code displays correctly on Windows PC but it >> displays all messed up in OS X (10.9.1 and others) as shown in >> attachment below. > (...) >> >> Any reasons why it shows the way it does on Mac. >> Thanks. >> > > I think "all messed up" is a little harsh for the mac screenshot ;) > Just a guess: the difference in the appearance of the border and the > font might be caused by a different dpi value in use by your windows and > OSX systems. You can check the respective values by adding the line > > print 'DPI value: %f' % root.winfo_fpixels('1i') > > to your example. > You can even force your application to use a custom dpi value, if you do > > root.tk.call('tk', 'scaling', '-displayof', '.', dpi_value / 72.0) > > _before_ creating any of root's child widgets. > > As far as the font size is concerned, you can use pixel sized fonts to > minimize the risk of your font appearance getting spoiled by dpi > settings; to do so simply use a negative size value, as in > "Times -8 bold". > > Regards > > Michael > > > .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. > > Our way is peace. > -- Septimus, the Son Worshiper, "Bread and Circuses", > stardate 4040.7. > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > -------------- next part -------------- A non-text attachment was scrubbed... Name: PastedGraphic-1.png Type: image/png Size: 8365 bytes Desc: not available URL: From kw at codebykevin.com Fri Feb 14 15:25:17 2014 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 14 Feb 2014 09:25:17 -0500 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: References: <20140211112545.05395d908c06df4d79da5d3d@web.de> Message-ID: <52FE274D.40301@codebykevin.com> On 2/14/14, 9:20 AM, Bhaskar Chaudhary wrote: > Any more suggestions on how to correct this issue will be really appreciated. A few observations: 1. That font looks pixellated, which means it's a bitmap font. Are you using the native Aqua version of Tk or an X11-based one? Bitmaps fonts can still be found in X11 builds of Tk that are built without XFT support, but you don't see it much these days. 2. If you're using native Tk, is your machine a HiDPI/Retina display? --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com From bha100710 at gmail.com Fri Feb 14 15:44:21 2014 From: bha100710 at gmail.com (Bhaskar Chaudhary) Date: Fri, 14 Feb 2014 20:14:21 +0530 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: <52FE274D.40301@codebykevin.com> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> Message-ID: Thanks Kevin The only place I specify a font is on this line: mytext = Text(root, background='#101010', foreground="#D6D6D6", borderwidth=18, relief='sunken',width=16, height=5, font="Times 8 bold" ) I am using native Aqua version as I don't explicitly change it anywhere. I am not sure of what you mean when you say it looks pixelated, but could that be because of taking a screenshot ? The problem has been reported on a large number of Mac Pcs - so am sure not all of them would be HiDPI/Retina display thanks Bhaskar Chaudhary On 2/14/14, Kevin Walzer wrote: > On 2/14/14, 9:20 AM, Bhaskar Chaudhary wrote: >> Any more suggestions on how to correct this issue will be really >> appreciated. > > A few observations: > > 1. That font looks pixellated, which means it's a bitmap font. Are you > using the native Aqua version of Tk or an X11-based one? Bitmaps fonts > can still be found in X11 builds of Tk that are built without XFT > support, but you don't see it much these days. > > 2. If you're using native Tk, is your machine a HiDPI/Retina display? > > --Kevin > > -- > Kevin Walzer > Code by Kevin/Mobile Code by Kevin > http://www.codebykevin.com > http://www.wtmobilesoftware.com > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > From kw at codebykevin.com Fri Feb 14 15:54:20 2014 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 14 Feb 2014 09:54:20 -0500 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> Message-ID: <52FE2E1C.60204@codebykevin.com> On 2/14/14, 9:44 AM, Bhaskar Chaudhary wrote: > The only place I specify a font is on this line: > mytext = Text(root, background='#101010', foreground="#D6D6D6", > borderwidth=18, relief='sunken',width=16, height=5, font="Times 8 > bold" ) Well, now I'm confused. I translated the code to Tcl and ran it myself. Looks like your screenshot. It also looks as I expect it to. How is it supposed to look? Perhaps we need to see a screenshot on Windows for comparison. I have observed differences in the way fonts are rendered on Mac and Windows, especially with really small type, and have always attributed that to the font rendering engine. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com From kw at codebykevin.com Fri Feb 14 16:39:29 2014 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 14 Feb 2014 10:39:29 -0500 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> <52FE2E1C.60204@codebykevin.com> Message-ID: <52FE38B1.2000809@codebykevin.com> On 2/14/14, 10:21 AM, Bhaskar Chaudhary wrote: > Hi Kevin > > On Windows it looks like the following attachment. > > regards > Bhaskar Thank you. As I expected, that is simply the difference in the font rendering engines on both platforms. 8 point Times Bold is as unreadable on Word on the Mac is it is in Tk. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com From bha100710 at gmail.com Fri Feb 14 16:47:51 2014 From: bha100710 at gmail.com (Bhaskar Chaudhary) Date: Fri, 14 Feb 2014 21:17:51 +0530 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: <52FE38B1.2000809@codebykevin.com> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> <52FE2E1C.60204@codebykevin.com> <52FE38B1.2000809@codebykevin.com> Message-ID: Thanks Kevin So what do you suggest to make it render compatibly on both platforms. Do we need to remove font="Times 8 bold" from mytext as follows: mytext = Text(root, background='#101010', foreground="#D6D6D6", borderwidth=18, relief='sunken',width=16, height=5) Does that render properly on Mac. I do not have a Mac and would be a great help if you suggest changes that will make the text area occupy all the place as it does on Window. rgds Bhaskar On 2/14/14, Kevin Walzer wrote: > On 2/14/14, 10:21 AM, Bhaskar Chaudhary wrote: >> Hi Kevin >> >> On Windows it looks like the following attachment. >> >> regards >> Bhaskar > > Thank you. As I expected, that is simply the difference in the font > rendering engines on both platforms. 8 point Times Bold is as unreadable > on Word on the Mac is it is in Tk. > > --Kevin > > -- > Kevin Walzer > Code by Kevin/Mobile Code by Kevin > http://www.codebykevin.com > http://www.wtmobilesoftware.com > From kw at codebykevin.com Fri Feb 14 17:01:32 2014 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 14 Feb 2014 11:01:32 -0500 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> <52FE2E1C.60204@codebykevin.com> <52FE38B1.2000809@codebykevin.com> Message-ID: <52FE3DDC.1060600@codebykevin.com> On 2/14/14, 10:47 AM, Bhaskar Chaudhary wrote: > mytext = Text(root, background='#101010', foreground="#D6D6D6", > borderwidth=18, relief='sunken',width=16, height=5) > > Does that render properly on Mac. Yes--without specifying a font or size, Tkinter simply uses the default setting for the platform, which renders clearly. When deploying cross-platform, it is often best to specific things like font configuration and let the platform handle it--it will do the sane thing, and render the font in a way that users of that platform will expect. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com From bha100710 at gmail.com Fri Feb 14 17:16:04 2014 From: bha100710 at gmail.com (Bhaskar Chaudhary) Date: Fri, 14 Feb 2014 21:46:04 +0530 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: <2710E4F2-DBEA-4371-B464-0DE44DAB2A0B@tolisgroup.com> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> <52FE2E1C.60204@codebykevin.com> <52FE38B1.2000809@codebykevin.com> <2710E4F2-DBEA-4371-B464-0DE44DAB2A0B@tolisgroup.com> Message-ID: Thanks Tim/Kevin "What if you chafe the font size to 10 on the Mac side" Seems like this suggestion by Tim is a better way to do this. But then there will have to be different code for different platform. thanks Bhaskar On 2/14/14, Tim Jones wrote: > What if you chafe the font size to 10 on the Mac side? That always works > for me. > > Tim > > On Feb 14, 2014, at 8:47 AM, Bhaskar Chaudhary wrote: > >> Thanks Kevin >> >> So what do you suggest to make it render compatibly on both platforms. >> Do we need to remove font="Times 8 bold" from mytext as follows: >> >> mytext = Text(root, background='#101010', foreground="#D6D6D6", >> borderwidth=18, relief='sunken',width=16, height=5) >> >> Does that render properly on Mac. >> I do not have a Mac and would be a great help if you suggest changes >> that will make the text area occupy all the place as it does on >> Window. >> >> rgds >> Bhaskar >> >> On 2/14/14, Kevin Walzer wrote: >>> On 2/14/14, 10:21 AM, Bhaskar Chaudhary wrote: >>>> Hi Kevin >>>> >>>> On Windows it looks like the following attachment. >>>> >>>> regards >>>> Bhaskar >>> >>> Thank you. As I expected, that is simply the difference in the font >>> rendering engines on both platforms. 8 point Times Bold is as unreadable >>> on Word on the Mac is it is in Tk. >>> > > From klappnase at web.de Fri Feb 14 19:09:05 2014 From: klappnase at web.de (Michael Lange) Date: Fri, 14 Feb 2014 19:09:05 +0100 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: References: <20140211112545.05395d908c06df4d79da5d3d@web.de> Message-ID: <20140214190905.a1033eeb14a62556a21c8273@web.de> Hi, On Fri, 14 Feb 2014 19:50:13 +0530 Bhaskar Chaudhary wrote: > Hello > > Thanks Michael for the suggestions. > > I tried inserting root.tk.call('tk', 'scaling', '-displayof', '.', > root.winfo_fpixels('1i') / 72.0) before adding any children to the > root. with this you "change" the applications dpi setting into the current value, so it is no surprise that there is no difference ;) But before playing with the dpi, what are the dpi values on windows and OSX, is my guess that the different appearance is caused by different dpi settings correct at all? Anyway, I'd be careful with that and do it only if it absolutely necessary. If your Mac really uses a bad dpi setting then this is probably because of the monitor sending incorrect edid data; this could certainly be fixed system-wide somehow though I don't know much about OSX). > > I also tried using negative size value ("Times -8 bold") as suggested. Well, 8 pixels is really tiny if you are using a modern screen resolution, so maybe a bigger size might help ;) Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Even historians fail to learn from history -- they repeat the same mistakes. -- John Gill, "Patterns of Force", stardate 2534.7 From tjmac at tolisgroup.com Fri Feb 14 16:43:11 2014 From: tjmac at tolisgroup.com (Tim Jones) Date: Fri, 14 Feb 2014 08:43:11 -0700 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: <52FE38B1.2000809@codebykevin.com> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> <52FE2E1C.60204@codebykevin.com> <52FE38B1.2000809@codebykevin.com> Message-ID: <583CC4A2-E6D6-4A59-94B9-8D4AE40B30F1@tolisgroup.com> On Feb 14, 2014, at 8:39 AM, Kevin Walzer wrote: > On 2/14/14, 10:21 AM, Bhaskar Chaudhary wrote: >> Hi Kevin >> >> On Windows it looks like the following attachment. >> >> regards >> Bhaskar > > Thank you. As I expected, that is simply the difference in the font rendering engines on both platforms. 8 point Times Bold is as unreadable on Word on the Mac is it is in Tk. That?s it exactly. I was trying to figure out the border size differences and didn?t put the font size issue into the equation. For all of my apps (TCL and Python), I have to increase the Mac size by at lease 2 points. So when using 8 on Windows and Linux, I use 10 (and sometimes 11) on Mac. Tim From tjmac at tolisgroup.com Fri Feb 14 17:01:46 2014 From: tjmac at tolisgroup.com (Tim Jones) Date: Fri, 14 Feb 2014 09:01:46 -0700 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> <52FE2E1C.60204@codebykevin.com> <52FE38B1.2000809@codebykevin.com> Message-ID: <2710E4F2-DBEA-4371-B464-0DE44DAB2A0B@tolisgroup.com> What if you chafe the font size to 10 on the Mac side? That always works for me. Tim On Feb 14, 2014, at 8:47 AM, Bhaskar Chaudhary wrote: > Thanks Kevin > > So what do you suggest to make it render compatibly on both platforms. > Do we need to remove font="Times 8 bold" from mytext as follows: > > mytext = Text(root, background='#101010', foreground="#D6D6D6", > borderwidth=18, relief='sunken',width=16, height=5) > > Does that render properly on Mac. > I do not have a Mac and would be a great help if you suggest changes > that will make the text area occupy all the place as it does on > Window. > > rgds > Bhaskar > > On 2/14/14, Kevin Walzer wrote: >> On 2/14/14, 10:21 AM, Bhaskar Chaudhary wrote: >>> Hi Kevin >>> >>> On Windows it looks like the following attachment. >>> >>> regards >>> Bhaskar >> >> Thank you. As I expected, that is simply the difference in the font >> rendering engines on both platforms. 8 point Times Bold is as unreadable >> on Word on the Mac is it is in Tk. >> From tjmac at tolisgroup.com Fri Feb 14 17:04:12 2014 From: tjmac at tolisgroup.com (Tim Jones) Date: Fri, 14 Feb 2014 09:04:12 -0700 Subject: [Tkinter-discuss] Differences on Mac and Windows In-Reply-To: <2710E4F2-DBEA-4371-B464-0DE44DAB2A0B@tolisgroup.com> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <52FE274D.40301@codebykevin.com> <52FE2E1C.60204@codebykevin.com> <52FE38B1.2000809@codebykevin.com> <2710E4F2-DBEA-4371-B464-0DE44DAB2A0B@tolisgroup.com> Message-ID: <3E35E357-C143-4391-94E8-72CD80C9EB64@tolisgroup.com> Stupid Apple autocorrect - that should have been ?change? not ?chafe? :) Tim On Feb 14, 2014, at 9:01 AM, Tim Jones wrote: > What if you chafe the font size to 10 on the Mac side? That always works for me. > > Tim > > On Feb 14, 2014, at 8:47 AM, Bhaskar Chaudhary wrote: > >> Thanks Kevin >> >> So what do you suggest to make it render compatibly on both platforms. >> Do we need to remove font="Times 8 bold" from mytext as follows: >> >> mytext = Text(root, background='#101010', foreground="#D6D6D6", >> borderwidth=18, relief='sunken',width=16, height=5) >> >> Does that render properly on Mac. >> I do not have a Mac and would be a great help if you suggest changes >> that will make the text area occupy all the place as it does on >> Window. >> >> rgds >> Bhaskar >> >> On 2/14/14, Kevin Walzer wrote: >>> On 2/14/14, 10:21 AM, Bhaskar Chaudhary wrote: >>>> Hi Kevin >>>> >>>> On Windows it looks like the following attachment. >>>> >>>> regards >>>> Bhaskar >>> >>> Thank you. As I expected, that is simply the difference in the font >>> rendering engines on both platforms. 8 point Times Bold is as unreadable >>> on Word on the Mac is it is in Tk. >>> > From msa01 at bitflipper.ca Sun Feb 16 17:36:55 2014 From: msa01 at bitflipper.ca (Cam Farnell) Date: Sun, 16 Feb 2014 12:36:55 -0400 Subject: [Tkinter-discuss] Standard colors In-Reply-To: <20140214190905.a1033eeb14a62556a21c8273@web.de> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <20140214190905.a1033eeb14a62556a21c8273@web.de> Message-ID: <5300E927.6020702@bitflipper.ca> Hello all, Tkinter supports a bunch of standard colors, for example something like: MyButton = Button(activebackground='red') works and somebody, somewhere, knows that 'red' means "#FF0000'. What I'm trying to find out is if there is a programatic way of getting a list of the colors that are available. Anyone know this offhand? A quick look through Tkinter.py was not overly illuminating. I'm using Python 2.7.2 and whatever version of tk/tcl came with Ubuntu 12.04 LTS. Thanks Cam Farnell From bob at mellowood.ca Sun Feb 16 18:09:01 2014 From: bob at mellowood.ca (Bob van der Poel) Date: Sun, 16 Feb 2014 10:09:01 -0700 Subject: [Tkinter-discuss] Standard colors In-Reply-To: <5300E927.6020702@bitflipper.ca> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <20140214190905.a1033eeb14a62556a21c8273@web.de> <5300E927.6020702@bitflipper.ca> Message-ID: Try the file /etc/X11/rgb.txt On Sun, Feb 16, 2014 at 9:36 AM, Cam Farnell wrote: > Hello all, > > Tkinter supports a bunch of standard colors, for example something like: > > MyButton = Button(activebackground='red') > > works and somebody, somewhere, knows that 'red' means "#FF0000'. > > What I'm trying to find out is if there is a programatic way of getting a > list of the colors that are available. Anyone know this offhand? A quick > look through Tkinter.py was not overly illuminating. I'm using Python 2.7.2 > and whatever version of tk/tcl came with Ubuntu 12.04 LTS. > > Thanks > > Cam Farnell > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss -- **** Listen to my FREE CD at http://www.mellowood.ca/music/cedars **** Bob van der Poel ** Wynndel, British Columbia, CANADA ** EMAIL: bob at mellowood.ca WWW: http://www.mellowood.ca From emilianogavilan at gmail.com Sun Feb 16 18:33:04 2014 From: emilianogavilan at gmail.com (Emiliano Gavilan) Date: Sun, 16 Feb 2014 14:33:04 -0300 Subject: [Tkinter-discuss] Standard colors In-Reply-To: <5300E927.6020702@bitflipper.ca> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <20140214190905.a1033eeb14a62556a21c8273@web.de> <5300E927.6020702@bitflipper.ca> Message-ID: El 16/02/2014 14:03, "Cam Farnell" escribi?: > > Hello all, > > Tkinter supports a bunch of standard colors, for example something like: > > MyButton = Button(activebackground='red') > > works and somebody, somewhere, knows that 'red' means "#FF0000'. > > What I'm trying to find out is if there is a programatic way of getting a list of the colors that are available. Anyone know this offhand? A quick look through Tkinter.py was not overly illuminating. I'm using Python 2.7.2 and whatever version of tk/tcl came with Ubuntu 12.04 LTS. They are documented. http://www.tcl.tk/man/tcl8.6/TkCmd/colors.htm Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From msa01 at bitflipper.ca Mon Feb 17 18:26:24 2014 From: msa01 at bitflipper.ca (Cam Farnell) Date: Mon, 17 Feb 2014 13:26:24 -0400 Subject: [Tkinter-discuss] Standard colors In-Reply-To: References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <20140214190905.a1033eeb14a62556a21c8273@web.de> <5300E927.6020702@bitflipper.ca> Message-ID: <53024640.3000300@bitflipper.ca> Hi Emiliano, Thanks for your reply. Yes they are documented, but per my post what I am looking for is a PROGRAMATIC way that my application can get the list of colors, sort of like how in Python you can use dir(__builtin__) to get a list of all the built-in functions. Cheers Cam Farnell On 14-02-16 01:33 PM, Emiliano Gavilan wrote: > > El 16/02/2014 14:03, "Cam Farnell" > escribi?: > > > > Hello all, > > > > Tkinter supports a bunch of standard colors, for example something like: > > > > MyButton = Button(activebackground='red') > > > > works and somebody, somewhere, knows that 'red' means "#FF0000'. > > > > What I'm trying to find out is if there is a programatic way of getting a list of the colors that are available. Anyone know this offhand? A quick look through Tkinter.py was not overly illuminating. I'm using Python 2.7.2 and whatever version of tk/tcl came with Ubuntu 12.04 LTS. > > They are documented. > http://www.tcl.tk/man/tcl8.6/TkCmd/colors.htm > > Regards > From motus at laposte.net Mon Feb 17 14:29:09 2014 From: motus at laposte.net (tarball69) Date: Mon, 17 Feb 2014 05:29:09 -0800 (PST) Subject: [Tkinter-discuss] tkRAD - XML widget building for Tkinter Message-ID: <1392643749304-5047808.post@n6.nabble.com> Hello there, Would it be possible for me to aknowledge good people Tkinter has now a complete *XML widget building* library named *tkRAD*? Wiki URL: https://github.com/tarball69/tkRAD/wiki Project GitHub: https://github.com/tarball69/tkRAD Project downloads: https://github.com/tarball69/tkRAD/releases I've worked hard for this wiki wiki documentation, so please, read documentation before asking thousands of questions. Thanks a lot. -- View this message in context: http://python.6.x6.nabble.com/tkRAD-XML-widget-building-for-Tkinter-tp5047808.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From emilianogavilan at gmail.com Tue Feb 18 01:47:24 2014 From: emilianogavilan at gmail.com (Emiliano Gavilan) Date: Mon, 17 Feb 2014 21:47:24 -0300 Subject: [Tkinter-discuss] Standard colors In-Reply-To: <53024640.3000300@bitflipper.ca> References: <20140211112545.05395d908c06df4d79da5d3d@web.de> <20140214190905.a1033eeb14a62556a21c8273@web.de> <5300E927.6020702@bitflipper.ca> <53024640.3000300@bitflipper.ca> Message-ID: El 17/02/2014 14:26, "Cam Farnell" escribi?: > > Hi Emiliano, > > Thanks for your reply. Yes they are documented, but per my post what I am looking for is a PROGRAMATIC way that my application can get the list of colors, sort of like how in Python you can use dir(__builtin__) to get a list of all the built-in functions. Sadly no, they are not introspectable -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob at passcal.nmt.edu Fri Feb 28 16:33:45 2014 From: bob at passcal.nmt.edu (Bob Greschke) Date: Fri, 28 Feb 2014 08:33:45 -0700 Subject: [Tkinter-discuss] Tracebacks Message-ID: <3766A980-82BA-4AA0-9F1F-5822C79AF1E1@passcal.nmt.edu> This isn't quite a Tkinter thing, but why can't some clever person (I couldn't do it) make it possible for you to put something like this #! /usr/bin/python -t "/home/me/error.txt",stderr at the beginning of a Python program and have the interpreter direct all of the traceback messages to the file error.txt, and stderr? I've got a 43,000 line Tkinter/via X11 program and stupid users that won't tell me when it crashes -- if they even notice. Right now we create an xterm on their computer then execute and ssh to the server where the program resides. The errors come out in that xterm, but if the users quit they are gone. It seems like the interpreter would be the smartest place to put something like this since it controls everything, and so you don't have to try and guess in which section of code you misspelled a variable name and put it in a try-except. Isn't this reasonable? There are all kinds of questions about this problem, but never any really good solutions. I like this one. :) I just wouldn't have any idea how to do it, or if it's even possible. Bob From camfarnell at bitflipper.ca Fri Feb 28 17:35:38 2014 From: camfarnell at bitflipper.ca (Cam) Date: Fri, 28 Feb 2014 12:35:38 -0400 Subject: [Tkinter-discuss] Tracebacks In-Reply-To: <3766A980-82BA-4AA0-9F1F-5822C79AF1E1@passcal.nmt.edu> References: <3766A980-82BA-4AA0-9F1F-5822C79AF1E1@passcal.nmt.edu> Message-ID: <5310BADA.6020301@bitflipper.ca> I'm probably not understanding the question. How does what you propose differ from wrapping your whole application in a try/except so that any uncaught exceptions result in information being written to error.txt? Cam On 14-02-28 11:33 AM, Bob Greschke wrote: > This isn't quite a Tkinter thing, but why can't some clever person (I couldn't do it) make it possible for you to put something like this > > #! /usr/bin/python -t "/home/me/error.txt",stderr > > at the beginning of a Python program and have the interpreter direct all of the traceback messages to the file error.txt, and stderr? I've got a 43,000 line Tkinter/via X11 program and stupid users that won't tell me when it crashes -- if they even notice. Right now we create an xterm on their computer then execute and ssh to the server where the program resides. The errors come out in that xterm, but if the users quit they are gone. It seems like the interpreter would be the smartest place to put something like this since it controls everything, and so you don't have to try and guess in which section of code you misspelled a variable name and put it in a try-except. > > Isn't this reasonable? There are all kinds of questions about this problem, but never any really good solutions. I like this one. :) I just wouldn't have any idea how to do it, or if it's even possible. > > Bob > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > From bob at passcal.nmt.edu Fri Feb 28 20:09:57 2014 From: bob at passcal.nmt.edu (Bob Greschke) Date: Fri, 28 Feb 2014 12:09:57 -0700 Subject: [Tkinter-discuss] Tracebacks In-Reply-To: <6E01C189-AA5E-4F6F-A303-2C635608ADBB@passcal.nmt.edu> References: <3766A980-82BA-4AA0-9F1F-5822C79AF1E1@passcal.nmt.edu> <5310BADA.6020301@bitflipper.ca> <6E01C189-AA5E-4F6F-A303-2C635608ADBB@passcal.nmt.edu> Message-ID: <03EB34F3-F69D-4A29-BBAB-EC1A27AD4229@passcal.nmt.edu> On 2014-02-28, at 12:08, Bob Greschke wrote: It doesn't, this would just be more elegant, right? It just seems funny that the interpreter doesn't help out this one little bit more. I'd even say why not just have a Python command that you put in your program (not on the #! line) that tells the interpreter what to globally do with traceback error messages, especially since these things can happen and the program just keep on running. "set stdtraceback to file X". For a non-threaded/non-GUI program it might not be that big of a deal -- it hits a bug and stops -- but for a big Tkinter program you could just keep selecting menus and buttons and never know there was a problem somewhere. Yes there is the logging and the traceback modules and all of that, but that's a lot of duplication of labor. The interpreter already knows everything, you just can't tell it what to do with the messages to make it helpful. It seems like a small oversight to me. On 2014-02-28, at 09:35, Cam wrote: > I'm probably not understanding the question. How does what you propose differ from wrapping your whole application in a try/except so that any uncaught exceptions result in information being written to error.txt? > > Cam > > On 14-02-28 11:33 AM, Bob Greschke wrote: >> This isn't quite a Tkinter thing, but why can't some clever person (I couldn't do it) make it possible for you to put something like this >> >> #! /usr/bin/python -t "/home/me/error.txt",stderr >> >> at the beginning of a Python program and have the interpreter direct all of the traceback messages to the file error.txt, and stderr? I've got a 43,000 line Tkinter/via X11 program and stupid users that won't tell me when it crashes -- if they even notice. Right now we create an xterm on their computer then execute and ssh to the server where the program resides. The errors come out in that xterm, but if the users quit they are gone. It seems like the interpreter would be the smartest place to put something like this since it controls everything, and so you don't have to try and guess in which section of code you misspelled a variable name and put it in a try-except. >> >> Isn't this reasonable? There are all kinds of questions about this problem, but never any really good solutions. I like this one. :) I just wouldn't have any idea how to do it, or if it's even possible. >> >> Bob >> >> _______________________________________________ >> Tkinter-discuss mailing list >> Tkinter-discuss at python.org >> https://mail.python.org/mailman/listinfo/tkinter-discuss >> > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss >