From alejandroautalan at gmail.com Mon Apr 1 05:19:28 2013 From: alejandroautalan at gmail.com (Alejandro Autalan) Date: Mon, 1 Apr 2013 00:19:28 -0300 Subject: [Tkinter-discuss] class_ attribute on ttk widgets In-Reply-To: References: Message-ID: 2013/3/31 Bryan Oakley > It is expected behavior. The built-in key and mouse bindings are bound to > the class, so if you change the class of a widget it will no longer have > these bindings. > > Changing the class is mostly useful if you want to create a completely > different set of bindings for a widget. > > --bryan > > > On Mar 31, 2013, at 1:58 AM, Alejandro Autalan > wrote: > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > Woow! I Had not considered the bindings. Now I understand. Thanks for the reply. :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.r.glasgow.civ at mail.mil Mon Apr 1 16:32:16 2013 From: steven.r.glasgow.civ at mail.mil (Glasgow, Steven R CIV USARMY TRADOC ANALYSIS CTR (US)) Date: Mon, 1 Apr 2013 14:32:16 +0000 Subject: [Tkinter-discuss] Tcl/TK issue with viewVC (UNCLASSIFIED) In-Reply-To: <20130329232731.3def88f6.klappnase@web.de> References: <6132691E064DAC49B214555A634702745EA539DE@UTINHPZV.easf.csd.disa.mil> <6132691E064DAC49B214555A634702745EA539F4@UTINHPZV.easf.csd.disa.mil> <6132691E064DAC49B214555A634702745EA53A52@UTINHPZV.easf.csd.disa.mil> <20130329204807.99f05ded.klappnase@web.de> <6132691E064DAC49B214555A634702745EA54B12@UTINHPZV.easf.csd.disa.mil> <20130329232731.3def88f6.klappnase@web.de> Message-ID: <6132691E064DAC49B214555A634702745EA55CE5@UTINHPZV.easf.csd.disa.mil> Classification: UNCLASSIFIED Caveats: NONE I got it to work...guess I don't really need the GUI that starts the server. That GUI is what Tkinter was needed for. I can leave off the -g option to standalone.py which starts the server without the GUI. I can then go to http://localhost:49152/viewvc from my browser and everything works to include cvsgraph. Playing middle-man between viewvc and Tkinter wasn't proving to be very useful. Apparently, version 1.2.x of viewvc has had the -g option removed from standalone.py because the interface was old and out dated. The copy of standalone.py that you were looking at had in fact (as near as I can tell) had the Tkinter code removed as that file came from the truck. The 1.1.x branch probably still had the "bug" in it, which is what I was using. Regardless, I can do what I need with viewvc now without the need for Tkinter. Thanks, Steve -----Original Message----- From: Tkinter-discuss [mailto:tkinter-discuss-bounces+steven.r.glasgow.civ=mail.mil at python.org] On Behalf Of Michael Lange Sent: Friday, March 29, 2013 5:28 PM To: tkinter-discuss at python.org Subject: Re: [Tkinter-discuss] Tcl/TK issue with viewVC (UNCLASSIFIED) Hi, On Fri, 29 Mar 2013 20:38:31 +0000 "Glasgow, Steven R CIV USARMY TRADOC ANALYSIS CTR (US)" wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > Thank you for the reply. In fact, my Tk does NOT have thread support > (great example you provided on how to find out). As I'm not the one > that installs applications, I'll need to sound a little intelligent to > our IT department to get them to do it correctly. When Tkinter is > installed is there an option provided that allows thread support to be > added (or not)? What do I need to tell them to do to get me the > thread support that I need? > > Also, don't know if this has anything to do with it or not... When > this RHEL 6.3 machine was initially built it only had 64-bit > libraries, the 32-bit ones were added later. I believe Tkinter was > installed before the 32-bit libraries were added. Could this be an > issue, if viewVC requires 32-bit? Should we just reinstall Tkinter? I'm afraid the procedure is not trivial, if no precompiled packages are available for the particular system; they would have to compile tcl and tk with --enable-threads (iirc that's the name of the ./configure option) and then compile python against the new Tcl/Tk. However, when I take a second glance at the traceback, in particular the following lines: File "/awars2a/Applicatio?ns/viewvc/viewvc-1-1?-18/bin/standalone.p?y", line 671, in ready self.title_lbl.confi?g(text='ViewVC standalone server at\n' + server.url) I am beginning to suspect (though I admit that I was too lazy to thoroughly look through the code) that in fact the code is buggy as it seems to try to change the Tkinter.Label's text from the child thread. Even better, when I look at: http://viewvc.tigris.org/svn/viewvc/trunk/bin/standalone.py these lines (resp. the use of Tkinter at all) are missing, so maybe they actually found out about the bug and fixed it. So I guess that maybe it is the best bet to try the latest development version of viewVC. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. War is never imperative. -- McCoy, "Balance of Terror", stardate 1709.2 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5640 bytes Desc: not available URL: From psimon at sonic.net Tue Apr 9 05:52:43 2013 From: psimon at sonic.net (Paul Simon) Date: Mon, 8 Apr 2013 20:52:43 -0700 Subject: [Tkinter-discuss] Exit from method loop Message-ID: Hi All, I've attaached code simplified from my "opus" and have a problem. I would like to exit from "read_sensor" into the main loop. I cannot access the "stop" check button or the "quit" button while the intenal loop in "read_sensor" is running. The internal loop is intended to run continuously until interrupted by the "stop" button but for demo purposes it is set to 10 interations. Paul Simon begin 666 focusset.py M:6UP;W)T('1I;64*:6UP;W)T('-E@H@(" @<75I=%]B=71T;VXN9F]C=7-?CUZ+FQS=')I<"@G*SXG*2YR2 ](%M="B @9F]R(&<@:6X@>CH*(" @('DN87!P96YD*#$P,"IF;&]A="AG M*2D*"B @=&5X=%]B=71T;VXQ+F1E;&5T92 at Q+C L14Y$*2 @"B @=&5X=%]B M=71T;VXQ+FEN'1?8G5T=&]N,2YC;VYF:6=U#TB,FTB*0IT97AT7V)U M='1O;C$N9W)I9"AR;W<],BP at 8V]L=6UN/3$I"FQA8F5L,3U,86)E;"AF'0](E-405)4(BQF9STB'0](E-T;W B+'9A References: Message-ID: Hi, if it should loop continuously, why don't you put it into a background thread? Or, as you are using sleep() remove the loop and use root.after() to invoce the check method every now and then... brgds, AO 2013/4/9 Paul Simon > Hi All, > > I've attaached code simplified from my "opus" and have a problem. I would > like to exit from "read_sensor" into the main loop. I cannot access the > "stop" check button or the "quit" button while the intenal loop in > "read_sensor" is running. The internal loop is intended to run > continuously > until interrupted by the "stop" button but for demo purposes it is set to > 10 > interations. > > Paul Simon > > > > > _______________________________________________ > 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 kalman_g at verizon.net Wed Apr 10 16:42:58 2013 From: kalman_g at verizon.net (GKalman) Date: Wed, 10 Apr 2013 07:42:58 -0700 (PDT) Subject: [Tkinter-discuss] question on winfo_height Message-ID: <1365604978161-5013753.post@n6.nabble.com> Please look at the following Tkinter code fragment: #*** frm=Frame(root,bg="cyan") frm.pack(side=TOP, fill=BOTH, expand=YES) h= frm.winfo_height() print h, type(h) #*** It returns a value of h=1 and type= int I remember seeing somewhere that the returned a value of h=1 means that it is RELATIVE wrt something. Question: how can I get the ABSOLUTE value for height. BTW: h= frm.cget("height") print h results in a value of h=0 !!! why? -- View this message in context: http://python.6.x6.nabble.com/question-on-winfo-height-tp5013753.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From bryan.oakley at gmail.com Wed Apr 10 17:20:35 2013 From: bryan.oakley at gmail.com (Bryan Oakley) Date: Wed, 10 Apr 2013 10:20:35 -0500 Subject: [Tkinter-discuss] question on winfo_height In-Reply-To: <1365604978161-5013753.post@n6.nabble.com> References: <1365604978161-5013753.post@n6.nabble.com> Message-ID: winfo_height returns the actual, absolute height of the window. It's not relative to anything. The reason the value is 1 is because the frame has yet to be displayed on the screen. It is the actual updating of the screen that gives a widget its dimensions, since that depends on the size of the containing window, how it is packed or gridded, what is inside of the frame, etc. None of that can be determined until the window is actually mapped to the display. Simply calling update will cause it to be displayed and thus give you a reasonable number, though calling update is a relatively risky thing to do. On Wed, Apr 10, 2013 at 9:42 AM, GKalman wrote: > Please look at the following Tkinter code fragment: > > #*** > frm=Frame(root,bg="cyan") > frm.pack(side=TOP, fill=BOTH, expand=YES) > h= frm.winfo_height() > print h, type(h) > #*** > > It returns a value of h=1 and type= int > > I remember seeing somewhere that the returned a value of h=1 means that it > is RELATIVE wrt something. > Question: how can I get the ABSOLUTE value for height. > > BTW: > h= frm.cget("height") > print h > > results in a value of h=0 !!! why? > > > > > -- > View this message in context: http://python.6.x6.nabble.com/question-on-winfo-height-tp5013753.html > Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss From klappnase at web.de Wed Apr 10 19:05:54 2013 From: klappnase at web.de (Michael Lange) Date: Wed, 10 Apr 2013 19:05:54 +0200 Subject: [Tkinter-discuss] question on winfo_height In-Reply-To: References: <1365604978161-5013753.post@n6.nabble.com> Message-ID: <20130410190554.a770507b.klappnase@web.de> Hi, On Wed, 10 Apr 2013 10:20:35 -0500 Bryan Oakley wrote: > winfo_height returns the actual, absolute height of the window. It's > not relative to anything. > > The reason the value is 1 is because the frame has yet to be displayed > on the screen. It is the actual updating of the screen that gives a > widget its dimensions, since that depends on the size of the > containing window, how it is packed or gridded, what is inside of the > frame, etc. None of that can be determined until the window is > actually mapped to the display. > > Simply calling update will cause it to be displayed and thus give you > a reasonable number, though calling update is a relatively risky thing > to do. I think update_idletasks() instead of update() should be sufficient; to query the widget's initial size you can also try the winfo_reqheight() and winfo_reqwidth() methods. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. After a time, you may find that "having" is not so pleasing a thing, after all, as "wanting." It is not logical, but it is often true. -- Spock, "Amok Time", stardate 3372.7 From psimon at sonic.net Thu Apr 11 05:58:52 2013 From: psimon at sonic.net (Paul Simon) Date: Wed, 10 Apr 2013 20:58:52 -0700 Subject: [Tkinter-discuss] Exit from method loop References: Message-ID: Andreas, Thanks very much for the response to my question. Using threading is beyond my programming capability and since I am only occasionally programming would not be worth my time to learn. I'm not clear about the second suggestion you made and would appreciate some clarification. At the moment my intuition is telling me that the sleep statement is the source of the problem, as it might interfere with the check button selection, and the rest of the loop is too fast to catch the "click." I'm going to replace "sleep" with a time delta construction and see if that works any better. Paul "Andreas Ostermann" wrote in message news:CANs6TN+p4YUcqzkrWnfwqaTKvC1_rp5vXhxsgOgKgFYCnUibLA at mail.gmail.com... Hi, if it should loop continuously, why don't you put it into a background thread? Or, as you are using sleep() remove the loop and use root.after() to invoce the check method every now and then... brgds, AO 2013/4/9 Paul Simon Hi All, I've attaached code simplified from my "opus" and have a problem. I would like to exit from "read_sensor" into the main loop. I cannot access the "stop" check button or the "quit" button while the intenal loop in "read_sensor" is running. The internal loop is intended to run continuously until interrupted by the "stop" button but for demo purposes it is set to 10 interations. Paul Simon _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss ------------------------------------------------------------------------------ _______________________________________________ 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 alejandroautalan at gmail.com Thu Apr 11 12:28:41 2013 From: alejandroautalan at gmail.com (Alejandro Autalan) Date: Thu, 11 Apr 2013 07:28:41 -0300 Subject: [Tkinter-discuss] Strange 'tate' option in ttk.Treeview.heading Message-ID: Hello, I'm getting an strange 'tate' property when calling treeview.heading() function. Here is an example: #----- import sys import tkinter as tk import tkinter.ttk as ttk print('Python version:', sys.version_info) print('tk version:', tk.TkVersion) print('ttk version:', ttk.__version__) root = tk.Tk() columns = ('A', 'B', 'C') tv = ttk.Treeview(root, columns=columns ) for col in columns: tv.heading(col, text=col) tv.heading('#0', text='Root') tv.grid() #get heading properties properties= tv.heading('A') # Print strangeous 'tate' property print("strange 'tate' option", properties) properties['anchor'] = tk.E #error trying to set properties tv.heading('A', **properties) root.mainloop() #end This is the output: Python version: sys.version_info(major=3, minor=3, micro=1, releaselevel='final', serial=0) tk version: 8.5 ttk version: 0.3.1 strangeous 'tate' property {'image': '', 'anchor': 'center', 'tate': '', 'command': '', 'text': 'A'} Traceback (most recent call last): File "../tkinter/tate-issue.py", line 24, in tv.heading('A', **properties) File "/usr/lib/python3.3/tkinter/ttk.py", line 1268, in heading return _val_or_dict(kw, self.tk.call, self._w, 'heading', column) File "/usr/lib/python3.3/tkinter/ttk.py", line 311, in _val_or_dict res = func(*(args + options)) _tkinter.TclError: unknown option "-tate" Where this option comes from? Can someone try on another python version? Maybe this is a Bug? Regards Alejandro A -------------- next part -------------- An HTML attachment was scrubbed... URL: From jepler at unpythonic.net Thu Apr 11 14:32:40 2013 From: jepler at unpythonic.net (Jeff Epler) Date: Thu, 11 Apr 2013 07:32:40 -0500 Subject: [Tkinter-discuss] Strange 'tate' option in ttk.Treeview.heading In-Reply-To: References: Message-ID: <20130411123240.GA5954@unpythonic.net> This is an upstream bug in Tk which appears to still be present in their development version. There's supposed to be a "-state" property of treeview columns, but the "-" is missing. Python always removes the first character in its configure-type interfaces, so you get "tate" Compare the definition of "-text" to "state" at lines 296 and 308: http://tktoolkit.cvs.sourceforge.net/viewvc/tktoolkit/tk/generic/ttk/ttkTreeview.c?revision=1.41&view=markup#l295 $ wish8.5 % ttk::treeview .t -columns A .t % .t heading 0 -text {} -image {} -anchor center -command {} state {} % .t heading 0 -state {} unknown option "-state" % .t heading 0 state {} % I did not immediately find a bug about this in the tktoolkit bug tracker. Please consider filing one if you hope for it to be fixed. http://sourceforge.net/search/?group_id=12997&type_of_search=artifact&group_artifact_id=112997&limit=25&q=treeview Jeff From alejandroautalan at gmail.com Thu Apr 11 15:57:19 2013 From: alejandroautalan at gmail.com (Alejandro Autalan) Date: Thu, 11 Apr 2013 10:57:19 -0300 Subject: [Tkinter-discuss] Strange 'tate' option in ttk.Treeview.heading In-Reply-To: <20130411123240.GA5954@unpythonic.net> References: <20130411123240.GA5954@unpythonic.net> Message-ID: 2013/4/11 Jeff Epler : > This is an upstream bug in Tk which appears to still be present in their > development version. There's supposed to be a "-state" property of > treeview columns, but the "-" is missing. Python always removes the > first character in its configure-type interfaces, so you get "tate" > > Compare the definition of "-text" to "state" at lines 296 and 308: > http://tktoolkit.cvs.sourceforge.net/viewvc/tktoolkit/tk/generic/ttk/ttkTreeview.c?revision=1.41&view=markup#l295 > > $ wish8.5 > % ttk::treeview .t -columns A > .t > % .t heading 0 > -text {} -image {} -anchor center -command {} state {} > % .t heading 0 -state {} > unknown option "-state" > % .t heading 0 state {} > % > > I did not immediately find a bug about this in the tktoolkit bug > tracker. Please consider filing one if you hope for it to be fixed. > http://sourceforge.net/search/?group_id=12997&type_of_search=artifact&group_artifact_id=112997&limit=25&q=treeview > > Jeff Hello, Jeff Thanks for the answer. I was curious about where that option was coming from because it is not documented (at least I don't see it at http://www.tcl.tk/man/tcl8.6/TkCmd/ttk_treeview.htm) I will try to fill a bug report when I finish my little experiment. Regards. Alejandro A. From kw at codebykevin.com Thu Apr 11 16:19:05 2013 From: kw at codebykevin.com (Kevin Walzer) Date: Thu, 11 Apr 2013 10:19:05 -0400 Subject: [Tkinter-discuss] Strange 'tate' option in ttk.Treeview.heading In-Reply-To: <20130411123240.GA5954@unpythonic.net> References: <20130411123240.GA5954@unpythonic.net> Message-ID: <5166C659.3080805@codebykevin.com> Hi Jeff, I don't think you're correct on this point. On 4/11/13 8:32 AM, Jeff Epler wrote: > This is an upstream bug in Tk which appears to still be present in their > development version. There's supposed to be a "-state" property of > treeview columns, but the "-" is missing. Python always removes the > first character in its configure-type interfaces, so you get "tate" The ttk widgets handle some things differently than the standard Tk widgets. According to the man page (of Tk 8.5 at http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_treeview.htm, with the ttk widgets, "state" is a command rather than a configuration option: pathname state ?stateSpec? Modify or query the widget state; see ttk::widget(n). Therefore, rather than Tk being wrong, Python is doing the wrong thing by mangling the command. > > Compare the definition of "-text" to "state" at lines 296 and 308: > http://tktoolkit.cvs.sourceforge.net/viewvc/tktoolkit/tk/generic/ttk/ttkTreeview.c?revision=1.41&view=markup#l295 For what it's worth, here is the core repo for Tcl/Tk now: http://core.tcl.tk. The project shifted its SCM from CVS to Fossil (http://fossil-scm.org/) about a year ago. I do understand the confusion. In the ttk widget C code, "state" is grouped among the configuration options, and its purpose is to set configuration, but it does so as a command, not as a flag passed to the "configure" command. I'm not sure why it was implemented this way, but that does appear to be its design. Perhaps someone should file a bug against Python to make sure it's implemented correctly in Tkinter? --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com From klappnase at freenet.de Tue Apr 16 20:56:17 2013 From: klappnase at freenet.de (Michael Lange) Date: Tue, 16 Apr 2013 20:56:17 +0200 Subject: [Tkinter-discuss] Strange 'tate' option in ttk.Treeview.heading In-Reply-To: <5166C659.3080805@codebykevin.com> References: <20130411123240.GA5954@unpythonic.net> <5166C659.3080805@codebykevin.com> Message-ID: <20130416205617.74d134aa.klappnase@freenet.de> On Thu, 11 Apr 2013 10:19:05 -0400 Kevin Walzer wrote: > The ttk widgets handle some things differently than the standard Tk > widgets. According to the man page (of Tk 8.5 at > http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_treeview.htm, with the ttk > widgets, "state" is a command rather than a configuration option: > > pathname state ?stateSpec? > Modify or query the widget state; see ttk::widget(n). > > Therefore, rather than Tk being wrong, Python is doing the wrong thing > by mangling the command. But Jeff does not talk about the widget command, but about the option to the heading command. > > > > > Compare the definition of "-text" to "state" at lines 296 and 308: > > http://tktoolkit.cvs.sourceforge.net/viewvc/tktoolkit/tk/generic/ttk/ttkTreeview.c?revision=1.41&view=markup#l295 > > For what it's worth, here is the core repo for Tcl/Tk now: > http://core.tcl.tk. The project shifted its SCM from CVS to Fossil > (http://fossil-scm.org/) about a year ago. > > I do understand the confusion. In the ttk widget C code, "state" is > grouped among the configuration options, and its purpose is to set > configuration, but it does so as a command, not as a flag passed to the > "configure" command. I'm not sure why it was implemented this way, but > that does appear to be its design. Perhaps someone should file a bug > against Python to make sure it's implemented correctly in Tkinter? Hmm, I think however that the usage of "state" in the heading command, where you can do e.g.: % .t heading 0 -anchor e state disabled -text foo is probably at least rather counter-intuitive even for tcl programmers. In this context "state" (at least to me) clearly looks like an option, not like a command and should therefore be preceded by a "-". And since the state option for the heading command is not documented in the treeview man page its behavior might still be a subject to be changed, so I doubt if it makes much sense to add a workaround to ttk.py now. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. No more blah, blah, blah! -- Kirk, "Miri", stardate 2713.6 From anass.ouhammou at gmail.com Tue Apr 23 21:59:00 2013 From: anass.ouhammou at gmail.com (Ouhammouchane anass) Date: Tue, 23 Apr 2013 19:59:00 +0000 Subject: [Tkinter-discuss] Aide Message-ID: Bonsoir , Svp, je travaille sur un projet sur QGIS, et je suis amen? ? d?velopper une extension qui va automatiser des requ?tes.Je voulais savoir est ce qu'il y'a des documentations pour faire ?a. Merci -- -- OUHAMMOUCHANE Anass *?l?ve Ing?nieur Topographe. Ecole des Sciences G?omatiques et Ing?nierie Topographique. IAV Hassan II - Rabat,Maroc GSM: +212 6 37 09 19 50* -------------- next part -------------- An HTML attachment was scrubbed... URL: