From magni at inrim.it Wed Jul 6 10:10:25 2011 From: magni at inrim.it (alexxxm) Date: Wed, 6 Jul 2011 01:10:25 -0700 (PDT) Subject: [Tkinter-discuss] tkinter - hopefully forecasting a very long life... Message-ID: <32003082.post@talk.nabble.com> Hi people, I'm midway in writing a simple wiki, in python+tkinter (thanks also to your help, http://old.nabble.com/newbie-request-for-help-td31791699.html). Simple for the typical developer maybe, but for me is long work, and once you start optimizing stuff, it can become a very large project. And suddenly I become prey of doubts: did I chose the right language? >From the POV of being the easiest method I found for writing a program and its GUI, I'm really happy with it. But I intend to use this wiki for many years to come... will tkinter stay with us for so long? What do you think about tkinter's long-term prospectives? thanks for your help! alessandro -- View this message in context: http://old.nabble.com/tkinter---hopefully-forecasting-a-very-long-life...-tp32003082p32003082.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From kevin.buchs at gmail.com Wed Jul 6 14:22:22 2011 From: kevin.buchs at gmail.com (Kevin Buchs) Date: Wed, 6 Jul 2011 07:22:22 -0500 Subject: [Tkinter-discuss] tkinter - hopefully forecasting a very long life... In-Reply-To: <32003082.post@talk.nabble.com> References: <32003082.post@talk.nabble.com> Message-ID: Alesandro, Tk has been around for probably more than 20 years. It is established in many applications. I would think that tkinter is well established. However, you have to consider that computer science is an ever-changing field. Some things that were well established 20 years ago are gone now. And, 40 years ago: ever used punched cards, reel-to-reel tape, Lisp, COBOL or Fortran? Things will change. If you really want insurance against change, grab all the tools you use in source form, to the extent they are available and maintain your current environment as long as your hardware holds out. You can get Linux, compilers, Tk, Python and all the Python packages you use in your Wiki project and keep those going. When I first started to read your post, I assumed that you were developing the wiki as a learning exercise. Then when I got to your question about long term availability I realized you want a production tool. So, I just have to ask now, why not use what has been developed by others. HTML browsers are an ideal tool for navigating Wikis. I am not sure of what role Tk plays in your project, but developing a full-browser capability seems like a lot of work. There are plenty of open-source wikis available. I think there are probably wikis available written in Python. They need not provide any graphical interface to work. You can even buy a production, enterprise class commercial wiki from Atlassian for $10. Kevin Buchs On Wed, Jul 6, 2011 at 3:10 AM, alexxxm wrote: > What do you think about tkinter's long-term prospectives? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From waynejwerner at gmail.com Wed Jul 6 14:25:23 2011 From: waynejwerner at gmail.com (Wayne Werner) Date: Wed, 6 Jul 2011 07:25:23 -0500 Subject: [Tkinter-discuss] tkinter - hopefully forecasting a very long life... In-Reply-To: <32003082.post@talk.nabble.com> References: <32003082.post@talk.nabble.com> Message-ID: On Wed, Jul 6, 2011 at 3:10 AM, alexxxm wrote: > > Hi people, > I'm midway in writing a simple wiki, in python+tkinter (thanks also to your > help, http://old.nabble.com/newbie-request-for-help-td31791699.html). > Simple for the typical developer maybe, but for me is long work, and once > you start optimizing stuff, it can become a very large project. > And suddenly I become prey of doubts: did I chose the right language? > >From the POV of being the easiest method I found for writing a program and > its GUI, I'm really happy with it. > But I intend to use this wiki for many years to come... will tkinter stay > with us for so long? What do you think about tkinter's long-term > prospectives? > Tkinter has been around for a *long* time, and from what I gather is still under active development. I strongly suspect that, barring some worldwide disaster, or the death of Python, Tkinter will probably be around and plenty strong for many more years. Though if you're worried about how your GUI is handling things, you might start looking at some design patterns, such as the model-view-presenter ( http://en.wikipedia.org/wiki/Model-view-presenter) that help you separate the business logic of your program from the view of your program. Theoretically that means that if you did it right, you could change your front end from Tkinter to HTML to GTK to a Braille output with just a few keystrokes (assuming you had the front end setup correctly!). Good design is one of those hard things in programming - and usually there's no right answer, though there are definitely many *wrong* answers ;) Good luck! -------------- next part -------------- An HTML attachment was scrubbed... URL: From magni at inrim.it Thu Jul 7 09:11:53 2011 From: magni at inrim.it (alexxxm) Date: Thu, 7 Jul 2011 00:11:53 -0700 (PDT) Subject: [Tkinter-discuss] tkinter - hopefully forecasting a very long life... In-Reply-To: References: <32003082.post@talk.nabble.com> Message-ID: <32010795.post@talk.nabble.com> Hi Kevin, thank you for your reply. I would not call it a production tool, maybe, since it will be used just by me: I will upload it as free software of course, but I already know that it's not something people are much interested into: a wiki-based organization of the whole filesystem - if you're interested read a bit about it in http://www.inrim.it/~magni/zimDMS.htm . I would not know how to manage my hundreds of folders, hierarchies, projects, thoughts ... without it: since I started using it it has been a real godsend. At the moment, I have it perfectly working, running around the Zim wiki http://www.zim-wiki.org/ My problem: I can trace the oldest data/thoughts in my disk to +/- 20 years ago (old C64 programs!), and I imagine I will be around for much more time :-) so I want to have an "infobase system" that will span decades, not requiring restarting from scratch if a wiki or a toolkit isnt supported anymore. This of course implies a rigorous separation of the data from the GUI (as Wayne correctly said!) and I'm already doing that... but since I'm not a GUI programmer, I wanted something accessible, and at the same time something with a looong future ahead! alessandro Kevin Buchs-2 wrote: > > Alesandro, > > Tk has been around for probably more than 20 years. It is established in > many applications. I would think that tkinter is well established. > However, > you have to consider that computer science is an ever-changing field. Some > things that were well established 20 years ago are gone now. And, 40 years > ago: ever used punched cards, reel-to-reel tape, Lisp, COBOL or Fortran? > Things will change. If you really want insurance against change, grab all > the tools you use in source form, to the extent they are available and > maintain your current environment as long as your hardware holds out. You > can get Linux, compilers, Tk, Python and all the Python packages you use > in > your Wiki project and keep those going. > > When I first started to read your post, I assumed that you were developing > the wiki as a learning exercise. Then when I got to your question about > long > term availability I realized you want a production tool. So, I just have > to > ask now, why not use what has been developed by others. HTML browsers are > an > ideal tool for navigating Wikis. I am not sure of what role Tk plays in > your > project, but developing a full-browser capability seems like a lot of > work. > There are plenty of open-source wikis available. I think there are > probably > wikis available written in Python. They need not provide any graphical > interface to work. You can even buy a production, enterprise class > commercial wiki from Atlassian for $10. > > Kevin Buchs > > On Wed, Jul 6, 2011 at 3:10 AM, alexxxm wrote: > >> What do you think about tkinter's long-term prospectives? >> >> > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > -- View this message in context: http://old.nabble.com/tkinter---hopefully-forecasting-a-very-long-life...-tp32003082p32010795.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From kevin.buchs at gmail.com Thu Jul 7 14:40:59 2011 From: kevin.buchs at gmail.com (Kevin Buchs) Date: Thu, 7 Jul 2011 07:40:59 -0500 Subject: [Tkinter-discuss] tkinter - hopefully forecasting a very long life... In-Reply-To: <32010795.post@talk.nabble.com> References: <32003082.post@talk.nabble.com> <32010795.post@talk.nabble.com> Message-ID: Alessandro, It sounds like you have a good plan. If I wanted to future-proof a project like that, I would probably implement it as an HTML5/CSS/javascript generator and use a browser to navigate it. That would put the future-proof requirement above any desire to learn GUI programming. Almost any GUI implementation today may be outdated in 20 years. 20 years ago I was writing C-code talking to Xlib for GUI development. Today the world is very different. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cameron at phaseit.net Thu Jul 7 15:18:07 2011 From: Cameron at phaseit.net (Cameron Laird) Date: Thu, 7 Jul 2011 13:18:07 +0000 Subject: [Tkinter-discuss] tkinter - hopefully forecasting a very long life... In-Reply-To: References: <32003082.post@talk.nabble.com> <32010795.post@talk.nabble.com> Message-ID: <20110707131807.GC11679@lairds.us> On Thu, Jul 07, 2011 at 07:40:59AM -0500, Kevin Buchs wrote: . . . > It sounds like you have a good plan. If I wanted to future-proof a project > like that, I would probably implement it as an HTML5/CSS/javascript > generator and use a browser to navigate it. That would put the future-proof > requirement above any desire to learn GUI programming. Almost any GUI > implementation today may be outdated in 20 years. 20 years ago I was writing > C-code talking to Xlib for GUI development. Today the world is very > different. . . . I'm as fond of Tkinter as anyone, and continue to work in it; HTML5 is the way of the future, though. Cameron Laird +1 281 996 8546 FAX http://phaseit.net/claird/misc.writing/publications.html http://twitter.com/Phaseit From raycores at gmail.com Tue Jul 12 21:34:21 2011 From: raycores at gmail.com (Lynn Oliver) Date: Tue, 12 Jul 2011 12:34:21 -0700 Subject: [Tkinter-discuss] tkFileDialog.askdirectory() not resizable in Windows Message-ID: Using Python versions 2.6.6 or 2.7.1, the tkFileDialog.askdirectory() dialog box is resizable in OS X but not on WinXP or Win7. tkFileDialog.askopenfilename() is resizable in both environments. Is there a way to work around this? Lynn From georges.arsouze at gmail.com Fri Jul 15 11:37:34 2011 From: georges.arsouze at gmail.com (Georges Arsouze) Date: Fri, 15 Jul 2011 11:37:34 +0200 Subject: [Tkinter-discuss] Python3.1 mac os Message-ID: Hi sorry for my poor english 1) I'm working on mac os snow leopard 10.6 and python 3.1 I want to use the ttk and tix widgets I have an error message : require tile On the mailing list i see I think that it is probably much easier to install the *tile* extension for Tk-8.4 than upgrading Tcl/Tk and *Python* to Tk-8.5 . You can look for *tile* packages here: http://sourceforge.net/projects/tktable/files/ and once *tile* is installed you can use ttk just as if you had Tk-8.5 . I hope this helps Michael What can i do for installing tile ? 2)I try pyhon 3.2 from activate state Tcl/tk is in version 5 but idle crash can you help me ? I'm beginning with python regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From charras at me.com Fri Jul 15 13:10:37 2011 From: charras at me.com (Guido Carballo-Guerrero) Date: Fri, 15 Jul 2011 08:10:37 -0300 Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 89, Issue 5 In-Reply-To: References: Message-ID: <97F9C28A-ECE0-4C50-9E26-1DCDEBDDDC96@me.com> George; I haven't install python 3.1, and as far as I knew, 3.1 was a little bit different than 2.7 with respect to ttk, or maybe is python 3.2. By the way, why you're installing 3.1 instead of 3.2? You know, 3.2 is the latest version, maybe installing this version is easier, but any way, this is what I did to make 2.7 work with ttk: 1. download the source code and not the installer package 2. uncompress the file--the computer does this automatically for you 3. go where the package was uncompress using the terminal--oper a terminal, and type: ls ~/Downloads/python..., instead of the points write the name of the folder that was created when you uncompress the file you download 4. type the following commands one at a time and press enter for each command: ./configure --enable-universalsdk --enable-framework make make frameworkinstall After this Python should be already install in your computer, and you should be able to use ttk. Remember that to import ttk on version 3.x you should do: import tkinter.ttk I'm in the process of writing a tutorial of Python, maybe it can help you, this is the link: http://web.me.com/charras/Python/Welcome.html Regards! Guido On Jul 15, 2011, at 7:00 AM, tkinter-discuss-request at python.org wrote: > Send Tkinter-discuss mailing list submissions to > tkinter-discuss at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/tkinter-discuss > or, via email, send a message with subject or body 'help' to > tkinter-discuss-request at python.org > > You can reach the person managing the list at > tkinter-discuss-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tkinter-discuss digest..." > Today's Topics: > > 1. Python3.1 mac os (Georges Arsouze) > > From: Georges Arsouze > Date: July 15, 2011 6:37:34 AM GMT-03:00 > To: tkinter-discuss at python.org > Subject: [Tkinter-discuss] Python3.1 mac os > > > Hi > sorry for my poor english > 1) I'm working on mac os snow leopard 10.6 and python 3.1 > I want to use the ttk and tix widgets > > I have an error message : require tile > > On the mailing list i see > > I think that it is probably much easier to install the tile extension > for Tk-8.4 than upgrading Tcl/Tk and Python to Tk-8.5 . You can look > for tile packages here: > http://sourceforge.net/projects/tktable/files/ > and once tile is installed you can use ttk just as if you had Tk-8.5 . > > I hope this helps > > Michael > > What can i do for installing tile ? > > 2)I try pyhon 3.2 from activate state > Tcl/tk is in version 5 > but idle crash > > can you help me ? I'm beginning with python > > regards > > > > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: From klappnase at web.de Fri Jul 15 19:36:26 2011 From: klappnase at web.de (Michael Lange) Date: Fri, 15 Jul 2011 19:36:26 +0200 Subject: [Tkinter-discuss] tkFileDialog.askdirectory() not resizable in Windows In-Reply-To: References: Message-ID: <20110715193626.eb007814.klappnase@web.de> Hi Lynn, Thus spoketh Lynn Oliver unto us on Tue, 12 Jul 2011 12:34:21 -0700: > Using Python versions 2.6.6 or 2.7.1, the tkFileDialog.askdirectory() > dialog box is resizable in OS X but not on WinXP or Win7. > tkFileDialog.askopenfilename() is resizable in both environments. > > Is there a way to work around this? > I think on windows tk uses native dialogs, so I don't think there is a way to change this. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. A father doesn't destroy his children. -- Lt. Carolyn Palamas, "Who Mourns for Adonais?", stardate 3468.1. From raycores at gmail.com Fri Jul 15 19:53:49 2011 From: raycores at gmail.com (Lynn Oliver) Date: Fri, 15 Jul 2011 10:53:49 -0700 Subject: [Tkinter-discuss] tkFileDialog.askdirectory() not resizable in Windows In-Reply-To: <20110715193626.eb007814.klappnase@web.de> References: <20110715193626.eb007814.klappnase@web.de> Message-ID: <77DB4955-FA6B-4200-BAE0-3D423F4AF19D@gmail.com> Hi Michael, On windows if you set BIF_USENEWUI (0x0040) when calling SHBrowseForFolder() it will use the resizable dialog box. -Lynn On Jul 15, 2011, at 10:36 AM, Michael Lange wrote: > Hi Lynn, > > Thus spoketh Lynn Oliver > unto us on Tue, 12 Jul 2011 12:34:21 -0700: > >> Using Python versions 2.6.6 or 2.7.1, the tkFileDialog.askdirectory() >> dialog box is resizable in OS X but not on WinXP or Win7. >> tkFileDialog.askopenfilename() is resizable in both environments. >> >> Is there a way to work around this? >> > > I think on windows tk uses native dialogs, so I don't think there is a > way to change this. > > Regards > > Michael > > > > .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. > > A father doesn't destroy his children. > -- Lt. Carolyn Palamas, "Who Mourns for Adonais?", > stardate 3468.1. > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss From klappnase at web.de Fri Jul 15 20:33:01 2011 From: klappnase at web.de (Michael Lange) Date: Fri, 15 Jul 2011 20:33:01 +0200 Subject: [Tkinter-discuss] tkFileDialog.askdirectory() not resizable in Windows In-Reply-To: <77DB4955-FA6B-4200-BAE0-3D423F4AF19D@gmail.com> References: <20110715193626.eb007814.klappnase@web.de> <77DB4955-FA6B-4200-BAE0-3D423F4AF19D@gmail.com> Message-ID: <20110715203301.30fea3a5.klappnase@web.de> Hi Lynn, Thus spoketh Lynn Oliver unto us on Fri, 15 Jul 2011 10:53:49 -0700: > Hi Michael, > > On windows if you set BIF_USENEWUI (0x0040) when calling > SHBrowseForFolder() it will use the resizable dialog box. Oh, I am afraid I don't know anything about this :( Seems like it is something tk doesn't do by default though. A quick web search showed up this result: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/dbbbea1cb1ebb693/660b4ea4b471dce0?lnk=gst&q=BIF_USENEWUI+#660b4ea4b471dce0 So it seems like this is something that must be compiled into tcl / tk . >From reading this thread the good news seem to be that latest tk releases seem to already do this, so if you can get a recent tcl/tk working with your python install there may be hope for you ;) Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. There's a way out of any cage. -- Captain Christopher Pike, "The Menagerie" ("The Cage"), stardate unknown. From raycores at gmail.com Fri Jul 15 22:24:14 2011 From: raycores at gmail.com (Lynn Oliver) Date: Fri, 15 Jul 2011 13:24:14 -0700 Subject: [Tkinter-discuss] tkFileDialog.askdirectory() not resizable in Windows In-Reply-To: <20110715203301.30fea3a5.klappnase@web.de> References: <20110715193626.eb007814.klappnase@web.de> <77DB4955-FA6B-4200-BAE0-3D423F4AF19D@gmail.com> <20110715203301.30fea3a5.klappnase@web.de> Message-ID: <19BD8119-DE0F-49C9-978D-670F96DC0C65@gmail.com> Thanks for finding that thread. Reading the release notes, it seems that this change went into 8.5.8, but even building with 8.5.10 I don't see the change on either WinXP or Win7. Lynn > Hi Lynn, > > Thus spoketh Lynn Oliver > unto us on Fri, 15 Jul 2011 10:53:49 -0700: > >> Hi Michael, >> >> On windows if you set BIF_USENEWUI (0x0040) when calling >> SHBrowseForFolder() it will use the resizable dialog box. > > Oh, I am afraid I don't know anything about this :( > Seems like it is something tk doesn't do by default though. > A quick web search showed up this result: > > http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/dbbbea1cb1ebb693/660b4ea4b471dce0?lnk=gst&q=BIF_USENEWUI+#660b4ea4b471dce0 > > So it seems like this is something that must be compiled into tcl / tk . > >> From reading this thread the good news seem to be that latest tk releases > seem to already do this, so if you can get a recent tcl/tk working with > your python install there may be hope for you ;) > > Regards > > Michael > > > > .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. > > There's a way out of any cage. > -- Captain Christopher Pike, "The Menagerie" ("The Cage"), > stardate unknown. > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss From nad at acm.org Sat Jul 16 00:01:03 2011 From: nad at acm.org (Ned Deily) Date: Fri, 15 Jul 2011 15:01:03 -0700 Subject: [Tkinter-discuss] Python3.1 mac os References: Message-ID: In article , Georges Arsouze wrote: > Hi > sorry for my poor english > 1) I'm working on mac os snow leopard 10.6 and python 3.1 > I want to use the ttk and tix widgets > > I have an error message : require tile Apparently Tix is not shipped by default with ActiveState Tcl because Tix is considered out-of-date. However, it appears you can install a version (for Tk 8.4 at least, which the python.org binary installers for Python 3.1 uses) via the ActiveState teacup package manager: sudo /usr/local/bin/teacup install Tix Keep in mind that Python 3.1 has been superseded by Python 3.2 (3.2.1 is current). I f you are just starting with Python, you should consider using it: http://www.python.org/download/ http://www.python.org/download/mac/tcltk/ http://groups.google.com/group/comp.lang.python/browse_thread/thread/878b 8a1d9e6d92ce/6f257a1c60ab50f2 -- Ned Deily, nad at acm.org From nad at acm.org Sat Jul 16 00:05:02 2011 From: nad at acm.org (Ned Deily) Date: Fri, 15 Jul 2011 15:05:02 -0700 Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 89, Issue 5 References: <97F9C28A-ECE0-4C50-9E26-1DCDEBDDDC96@me.com> Message-ID: In article <97F9C28A-ECE0-4C50-9E26-1DCDEBDDDC96 at me.com>, Guido Carballo-Guerrero wrote: > I haven't install python 3.1, and as far as I knew, 3.1 was a little bit > different than 2.7 with respect to ttk, or maybe is python 3.2. By the way, > why you're installing 3.1 instead of 3.2? You know, 3.2 is the latest > version, maybe installing this version is easier, but any way, this is what I > did to make 2.7 work with ttk: > > 1. download the source code and not the installer package > 2. uncompress the file--the computer does this automatically for you > 3. go where the package was uncompress using the terminal--oper a terminal, > and type: ls ~/Downloads/python..., instead of the points write the name of > the folder that was created when you uncompress the file you download > 4. type the following commands one at a time and press enter for each > command: > > ./configure --enable-universalsdk --enable-framework > make > make frameworkinstall > > After this Python should be already install in your computer, and you should > be able to use ttk. Remember that to import ttk on version 3.x you should do: > import tkinter.ttk There is no need to build Python from source to use ttk on current Mac OS X systems. Just download the python.org 64-/32- bit installers for Python 2.7 or 3.2 and ActiveState Tcl/Tk 8.5. More details here: http://www.python.org/download/mac/tcltk/ -- Ned Deily, nad at acm.org From klappnase at web.de Sat Jul 16 12:20:20 2011 From: klappnase at web.de (Michael Lange) Date: Sat, 16 Jul 2011 12:20:20 +0200 Subject: [Tkinter-discuss] tkFileDialog.askdirectory() not resizable in Windows In-Reply-To: <19BD8119-DE0F-49C9-978D-670F96DC0C65@gmail.com> References: <20110715193626.eb007814.klappnase@web.de> <77DB4955-FA6B-4200-BAE0-3D423F4AF19D@gmail.com> <20110715203301.30fea3a5.klappnase@web.de> <19BD8119-DE0F-49C9-978D-670F96DC0C65@gmail.com> Message-ID: <20110716122020.a9e1a10c.klappnase@web.de> Hi Lynn, Thus spoketh Lynn Oliver unto us on Fri, 15 Jul 2011 13:24:14 -0700: > Thanks for finding that thread. Reading the release notes, it seems > that this change went into 8.5.8, but even building with 8.5.10 I don't > see the change on either WinXP or Win7. Ok, so I did some further investigation ;) The patch as suggested in the comp.lang.tcl thread suggests to change the lines bInfo.ulFlags = BIF_EDITBOX | BIF_STATUSTEXT | BIF_RETURNFSANCESTORS | BIF_VALIDATE; in tkWinDialog.c into bInfo.ulFlags = BIF_EDITBOX | BIF_STATUSTEXT | BIF_RETURNFSANCESTORS | BIF_VALIDATE | BIF_USENEWUI; Now I tried and downloaded the sources of both tk-8.5.6 and tk-8.5.10 and compared the relevant sections of tkWinDialog.c . In 8.5.6 I found, as expeceted, the first version of these lines. Now the change they made in 8.5.10 actually looks like: bInfo.ulFlags = BIF_EDITBOX | BIF_STATUSTEXT | BIF_RETURNFSANCESTORS | BIF_VALIDATE | BIF_NEWDIALOGSTYLE; So I guess that maybe winxp needs BIF_USENEWUI instead, just as you and Jeff on c.l.t. suggested? I don't know anything about this, so I can just guess that BIF_NEWDIALOGSTYLE might work for win7 but not for winxp ? So I suggest that, if possible, you might change this line in the sources, recompile tk and in case it works file a bug report to the tk developers. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Humans do claim a great deal for that particular emotion (love). -- Spock, "The Lights of Zetar", stardate 5725.6 From raycores at gmail.com Sun Jul 17 23:50:02 2011 From: raycores at gmail.com (Lynn Oliver) Date: Sun, 17 Jul 2011 14:50:02 -0700 Subject: [Tkinter-discuss] tkFileDialog.askdirectory() not resizable in Windows In-Reply-To: <498B80B0-30CF-4D65-B011-FA07F28F5A57@gmail.com> References: <498B80B0-30CF-4D65-B011-FA07F28F5A57@gmail.com> Message-ID: t turns out that the problem was an outdated version of init.tcl that was (still?) present after installing ActivePython 2.7.2.5. After replacing that file with the one from the 8.5.9 source it is now working properly. Lynn On Jul 12, 2011, at 12:34 PM, Lynn Oliver wrote: > Using Python versions 2.6.6 or 2.7.1, the tkFileDialog.askdirectory() dialog box is resizable in OS X but not on WinXP or Win7. tkFileDialog.askopenfilename() is resizable in both environments. > > Is there a way to From kalman_g at msn.com Mon Jul 18 05:34:22 2011 From: kalman_g at msn.com (GKalman) Date: Sun, 17 Jul 2011 20:34:22 -0700 (PDT) Subject: [Tkinter-discuss] A Button command callback question... Message-ID: <32080551.post@talk.nabble.com> The following code fragment works OK. Question: why? #====================================== from Tkinter import * root=Tk() lbl=Label(root,text='1').pack() def doIt(): lbl.config(bg="yellow") btn=Button(root,text="do", bg="cyan",command=doIt).pack() root.mainloop() #======================================= My question is: how is the instance lbl.config(...) recognized in the doIt callback fn when called from the main w/o an argument referencing lbl? -- View this message in context: http://old.nabble.com/A-Button-command-callback-question...-tp32080551p32080551.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalman_g at msn.com Mon Jul 18 05:34:58 2011 From: kalman_g at msn.com (GKalman) Date: Sun, 17 Jul 2011 20:34:58 -0700 (PDT) Subject: [Tkinter-discuss] A Button command callback question... Message-ID: <32080554.post@talk.nabble.com> The following code fragment works OK. Question: why? #====================================== from Tkinter import * root=Tk() lbl=Label(root,text='1').pack() def doIt(): lbl.config(bg="yellow") btn=Button(root,text="do", bg="cyan",command=doIt).pack() root.mainloop() #======================================= My question is: how is the instance lbl.config(...) recognized in the doIt callback fn when called from the main w/o an argument referencing lbl? -- View this message in context: http://old.nabble.com/A-Button-command-callback-question...-tp32080554p32080554.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From klappnase at web.de Mon Jul 18 13:53:42 2011 From: klappnase at web.de (Michael Lange) Date: Mon, 18 Jul 2011 13:53:42 +0200 Subject: [Tkinter-discuss] A Button command callback question... In-Reply-To: <32080551.post@talk.nabble.com> References: <32080551.post@talk.nabble.com> Message-ID: <20110718135342.7e283e47.klappnase@web.de> Hi, Thus spoketh GKalman unto us on Sun, 17 Jul 2011 20:34:22 -0700 (PDT): > > The following code fragment works OK. Question: why? > #====================================== > from Tkinter import * > root=Tk() > > lbl=Label(root,text='1').pack() > > def doIt(): > lbl.config(bg="yellow") > > btn=Button(root,text="do", bg="cyan",command=doIt).pack() > > root.mainloop() > #======================================= > My question is: how is the instance lbl.config(...) recognized in the > doIt callback fn when called from the main w/o an argument referencing > lbl? When I run this example and hit the button I get: Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ return self.func(*args) File "test6.py", line 8, in doIt lbl.config(bg="yellow") AttributeError: 'NoneType' object has no attribute 'config' as one would expect. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. "What happened to the crewman?" "The M-5 computer needed a new power source, the crewman merely got in the way." -- Kirk and Dr. Richard Daystrom, "The Ultimate Computer", stardate 4731.3. From kalman_g at msn.com Mon Jul 18 14:24:53 2011 From: kalman_g at msn.com (GKalman) Date: Mon, 18 Jul 2011 05:24:53 -0700 (PDT) Subject: [Tkinter-discuss] Button command callback question -- Part 2 Message-ID: <32082790.post@talk.nabble.com> Thanks for the replies for my earlier question. I should have stated my question in a better way. My question is related to SCOPE! For example: #==================================== from Tkinter import * #------------------------------------------------- def doIt(): print x #------------------------------------------------ root=Tk() btn=Button(root,text="DO",bg="cyan",command=doIt) btn.pack(side=BOTTOM) x=11 #NOTE that it works even when the mainloop() method below is commented out!!!! #root.mainloop() #=================================================================== so: if (1) there is no mainloop() (2) x=11 is declared in the MAIN part (3) command=doIt() has no argument (4) doIt() fn appears ahead of the x=11 statement My Question is: why x=11 is within the scope of the doIt() callback fn? -- View this message in context: http://old.nabble.com/Button-command-callback-question----Part-2-tp32082790p32082790.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From klappnase at web.de Mon Jul 18 20:21:07 2011 From: klappnase at web.de (Michael Lange) Date: Mon, 18 Jul 2011 20:21:07 +0200 Subject: [Tkinter-discuss] Button command callback question -- Part 2 In-Reply-To: <32082790.post@talk.nabble.com> References: <32082790.post@talk.nabble.com> Message-ID: <20110718202107.82947468.klappnase@web.de> Hi, Thus spoketh GKalman unto us on Mon, 18 Jul 2011 05:24:53 -0700 (PDT): (...) > > #NOTE that it works even when the mainloop() method below is commented > out!!!! > #root.mainloop() > #=================================================================== > > so: if > (1) there is no mainloop() > (2) x=11 is declared in the MAIN part > (3) command=doIt() has no argument > (4) doIt() fn appears ahead of the x=11 statement > > My Question is: why x=11 is within the scope of the doIt() callback fn? > Here when root.mainloop() is commented out, the call to $ python test.py immediately returns ;) Of course you don't need to explicitely call mainloop() when you run python in interactive mode from a terminal. Besides this I cannot see anything surprising in the behavior of the code example. When you define x=11 you add an object "x" to the global namespace. When doIt() is called and the print x command is being executed, the interpreter will first look if an object x is defined within the function's namespace and then look within the global namespace for such an object. Only when it cannot find such an object in any available namespace an error will be raised. Of course the contents of the function body are not evaluated before the function is actually called. So it is not important if doIt is defined before x , but only if x is already defined when doIt() is called. Maybe it helps you understand what happens if you change your example a little. If you change the doit() definition like def doIt(): x = 2 print x it will print 2 instead of 11 . It is important to understand that the "outer" x will not be changed by calls to this function as you can verify by e.g. adding a second button that will call the original version of your doIt() function, or by changing it a little more: def doIt(): print x def foo(): x=2 print x foo() Now it will print first 11, then 2 , but without overriding the "outer" x, as you can see by repeatedly pressing the button. If you want to change the "outer" (=global) x , you need to add the "global" statement: def doIt(): print x def foo(): global x x+=1 print x foo() I hope this helps Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Death. Destruction. Disease. Horror. That's what war is all about. That's what makes it a thing to be avoided. -- Kirk, "A Taste of Armageddon", stardate 3193.0 From lionkimbro at gmail.com Mon Jul 18 20:59:00 2011 From: lionkimbro at gmail.com (Lion Kimbro) Date: Mon, 18 Jul 2011 11:59:00 -0700 Subject: [Tkinter-discuss] Button command callback question -- Part 2 In-Reply-To: <20110718202107.82947468.klappnase@web.de> References: <32082790.post@talk.nabble.com> <20110718202107.82947468.klappnase@web.de> Message-ID: I would also add a caution: If you assign x *anywhere* within the function, a prior use will fail... def foo(): print x # raises UnboundLocalError, x = 10 # ...because the interpreter knows that x is local. Only unassigned values are searched for in the global namespace, if not locally declared. I think the reason it's like this, is to keep variables in one function in one scope, for sanity's sake. On Mon, Jul 18, 2011 at 11:21 AM, Michael Lange wrote: > Hi, > > Thus spoketh GKalman > unto us on Mon, 18 Jul 2011 05:24:53 -0700 (PDT): > > (...) > > > > #NOTE that it works even when the mainloop() method below is commented > > out!!!! > > #root.mainloop() > > #=================================================================== > > > > so: if > > (1) there is no mainloop() > > (2) x=11 is declared in the MAIN part > > (3) command=doIt() has no argument > > (4) doIt() fn appears ahead of the x=11 statement > > > > My Question is: why x=11 is within the scope of the doIt() callback fn? > > > > Here when root.mainloop() is commented out, the call to > $ python test.py > immediately returns ;) Of course you don't need to explicitely call > mainloop() when you run python in interactive mode from a terminal. > > Besides this I cannot see anything surprising in the behavior of the > code example. When you define x=11 you add an object "x" to the global > namespace. When doIt() is called and the print x command is being > executed, the interpreter will first look if an object x is defined > within the function's namespace and then look within the global namespace > for such an object. Only when it cannot find such an object in any > available namespace an error will be raised. > Of course the contents of the function body are not evaluated before the > function is actually called. So it is not important if doIt is defined > before x , but only if x is already defined when doIt() is called. > > Maybe it helps you understand what happens if you change your example a > little. If you change the doit() definition like > > def doIt(): > x = 2 > print x > > it will print 2 instead of 11 . It is important to understand that the > "outer" x will not be changed by calls to this function as you can verify > by e.g. adding a second button that will call the original version of > your doIt() function, or by changing it a little more: > > def doIt(): > print x > def foo(): > x=2 > print x > foo() > > Now it will print first 11, then 2 , but without overriding the "outer" x, > as you can see by repeatedly pressing the button. > > If you want to change the "outer" (=global) x , you need to add the > "global" statement: > > def doIt(): > print x > def foo(): > global x > x+=1 > print x > foo() > > I hope this helps > > Michael > > > .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. > > Death. Destruction. Disease. Horror. That's what war is all about. > That's what makes it a thing to be avoided. > -- Kirk, "A Taste of Armageddon", stardate 3193.0 > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnmc at velseis.com Mon Jul 18 13:09:20 2011 From: johnmc at velseis.com (johnmc) Date: Mon, 18 Jul 2011 21:09:20 +1000 Subject: [Tkinter-discuss] A Button command callback question... In-Reply-To: <32080554.post@talk.nabble.com> References: <32080554.post@talk.nabble.com> Message-ID: <20110718105454.M12404@velseis.com> On Sun, 17 Jul 2011 20:34:58 -0700 (PDT), GKalman wrote > The following code fragment works OK. Question: why? > #====================================== > from Tkinter import * > root=Tk() > > lbl=Label(root,text='1').pack() > > def doIt(): > lbl.config(bg="yellow") > > btn=Button(root,text="do", bg="cyan",command=doIt).pack() > > root.mainloop() > #======================================= The code fragment you posted does not work OK, assuming that if by OK you intend the label background to change yellow upon invocation of the "do" button. The reason why it does not work is you have bound lbl to the return of the pack method, which is None. Obviously, you cannot configure the background colour of a None object. What I'm sure you intended was: #========================================= from Tkinter import * root = Tk() lbl = Label(root, text='1') lbl.pack() def doIt(): lbl.config(bg='yellow') btn = Button(root, text='do', bg='cyan', command = doIt) btn.pack() root.mainloop() #========================================== Now, upon pressing the "do" button, the label background changes to yellow. > My question is: how is the instance lbl.config(...) recognized in the doIt > callback fn when called from the main w/o an argument referencing lbl? > The reason why has to do with scope. You have defined lbl in the global scope. Thus the name "lbl" is available (defined) to the local scope of the function doIt. This may have been purely accidentally fortuitous on your part but it is expected behaviour. Regards, John -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.