From greendingbat99 at hotmail.com Wed Jul 1 17:38:04 2009 From: greendingbat99 at hotmail.com (VladPotrosky) Date: Wed, 1 Jul 2009 08:38:04 -0700 (PDT) Subject: [Tkinter-discuss] Tkinter Geometry Management and Other Basics In-Reply-To: <49CBA48C.4020601@sbcglobal.net> References: <49CBA48C.4020601@sbcglobal.net> Message-ID: <24291981.post@talk.nabble.com> As I understand it, there are three geometry managers: Grids, Pack and Place. Only the first two are of interest. > > Is it possible to mix them? I don't think so, but maybe I'm missing > something. Generally, they seem to apply with respect to a Frame, so I > would think only one geometry can be used in a Frame. However, if one is > used for frameA and another for frameB, can they both be used with in a > parent frame, which has its own geometry (grid or pack)? > > Suppose I want a parent frame to have a title and below it a 2 column grid > with say a Label and Entry. I put the latter in a frame combo in a frame, > and attach it to the parent. Do I need to put the title/label in a frame > and do the same? Grid and pack cannot be mixed within the same parent widget. This may or may not be a frame. It could also be a canvas, or other such widgets. It is possible to mix parent widgets which have different geometry managers. So yes, your situation with having two frames with different geometry would work. Just be sure never to mix the managers within the same parent widget. Otherwise all creation comes to an end 8-O ----- --------------------------------------------------- "I'd like to share a revelation that I've had during my time here. It came to me when I tried to classify your species and I realized that you're not actually mammals." -- Agent Smith -- View this message in context: http://www.nabble.com/Tkinter-Geometry-Management-and-Other-Basics-tp22724967p24291981.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From greendingbat99 at hotmail.com Wed Jul 1 17:08:00 2009 From: greendingbat99 at hotmail.com (VladPotrosky) Date: Wed, 1 Jul 2009 08:08:00 -0700 (PDT) Subject: [Tkinter-discuss] Finding Tkinter widget types Message-ID: <24291475.post@talk.nabble.com> Hello all. I am writing a project which will execute a method of each widget in a form, based on what type the widget is (ie: executing .deselect() if it's a checkbox, .delete() if it's an entry ect...) i was basically duck typing all the widgets, assuming that if trying a certain method worked, then it was the type i wanted (running .deselect() successfully meant that i must have a checkbox) unfortunately, i realized that many widgets have methods in common, and that this approach didn't work in some cases. is there a good way to determine the type of a widget which is not duck typing? -- View this message in context: http://www.nabble.com/Finding-Tkinter-widget-types-tp24291475p24291475.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From jmcmonagle at velseis.com.au Thu Jul 2 06:48:18 2009 From: jmcmonagle at velseis.com.au (John McMonagle) Date: Thu, 02 Jul 2009 14:48:18 +1000 Subject: [Tkinter-discuss] {Possible_Spam} Finding Tkinter widget types In-Reply-To: <24291475.post@talk.nabble.com> References: <24291475.post@talk.nabble.com> Message-ID: <4A4C3C12.7020709@velseis.com.au> VladPotrosky wrote: > Hello all. > I am writing a project which will execute a method of each widget in a form, > based on what type the widget is (ie: executing .deselect() if it's a > checkbox, .delete() if it's an entry ect...) > i was basically duck typing all the widgets, assuming that if trying a > certain method worked, then it was the type i wanted (running .deselect() > successfully meant that i must have a checkbox) > unfortunately, i realized that many widgets have methods in common, and that > this approach didn't work in some cases. > is there a good way to determine the type of a widget which is not duck > typing? Use the winfo_class() method (Example below): from Tkinter import * r = Tk() b = Button(r, text='test') b.pack() c = Checkbutton(r) c.pack() e = Entry(r) e.pack() widgets = [b,c,e] def widgetMethod(widget): if widget.winfo_class() == 'Button': print 'A Button widget!' elif widget.winfo_class() == 'Checkbutton': print 'A Checkbutton widget!' elif widget.winfo_class() == 'Entry': print 'An Entry widget!' for widget in widgets: widgetMethod(widget) r.mainloop() Regards, John From bieffe62 at gmail.com Fri Jul 3 16:27:42 2009 From: bieffe62 at gmail.com (Francesco Bochicchio) Date: Fri, 3 Jul 2009 16:27:42 +0200 Subject: [Tkinter-discuss] Anyone needs old demo programs ? Message-ID: Hi all, nine years ago I needed to lern some Tkinter for a work, so in the summer I spent some time duplicating about 80% of the demo programs included in the demo suite of tcl/tk (I think is called widget tour). I occasionally have shown these demos to other pythoneers on the italian python newsgroup, and I have been suggested to public it in some more visible place than my personal web space. So I wonder if there is a place in the web where this code could be 'at home' and still useful to somebody (I've looked around but I did not found anybody else duplicating the widget tour or providing a systematic demo of all Tkinter widgets). It is my code that I developed during vacation time, and I'm willing to give it away under a "please help yourself" licence. It is also very old code, which I touched very little after I learned what I needed, but should still work with python 2.6, and if there is interest I could also spend some time porting it to python 3.1 in my incoming vacation (I need some porting exercise for when I'll port the scripts I'm currently using at work). Apart from that, since I'm not using Tcl/tk anymore, I can't guarantee any maintenance. If anybody is interested, my code is here: http://www.webalice.it/fbochicchio/python/widget-tour.html Skip the italian introduction (unless you can read italian :-) and just grab the tarball. The main module is widget.py, then there is a module for each demo and a few common utilities modules. Ciao ----- FB -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cameron at phaseit.net Fri Jul 3 16:43:24 2009 From: Cameron at phaseit.net (Cameron Laird) Date: Fri, 3 Jul 2009 14:43:24 +0000 Subject: [Tkinter-discuss] Anyone needs old demo programs ? In-Reply-To: References: Message-ID: <20090703144324.GA1506@lairds.us> On Fri, Jul 03, 2009 at 04:27:42PM +0200, Francesco Bochicchio wrote: . . . > nine years ago I needed to lern some Tkinter for a work, so in the summer I > spent some time duplicating > about 80% of the demo programs included in the demo suite of tcl/tk (I think > is called widget tour). > I occasionally have shown these demos to other pythoneers on the italian > python newsgroup, and I have been suggested to > public it in some more visible place than my personal web space. So I wonder > if there is a place in the web where this code could be 'at home' > and still useful to somebody (I've looked around but I did not found anybody > else duplicating the widget tour or providing a systematic demo of all > Tkinter widgets). . . . How well does it fit on the Wiki ? If not there, I'm sure Fredrik and/or I can find a reliable long-term home for it on one of our servers. From Vasilis.Vlachoudis at cern.ch Fri Jul 3 16:48:29 2009 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Fri, 3 Jul 2009 16:48:29 +0200 Subject: [Tkinter-discuss] tkFileDialog: Create new folder Message-ID: <4A4E1A3D.1010302@cern.ch> Hi all, is there a Tkinter:FileDialog that that has a "create a new folder" functionality for tkFileDialog.asksavefilename? Cheers Vasilis From srilyk at gmail.com Fri Jul 3 21:06:06 2009 From: srilyk at gmail.com (Wayne) Date: Fri, 3 Jul 2009 14:06:06 -0500 Subject: [Tkinter-discuss] tkFileDialog: Create new folder In-Reply-To: <4A4E1A3D.1010302@cern.ch> References: <4A4E1A3D.1010302@cern.ch> Message-ID: <333efb450907031206q4935fdf0q7c20fd846fc465eb@mail.gmail.com> On Fri, Jul 3, 2009 at 9:48 AM, Vasilis Vlachoudis < Vasilis.Vlachoudis at cern.ch> wrote: > Hi all, > > is there a Tkinter:FileDialog that that has a "create a new folder" > functionality for tkFileDialog.asksavefilename? on Windows XP the tkFileDialog.asksaveasfilename() has a "new folder" button, but I'm assuming that's an OS function because the window looks like the default OS window. Or are you looking for something differnt? HTH, Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: From duffy at quinda.com Sat Jul 4 05:04:34 2009 From: duffy at quinda.com (Duffy OCraven) Date: Fri, 3 Jul 2009 20:04:34 -0700 (PDT) Subject: [Tkinter-discuss] pack: difference between anchor and side options? (also anchor as a widget option) Message-ID: <787245.78385.qm@web88301.mail.re4.yahoo.com> In case others are led to this thread by a Google of tkinter pack anchor just as I was, I wanted to contribute my example and how I overcame the two gotchas that I encountered while solving it. To visualize the interplay between anchor and side, think of the behavior of layout manager when doing a row of boats moored at a dock. The dock is a Frame, rowOfBoats is another Frame packed with "side": "top" so that the bows of the boat point upward towards the dock. Each of the boats are "side": "left" within rowOfBoats so that they form a row, with their bows pointing upward. If all the boats are the same length, their noses will touch the dock. If all the boats are not the same length, only the nose of the longest one will touch the dock. The others are centered within a space the size of the longest one, so their noses are a little ways away from the dock. Instead make the boats "anchor": N, "side": "left" within rowOfBoats, and every boat will have its nose touching the dock. The gotchas I mentioned: first was coding "anchor": "N", "side": "left" since all the other options are strings. That will produce an exception _tkinter.TclError: bad anchor "N": must be n, ne, e, se, s, sw, w, nw, or center The other gotcha: I tried coding rowOfBoats as "anchor": N, "side": "top" below dock, without adding "anchor": N to the pack for individual boats. More subtle since it gave no error, it just didn't do anything--leaving the appearance unchanged as though my code change was not being executed. - Duffy O'Craven From greendingbat99 at hotmail.com Mon Jul 6 17:17:54 2009 From: greendingbat99 at hotmail.com (VladPotrosky) Date: Mon, 6 Jul 2009 08:17:54 -0700 (PDT) Subject: [Tkinter-discuss] {Possible_Spam} Finding Tkinter widget types In-Reply-To: <4A4C3C12.7020709@velseis.com.au> References: <24291475.post@talk.nabble.com> <4A4C3C12.7020709@velseis.com.au> Message-ID: <24357016.post@talk.nabble.com> Looks great! Thanks! John McMonagle-3 wrote: > > > Use the winfo_class() method (Example below): > > from Tkinter import * > r = Tk() > b = Button(r, text='test') > b.pack() > c = Checkbutton(r) > c.pack() > e = Entry(r) > e.pack() > > widgets = [b,c,e] > > def widgetMethod(widget): > if widget.winfo_class() == 'Button': > print 'A Button widget!' > elif widget.winfo_class() == 'Checkbutton': > print 'A Checkbutton widget!' > elif widget.winfo_class() == 'Entry': > print 'An Entry widget!' > > for widget in widgets: > widgetMethod(widget) > > r.mainloop() > > > ----- --------------------------------------------------- "I'd like to share a revelation that I've had during my time here. It came to me when I tried to classify your species and I realized that you're not actually mammals." -- Agent Smith -- View this message in context: http://www.nabble.com/Finding-Tkinter-widget-types-tp24291475p24357016.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From greendingbat99 at hotmail.com Wed Jul 8 22:34:43 2009 From: greendingbat99 at hotmail.com (VladPotrosky) Date: Wed, 8 Jul 2009 13:34:43 -0700 (PDT) Subject: [Tkinter-discuss] Finding variable associated with checkbutton Message-ID: <24398829.post@talk.nabble.com> ----- --------------------------------------------------- "I'd like to share a revelation that I've had during my time here. It came to me when I tried to classify your species and I realized that you're not actually mammals." -- Agent Smith -- View this message in context: http://www.nabble.com/Finding-variable-associated-with-checkbutton-tp24398829p24398829.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From greendingbat99 at hotmail.com Wed Jul 8 22:37:52 2009 From: greendingbat99 at hotmail.com (VladPotrosky) Date: Wed, 8 Jul 2009 13:37:52 -0700 (PDT) Subject: [Tkinter-discuss] Finding variable associated with checkbutton Message-ID: <24398881.post@talk.nabble.com> How do you find the variable which a checkbutton is linked to? example: v = IntVar() c = Checkbutton(master, text='Foo', variable=v) how do you then find out (with code) that v is linked to c? ----- --------------------------------------------------- "I'd like to share a revelation that I've had during my time here. It came to me when I tried to classify your species and I realized that you're not actually mammals." -- Agent Smith -- View this message in context: http://www.nabble.com/Finding-variable-associated-with-checkbutton-tp24398881p24398881.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From Cameron at phaseit.net Wed Jul 8 23:05:50 2009 From: Cameron at phaseit.net (Cameron Laird) Date: Wed, 8 Jul 2009 21:05:50 +0000 Subject: [Tkinter-discuss] Finding variable associated with checkbutton In-Reply-To: <24398881.post@talk.nabble.com> References: <24398881.post@talk.nabble.com> Message-ID: <20090708210550.GA14178@lairds.us> On Wed, Jul 08, 2009 at 01:37:52PM -0700, VladPotrosky wrote: . . . > How do you find the variable which a checkbutton is linked to? > example: > > > v = IntVar() > c = Checkbutton(master, text='Foo', variable=v) > > how do you then find out (with code) that v is linked to c? . . . if v._name == c.cget("variable").string: print "Ah-ha! They *do* match." Maybe there is a better way. That's as far as I've thought about it. From ggpolo at gmail.com Thu Jul 9 15:53:37 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Thu, 9 Jul 2009 10:53:37 -0300 Subject: [Tkinter-discuss] Finding variable associated with checkbutton In-Reply-To: <20090708210550.GA14178@lairds.us> References: <24398881.post@talk.nabble.com> <20090708210550.GA14178@lairds.us> Message-ID: On Wed, Jul 8, 2009 at 6:05 PM, Cameron Laird wrote: > On Wed, Jul 08, 2009 at 01:37:52PM -0700, VladPotrosky wrote: > ? ? ? ? ? ? ? ? ? ? ? ?. > ? ? ? ? ? ? ? ? ? ? ? ?. > ? ? ? ? ? ? ? ? ? ? ? ?. >> How do you find the variable which a checkbutton is linked to? >> example: >> >> >> v = IntVar() >> c = Checkbutton(master, text='Foo', variable=v) >> >> how do you then find out (with code) that v is linked to c? > ? ? ? ? ? ? ? ? ? ? ? ?. > ? ? ? ? ? ? ? ? ? ? ? ?. > ? ? ? ? ? ? ? ? ? ? ? ?. > ?if v._name == c.cget("variable").string: > ? ?print "Ah-ha! ?They *do* match." > > Maybe there is a better way. ?That's as far as I've thought about it. I would opt to do the check str(v) == str(c['variable']) instead, less intrusive. -- -- Guilherme H. Polo Goncalves From jepler at unpythonic.net Wed Jul 15 23:43:11 2009 From: jepler at unpythonic.net (Jeff Epler) Date: Wed, 15 Jul 2009 16:43:11 -0500 Subject: [Tkinter-discuss] Anyone needs old demo programs ? In-Reply-To: <20090715145052.GA25885@lairds.us> References: <20090703144324.GA1506@lairds.us> <20090707221155.GA27989@lairds.us> <20090715145052.GA25885@lairds.us> Message-ID: <20090715214311.GA4439@unpythonic.net> On Wed, Jul 15, 2009 at 02:50:52PM +0000, Cameron Laird wrote: > On Wed, Jul 15, 2009 at 04:44:13PM +0200, Francesco Bochicchio wrote: > . > . > . > > Ok. I decided that both sourceforge and googlecode are overkill for my demo > > programs. So I would like to create a page in the wiki explaining who and > > what and why and then annexing the tarball with the demo. > > I started creating the account FrancescoBochicchio, but seem to be unable to > > create pages, not even my home page. How do I do it? > . > . > . > Jeff, can you help? > As I mentioned on the mailing list, spammers have forced me to make further restrictions on who can edit the wiki: http://mail.python.org/pipermail/tkinter-discuss/2009-March/001842.html I have added FrancescoBochicchio as an approved editor, and I have also (just) changed the acl on the ApprovedEditorsGroup page so that all signed-in users can edit that page to add themselves, granting themselves the ability to edit other pages. We'll see whether this is a bar that will still deter spammers but let newcomers contribute. Francesco, sorry for the inconvenience. Please feel free to contact me directly if you still can't make contributions on the wiki. Jeff From bieffe62 at gmail.com Thu Jul 16 11:11:24 2009 From: bieffe62 at gmail.com (Francesco Bochicchio) Date: Thu, 16 Jul 2009 11:11:24 +0200 Subject: [Tkinter-discuss] Anyone needs old demo programs ? In-Reply-To: <20090715214311.GA4439@unpythonic.net> References: <20090703144324.GA1506@lairds.us> <20090707221155.GA27989@lairds.us> <20090715145052.GA25885@lairds.us> <20090715214311.GA4439@unpythonic.net> Message-ID: 2009/7/15 Jeff Epler > On Wed, Jul 15, 2009 at 02:50:52PM +0000, Cameron Laird wrote: > > On Wed, Jul 15, 2009 at 04:44:13PM +0200, Francesco Bochicchio wrote: > > . > > . > > . > > > Ok. I decided that both sourceforge and googlecode are overkill for my > demo > > > programs. So I would like to create a page in the wiki explaining who > and > > > what and why and then annexing the tarball with the demo. > > > I started creating the account FrancescoBochicchio, but seem to be > unable to > > > create pages, not even my home page. How do I do it? > > . > > . > > . > > Jeff, can you help? > > > > As I mentioned on the mailing list, spammers have forced me to make > further restrictions on who can edit the wiki: > http://mail.python.org/pipermail/tkinter-discuss/2009-March/001842.html > > I have added FrancescoBochicchio as an approved editor, and I have also > (just) changed the acl on the ApprovedEditorsGroup page so that all > signed-in users can edit that page to add themselves, granting > themselves the ability to edit other pages. We'll see whether this is a > bar that will still deter spammers but let newcomers contribute. > > Francesco, sorry for the inconvenience. Please feel free to contact me > directly if you still can't make contributions on the wiki. > > Jeff Ok. I have done it. I created a new page with attached the tarball of my demo programs and I added a link to it in the "Examples" page. Feel free to fix any mistake I could have done. Ciao ------- FB -------------- next part -------------- An HTML attachment was scrubbed... URL: From helmrp at yahoo.com Fri Jul 17 14:15:32 2009 From: helmrp at yahoo.com (The Helmbolds) Date: Fri, 17 Jul 2009 05:15:32 -0700 (PDT) Subject: [Tkinter-discuss] How to open a Microsoft Word file from Tkinter? Message-ID: <869424.51401.qm@web31812.mail.mud.yahoo.com> I managed to open a plain?*.txt file in Microsoft Notepad from TkInter by using Python's "spawnv" command in its "os" module. That does not seem to work for opening a *.txt or a *.doc file in Microsoft Word. How do I open a *.doc?file in Microsoft Word from TkInter? Or is?this so complicated it's not worth it? ? Bob -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggpolo at gmail.com Fri Jul 17 16:13:07 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Fri, 17 Jul 2009 11:13:07 -0300 Subject: [Tkinter-discuss] How to open a Microsoft Word file from Tkinter? In-Reply-To: <869424.51401.qm@web31812.mail.mud.yahoo.com> References: <869424.51401.qm@web31812.mail.mud.yahoo.com> Message-ID: On Fri, Jul 17, 2009 at 9:15 AM, The Helmbolds wrote: > I managed to open a plain?*.txt file in Microsoft Notepad from TkInter by > using Python's "spawnv" command in its "os" module. > > That does not seem to work for opening a *.txt or a *.doc file in Microsoft > Word. > > How do I open a *.doc?file in Microsoft Word from TkInter? Or is?this so > complicated it's not worth it? > What happens if you try os.system('start myfile.doc') ? This is not related to Tkinter, so, if you want to extend the initial question and include communication with ms word or anything related, I would suggest to post this to an appropriate list. Regards, -- -- Guilherme H. Polo Goncalves From peter.milliken at gmail.com Sun Jul 19 22:11:52 2009 From: peter.milliken at gmail.com (Peter Milliken) Date: Mon, 20 Jul 2009 06:11:52 +1000 Subject: [Tkinter-discuss] How to open a Microsoft Word file from Tkinter? In-Reply-To: References: <869424.51401.qm@web31812.mail.mud.yahoo.com> Message-ID: <791153ba0907191311j5650ae1byc15c7ca2685d8a59@mail.gmail.com> I have some code from several years ago where I access Word documents that are configured to perform mail merges i.e. I add the data from a python program and then print the .doc file. Unfortunately I didn't document it very well (presumably I understood it at the time? It certainly worked! :-)). So here are some clues from that code (it was part of a lane management system I wrote for my kids swimming club): from win32com.client import constants, Dispatch from win32com.gen_py.word import * wd = Dispatch("Word.Application") for l in range(1, int(self['lanes']) + 1): # The Word documents will be in the same directory as the code. lane_name = '%s\Lane%s.doc' % (os.getcwd(), l) doc = wd.Documents.Open(lane_name) event_range = range(int(self.component('StartEvent').getvalue()), self.num_events, 3) # Number of events per page doc.MailMerge.Destination = win32com.gen_py.word.constants.wdSendToNewDocument doc.MailMerge.MailAsAttachment = False doc.MailMerge.MailAddressFieldName = "" doc.MailMerge.MailSubject = "" doc.MailMerge.SuppressBlankLines = True for event in event_range: doc.MailMerge.DataSource.FirstRecord = event doc.MailMerge.DataSource.LastRecord = event + 2 doc.MailMerge.Execute(Pause = True) wd.ActiveDocument.PrintOut() wd.ActiveDocument.Close(SaveChanges = False) # Now close the mailmerge template doc.Close(SaveChanges = False) I most likely copied this code from somewhere on the Internet - I would love to give credit, but have long since lost the information... Hope this helps, Peter On Sat, Jul 18, 2009 at 12:13 AM, Guilherme Polo wrote: > On Fri, Jul 17, 2009 at 9:15 AM, The Helmbolds wrote: > > I managed to open a plain *.txt file in Microsoft Notepad from TkInter by > > using Python's "spawnv" command in its "os" module. > > > > That does not seem to work for opening a *.txt or a *.doc file in > Microsoft > > Word. > > > > How do I open a *.doc file in Microsoft Word from TkInter? Or is this so > > complicated it's not worth it? > > > > What happens if you try os.system('start myfile.doc') ? > > This is not related to Tkinter, so, if you want to extend the initial > question and include communication with ms word or anything related, I > would suggest to post this to an appropriate list. > > Regards, > > > > -- > -- Guilherme H. Polo Goncalves > _______________________________________________ > 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 alan.gauld at btinternet.com Sat Jul 25 21:56:19 2009 From: alan.gauld at btinternet.com (Alan Gauld) Date: Sat, 25 Jul 2009 20:56:19 +0100 Subject: [Tkinter-discuss] Tkinter Geometry Management and Other Basics References: <49CBA48C.4020601@sbcglobal.net> <24291981.post@talk.nabble.com> Message-ID: "VladPotrosky" wrote > As I understand it, there are three geometry managers: Grids, Pack and > Place. Only the first two are of interest. There is now a fourth, the form manager, as of Python 2.7/3.1... Haven't used it yet so cannot comment on how genuinely useful it is. And to the OP, yes you can definitely mix the manager provided you keep to one per container. I typically use pack to pack a set of frames into my top level app. But within each of the subframes I then use grid/pack as suits my needs, often (usually?) a mx of both in a single app. -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ From hk at pop.ms Sun Jul 26 10:56:59 2009 From: hk at pop.ms (Harm Kirchhoff) Date: Sun, 26 Jul 2009 17:56:59 +0900 Subject: [Tkinter-discuss] Tktable: Can not find the dll. Message-ID: <4A6C1A5B.9090907@pop.ms> I am trying to use tktable with Python on Windows and am getting the notorious "tktable isn't loaded statically" error. I read the comments available on the www but could not make it work. It is clear, that my installation can not find the Tktable files. But how can I tell it where to find them ? (I am not a Tcl programmer). I am using python 2.6 on windowsXP: I can see the Tkinter wrapper in C:\Python26\Lib\lib-tk\tktable.py the tcl is in: C:\Python26\tcl\tk8.5\tkTable.tcl and under C:\Python26\DLLs I have 2 dlls: tcl85.dll and tk85.dll there is no tktable.dll but I assume it should be in the tk85.dll ??? I thought I could simply modify the wrapper to point to the tcl: def __init__(self, master=None, **kw): master = _setup_master(master) try: master.tk.call('package', 'require', 'Tktable') except Tkinter.TclError: try: master.tk.call('load', 'tkTable.dll', 'Tktable') except Tkinter.TclError: master.tk.call('load','C:\\Python26\\tcl\\tk8.5\\tkTable.tcl', 'Tktable') #master.tk.call('load', '', 'tkTable') But that does not work either. Anybody using tkTable on windows: How did you do it ? I guess I have to modify the TCL standard path to make it find the tcl or DLL but not having any TCL experience, I have no idea how to do that from python. Regards, HK From ggpolo at gmail.com Sun Jul 26 19:06:03 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Sun, 26 Jul 2009 14:06:03 -0300 Subject: [Tkinter-discuss] Tkinter Geometry Management and Other Basics In-Reply-To: References: <49CBA48C.4020601@sbcglobal.net> <24291981.post@talk.nabble.com> Message-ID: 2009/7/25 Alan Gauld : > "VladPotrosky" wrote > >> As I understand it, there are three geometry managers: Grids, Pack and >> Place. Only the first two are of interest. > > There is now a fourth, the form manager, as of Python 2.7/3.1... > What is this "form manager" ? Probably not the one from Tix, since it is has been in Python for more than 8 years. > Haven't used it yet so cannot comment on how genuinely useful it is. > > And to the OP, yes you can definitely mix the manager provided you keep to > one per container. I typically use pack to pack a set of frames into my top > level app. But within each of the subframes I then use grid/pack as suits my > needs, often (usually?) a mx of both in a single app. > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > -- -- Guilherme H. Polo Goncalves From ggpolo at gmail.com Sun Jul 26 19:14:51 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Sun, 26 Jul 2009 14:14:51 -0300 Subject: [Tkinter-discuss] Tktable: Can not find the dll. In-Reply-To: <4A6C1A5B.9090907@pop.ms> References: <4A6C1A5B.9090907@pop.ms> Message-ID: 2009/7/26 Harm Kirchhoff : > I am trying to use tktable with Python on Windows and am getting the notorious > "tktable isn't loaded statically" error. > I read the comments available on the www but could not make it work. > > It is clear, that my installation can not find the Tktable files. But > how can I tell it where to find them ? > (I am not a Tcl programmer). > > I am using python 2.6 on windowsXP: > I can see the Tkinter wrapper in C:\Python26\Lib\lib-tk\tktable.py > the tcl is in: C:\Python26\tcl\tk8.5\tkTable.tcl > and under C:\Python26\DLLs I have 2 dlls: tcl85.dll and tk85.dll > there is no tktable.dll but I assume it should be in the tk85.dll ??? > Hi Harm, First, I don't remember if tktable's cvs contains the very latest version of the python tktable wrapper. So, I recommend to get the one from http://tkinter.unpy.net/wiki/TkTableWrapper (which is the latest version in tktable's cvs plus minor fixes). With this wrapper all you have to do is set the environment variable TKTABLE_LIBRARY to point to the directory that contains the tktable tcl package -- if it is not in any standard directory --. I also don't remember if there is a windows binary for tktable. Last time I used tktable on Windows I grabbed the tcl/tk distribution from activestate which includes it and many other libraries. > > I thought I could simply modify the wrapper to point to the tcl: > ? ?def __init__(self, master=None, **kw): > ? ? ? ?master = _setup_master(master) > ? ? ? ?try: > ? ? ? ? ? ?master.tk.call('package', 'require', 'Tktable') > ? ? ? ?except Tkinter.TclError: > ? ? ? ? ? ?try: > ? ? ? ? ? ? ? ?master.tk.call('load', 'tkTable.dll', 'Tktable') > ? ? ? ? ? ?except Tkinter.TclError: > ? ? ? ? ? ? ? ?master.tk.call('load','C:\\Python26\\tcl\\tk8.5\\tkTable.tcl', 'Tktable') > ? ? ? ? ? ? ? ?#master.tk.call('load', '', 'tkTable') > But that does not work either. > > Anybody using tkTable on windows: How did you do it ? > I guess I have to modify the TCL standard path to make it find the tcl > or DLL but not having any TCL experience, I have no idea how to do that > from python. > > Regards, > > HK > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > -- -- Guilherme H. Polo Goncalves From ggpolo at gmail.com Sun Jul 26 19:20:54 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Sun, 26 Jul 2009 14:20:54 -0300 Subject: [Tkinter-discuss] Tkinter Geometry Management and Other Basics In-Reply-To: <348899.56094.qm@web86712.mail.ird.yahoo.com> References: <49CBA48C.4020601@sbcglobal.net> <24291981.post@talk.nabble.com> <348899.56094.qm@web86712.mail.ird.yahoo.com> Message-ID: 2009/7/26 ALAN GAULD : > > > > >> > There is now a fourth, the form manager, as of Python 2.7/3.1... >> >> What is this "form manager" ? Probably not the one from Tix, since it >> is has been in Python for more than 8 years. > > > It could be the same, I didn't know Tix had a form manager. > I only noticed it while reading the Whats New stuff > for Python 3.1/2.7. ISTR It was listed amongst the info about ttk. > If that information is listed there then there is something wrong. But I only see a short note about the ttk module: "Added a new module, tkinter.ttk for access to the Tk themed widget set. The basic idea of ttk is to separate, to the extent possible, the code implementing a widget?s behavior from the code implementing its appearance." > > Alan G. > Regards, -- -- Guilherme H. Polo Goncalves From alan.gauld at btinternet.com Sun Jul 26 19:10:33 2009 From: alan.gauld at btinternet.com (ALAN GAULD) Date: Sun, 26 Jul 2009 17:10:33 +0000 (GMT) Subject: [Tkinter-discuss] Tkinter Geometry Management and Other Basics In-Reply-To: References: <49CBA48C.4020601@sbcglobal.net> <24291981.post@talk.nabble.com> Message-ID: <348899.56094.qm@web86712.mail.ird.yahoo.com> > > There is now a fourth, the form manager, as of Python 2.7/3.1... > > What is this "form manager" ? Probably not the one from Tix, since it > is has been in Python for more than 8 years. It could be the same, I didn't know Tix had a form manager. I only noticed it while reading the Whats New stuff for Python 3.1/2.7. ISTR It was listed amongst the info about ttk. > > Haven't used it yet so cannot comment on how genuinely useful it is. Alan G. From alan.gauld at btinternet.com Sun Jul 26 23:12:27 2009 From: alan.gauld at btinternet.com (ALAN GAULD) Date: Sun, 26 Jul 2009 21:12:27 +0000 (GMT) Subject: [Tkinter-discuss] Tkinter Geometry Management and Other Basics In-Reply-To: References: <49CBA48C.4020601@sbcglobal.net> <24291981.post@talk.nabble.com> <348899.56094.qm@web86712.mail.ird.yahoo.com> Message-ID: <601173.47701.qm@web86705.mail.ird.yahoo.com> > > It could be the same, I didn't know Tix had a form manager. > > I only noticed it while reading the Whats New stuff > > for Python 3.1/2.7. ISTR It was listed amongst the info about ttk. > > > > If that information is listed there then there is something wrong. But > I only see a short note about the ttk module: "Added a new module, > tkinter.ttk for access to the Tk themed widget set. The basic idea of I've had another look - it was a few weeks ago - and I think what has happened is that I've gone off to the Tk docs site to look up ttk (the Tk Docs site has the look n feel that I remember) and must have clicked my way into the Tix pages and seen form there. Not having used tix before I just assumed it was a new Tk manager. My bad, apologies for any confusion caused, Alan G. From jkv at unixcluster.dk Tue Jul 28 14:04:52 2009 From: jkv at unixcluster.dk (jkv) Date: Tue, 28 Jul 2009 14:04:52 +0200 Subject: [Tkinter-discuss] Passing arguments to command in button.bind. Message-ID: <4A6EE964.3030506@unixcluster.dk> Hi, Im playing around with Tkinter and cant figure out how to pass arguments to a def which are called when pressing a button. When i bind to self.newdestination('whatever') the def is called (with arguments) as soon as the button is drawn, whereas when i bind to self.newdestination the function is called when i press the button - but obviously without any arguments Any hints? ---code--- class guiclass(object): def __init__(self): self.root = Tkinter.Tk() self.root.title('MAIN WINDOW') def config(self): self.configwindow = Tkinter.Toplevel() row = 0 optiondict = {} #config_test.config.items('options') contains a dict from configparser.... for option, value in config_test.config.items('options'): #these two print statements are just for debugging... print option print value Tkinter.Label(self.configwindow, text=str(option) + ': ', anchor='w').grid(column=1, row=row, sticky='w') Tkinter.Label(self.configwindow, text=str(value), anchor='w').grid(column=2, row=row, sticky='w') optiondict[option] = Tkinter.Button(self.configwindow, text='Change destination') optiondict[option].grid(column=3, row=row) #When this button is pressed i want to pass a string to newdestination.... optiondict[option].bind("