From mkieverpy at tlink.de Mon Dec 3 13:20:57 2007 From: mkieverpy at tlink.de (mkieverpy at tlink.de) Date: Mon, 03 Dec 2007 12:20:57 -0000 Subject: [Tkinter-discuss] General Doubt about tkinter windows... Message-ID: <20071203111957.5A025C2D3@mail.terralink.de> Hi Jos?, >I am trying to develop a simple application in python (I am very newby), but >I have some general doubts my main window is Tk(), I am using grid manager, >and when in the application user changes the view, what I do is take a frame >out of the grid and put another one (and sometimes there are position >changes of other remaining frames :-S). My doubt is how can I change the >window?? Because if I use Toplevel window, main window remains under it, and >user can also continue changing it, what I don?t want, I just want one >active window in every moment. Could you give me some hints of how doing it? please state your problem more clearly. Also: Try to ask one question at a time. At the moment I can only guess: Is your problem about modal / non-modal dialogs like in a 'file-open'- or 'colour-chooser'-dialog? Regards, Matthias Kievernagel (mkiever/at/web/dot/de) From jigisbert.etra-id at grupoetra.com Wed Dec 5 08:36:19 2007 From: jigisbert.etra-id at grupoetra.com (Jose Ignacio Gisbert) Date: Wed, 5 Dec 2007 08:36:19 +0100 Subject: [Tkinter-discuss] RV: Receiving messages blocks all :-( Message-ID: <001501c83711$88b4a150$2000a8c0@depid.local> First, sorry for sending this mail to this list, I know this is off-topic, but xmpppy-devel mailing list is out of work :-( If someone uses xmpppy, please try to answer me, or at least give me a more adequate mailing list, please. Thank you. ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- --------- Hi all, I am a newby in xmppy, and I want to make a very simple messaging jabber client. As I read from different tutorials, it seems very easy, in fact, I can send messages to other jabber clients from my ?poor? application, but the problem appears when I try to receive messages. I do more or less what Sebastian Moors explains in his ?xmpppy: a practical guide?, i.e (code fragment): def StepOn(conn): try: conn.Process(1) except KeyboardInterrupt: return 0 return 1 def GoOn(conn): while StepOn(conn): pass cl=xmpp.Client(jid.getDomain(),debug=[]) cl.connect() cl.auth(jid.getNode(),jidparams['password']) cl.sendInitPresence() cl.RegisterHandler('message',messageCB) cl.RegisterHandler('presence',presenceCB) GoOn(cl) But when my application enters in GoOn loop, it completely freezes (I have to shut down it by force). Anyone knows why or knows another solution for receiving messages?, I?m using Windows but I don?t think it is the problem. Thanks in advance, best regards, _______________________________ Jos? Ignacio Gisbert Sanus -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071205/f9437997/attachment.htm From n3atione at hotmail.com Thu Dec 6 03:07:51 2007 From: n3atione at hotmail.com (Alex Garipidis) Date: Thu, 6 Dec 2007 04:07:51 +0200 Subject: [Tkinter-discuss] How can I edit a string inside a textbox? In-Reply-To: <8249c4ac0712050953t129ea0d2ob002060fe577b0b1@mail.gmail.com> References: <8249c4ac0712050953t129ea0d2ob002060fe577b0b1@mail.gmail.com> Message-ID: //This was originally posted on the python-win32 mailing list where it clearly didn't belong... Sorry for the inconvenience, I hope I did it right this time! Hello everybody, I have a Tkinter Textbox in my application. I want to scan the textbox for a symbol, defined by me as a "mark", and change the word that is inside or next to that symbol. This is what i mean: If a user types this to the textbox: "Hello @everybody, how are you doing?" I want to scan this string for the "@" character (or something else) and edit the word next to it (or "inside" it, e.g. "@everybody@"), "everybody" in this case, and make it have a color for example or make it underlined. I suspect that the answer is in the tag methods of Textbox but so far I haven't found an answer yet. Maybe I'm looking in the wrong direction :) Thank you all _________________________________________________________________ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071206/eb9adb54/attachment.htm From fredrik at pythonware.com Thu Dec 6 12:27:17 2007 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 06 Dec 2007 12:27:17 +0100 Subject: [Tkinter-discuss] How can I edit a string inside a textbox? In-Reply-To: References: <8249c4ac0712050953t129ea0d2ob002060fe577b0b1@mail.gmail.com> Message-ID: Alex Garipidis wrote: > I have a Tkinter Textbox in my application. I want to scan the > textbox for a symbol, defined by me as a "mark", and > change the word that is inside or next to that symbol. > > This is what i mean: > > If a user types this to the textbox: > > "Hello @everybody, how are you doing?" > > I want to scan this string for the "@" character (or something > else) and edit the word next to it (or "inside" it, e.g. > "@everybody@"), "everybody" in this case, and make it have > a color for example or make it underlined. to find things in a text widget, use the "search" method: pos = text.search(string, start) where "string" is the string you want to search for, and start is the starting position (e.g. 1.0 or INSERT). to search for things that match "@word", where "word" is an arbitrary string of letters or digits, you can use a regular expression, e.g. pos = text.search("@\w+", 1.0, regexp=True) search only returns where the match begins; to find the end of "@word", you can search from the given position to the first thing that isn't a word character: end = text.search("\W", pos + " 1 char", regexp=True) to change the appearance of a block of text, register the style using tag_config, and then use tag_add to apply the style tag to the block, e.g.: # do this when you create the widget text.tag_config("mystyle", foreground="red") # do this to apply this style to a range of text text.tag_add("mystyle", pos, end) hope this helps! From n3atione at hotmail.com Thu Dec 6 17:37:16 2007 From: n3atione at hotmail.com (Alex Garipidis) Date: Thu, 6 Dec 2007 18:37:16 +0200 Subject: [Tkinter-discuss] How can I edit a string inside a textbox? In-Reply-To: References: <8249c4ac0712050953t129ea0d2ob002060fe577b0b1@mail.gmail.com> Message-ID: > to find things in a text widget, use the "search" method:> > pos = text.search(string, start)> > where "string" is the string you want to search for, and start is the > starting position (e.g. 1.0 or INSERT).> > to search for things that match "@word", where "word" is an arbitrary > string of letters or digits, you can use a regular expression, e.g.> > pos = text.search("@\w+", 1.0, regexp=True)> > search only returns where the match begins; to find the end of "@word", > you can search from the given position to the first thing that isn't a > word character:> > end = text.search("\W", pos + " 1 char", regexp=True)> > to change the appearance of a block of text, register the style using > tag_config, and then use tag_add to apply the style tag to the block, e.g.:> > # do this when you create the widget> text.tag_config("mystyle", foreground="red")> > # do this to apply this style to a range of text> text.tag_add("mystyle", pos, end)> > hope this helps!> > > > _______________________________________________> Tkinter-discuss mailing list> Tkinter-discuss at python.org> http://mail.python.org/mailman/listinfo/tkinter-discuss Hello Fredric, Thank you for your answer. I am experiencing some problems with the code you suggested. The end = text.search("\W", pos + " 1 char", regexp=True) gives me this as a result: TclError: bad text index " 1 char". I tried some other options for the " 1 char" part but the result was the same. Any ideas? I am using Windows XP and Python 2.5. Thanks again for the answer, Alex _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071206/15b163e7/attachment.htm From fredrik at pythonware.com Thu Dec 6 22:42:53 2007 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 06 Dec 2007 22:42:53 +0100 Subject: [Tkinter-discuss] How can I edit a string inside a textbox? In-Reply-To: References: <8249c4ac0712050953t129ea0d2ob002060fe577b0b1@mail.gmail.com> Message-ID: Alex Garipidis wrote: > Thank you for your answer. I am experiencing some problems with the code > you suggested. The > > end = text.search("\W", pos + " 1 char", regexp=True) > > gives me this as a result: TclError: bad text index " 1 char". oops, transcription error. try: end = text.search("\W", pos + " + 1c", regexp=True) or just end = text.search("\W", pos + "+1c", regexp=True) From bob at greschke.com Fri Dec 7 02:41:52 2007 From: bob at greschke.com (Bob Greschke) Date: Thu, 6 Dec 2007 18:41:52 -0700 Subject: [Tkinter-discuss] Using floats in canvas X,Ys In-Reply-To: References: <8249c4ac0712050953t129ea0d2ob002060fe577b0b1@mail.gmail.com> Message-ID: If someone knows this off the top of their head... If I plot a line or a rectangle or something (Canvas.create_???) and pass floats for the X's and Y's where will the items actually be plotted? Like if I pass an X of 654.2 and one of 654.7 what pixel will actually be used? 654 and 655, or both 654, or both 655? I'm too weary from trying to get a graphing routine that the user can click on and zoom in on a portion of a graph to write any more code to figure it out! :) Come to think of it I'm not even sure how I would do it. Thanks a bunch! Bob From carlgiesberts at hotmail.com Sun Dec 9 20:47:59 2007 From: carlgiesberts at hotmail.com (CarlG) Date: Sun, 9 Dec 2007 11:47:59 -0800 (PST) Subject: [Tkinter-discuss] Canvas margins? Message-ID: <14242512.post@talk.nabble.com> I am just starting out with Tkinter, but I am sort of a perfectionist... I am not quite sure how things work exactly with sizes and positions, but I've run into something to which I see no apparent solution.. I create a window, and give that a background-color and a width and height. This works fine, but when I add a canvas to the window, this canvas seems to have a margin of several pixels on all sides, thus making the window wider and higher. Can this be removed in any way? Has it got to do with an option I a missing, or with the anchoring or positioning of the canvas? Any help would be appreciated, Carl -- View this message in context: http://www.nabble.com/Canvas-margins--tp14242512p14242512.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From carlgiesberts at hotmail.com Sun Dec 9 22:36:19 2007 From: carlgiesberts at hotmail.com (CarlG) Date: Sun, 9 Dec 2007 13:36:19 -0800 (PST) Subject: [Tkinter-discuss] Canvas margins? In-Reply-To: <14242512.post@talk.nabble.com> References: <14242512.post@talk.nabble.com> Message-ID: <14243575.post@talk.nabble.com> I thought I'd paste the code I use: root = Tk() tk_bg = "#%02x%02x%02x" % (255, 255, 224) #beige background root.config(bg=tk_bg, width=300, height=500) canvas = Canvas(root,width=300, height=500,bg=tk_bg) If I don't add the canvas, then the window is actually 300 by 500 and has the background color. With the canvas, the canvas is that size, and stretches the window a bit by having white borders/margins... -- View this message in context: http://www.nabble.com/Canvas-margins--tp14242512p14243575.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From bob at greschke.com Mon Dec 10 01:19:18 2007 From: bob at greschke.com (Bob Greschke) Date: Sun, 9 Dec 2007 17:19:18 -0700 Subject: [Tkinter-discuss] Canvas margins? In-Reply-To: <14243575.post@talk.nabble.com> References: <14242512.post@talk.nabble.com> <14243575.post@talk.nabble.com> Message-ID: <36CA9ED8-1BC0-4466-A63C-9E21DB27F9A4@greschke.com> Set the bd to 0: Canvas(Frm, width = x, height = ... bd = 0) Most, if not all, systems add a border (like a width of 2 or so pixels) to the Canvas and the pixel counts get thrown off by that amount when you are trying to figure out the size of the Canvas and/or where to put things on the Canvas. If you need a border to make things look good (like a sunken border around a graphing area) make a sub-Frame of your root window and set its border width to 2 or whatever, relief to SUNKEN, and then stick your canvas on to it. Bob On 2007-12-09, at 14:36, CarlG wrote: > > I thought I'd paste the code I use: > > root = Tk() > tk_bg = "#%02x%02x%02x" % (255, 255, 224) #beige background > > root.config(bg=tk_bg, width=300, height=500) > > canvas = Canvas(root,width=300, height=500,bg=tk_bg) > > If I don't add the canvas, then the window is actually 300 by 500 > and has > the background color. With the canvas, the canvas is that size, and > stretches the window a bit by having white borders/margins... > -- > View this message in context: http://www.nabble.com/Canvas-margins--tp14242512p14243575.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 carlgiesberts at hotmail.com Mon Dec 10 19:15:16 2007 From: carlgiesberts at hotmail.com (CarlG) Date: Mon, 10 Dec 2007 10:15:16 -0800 (PST) Subject: [Tkinter-discuss] Canvas margins? In-Reply-To: <36CA9ED8-1BC0-4466-A63C-9E21DB27F9A4@greschke.com> References: <14242512.post@talk.nabble.com> <14243575.post@talk.nabble.com> <36CA9ED8-1BC0-4466-A63C-9E21DB27F9A4@greschke.com> Message-ID: <14258270.post@talk.nabble.com> Bob, I tried what you suggested, but the canvas maintains it's edge. I create the window, Tk(), I create the Frame and add it to the window, then I create the canvas. Whatever I try with bd=0 on the canvas... and borders on the frame, the canvas always has this white border outside its own border. There seems to be nothing I can do about it. Could it have to do with the order in which things are packed or fit to grid? Carl Bob Greschke wrote: > > Set the bd to 0: Canvas(Frm, width = x, height = ... bd = 0) > > Most, if not all, systems add a border (like a width of 2 or so > pixels) to the Canvas and the pixel counts get thrown off by that > amount when you are trying to figure out the size of the Canvas and/or > where to put things on the Canvas. If you need a border to make > things look good (like a sunken border around a graphing area) make a > sub-Frame of your root window and set its border width to 2 or > whatever, relief to SUNKEN, and then stick your canvas on to it. > > Bob > > On 2007-12-09, at 14:36, CarlG wrote: > >> >> I thought I'd paste the code I use: >> >> root = Tk() >> tk_bg = "#%02x%02x%02x" % (255, 255, 224) #beige background >> >> root.config(bg=tk_bg, width=300, height=500) >> >> canvas = Canvas(root,width=300, height=500,bg=tk_bg) >> >> If I don't add the canvas, then the window is actually 300 by 500 >> and has >> the background color. With the canvas, the canvas is that size, and >> stretches the window a bit by having white borders/margins... >> -- >> View this message in context: >> http://www.nabble.com/Canvas-margins--tp14242512p14243575.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 >> > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > -- View this message in context: http://www.nabble.com/Canvas-margins--tp14242512p14258270.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From ironfroggy at socialserve.com Tue Dec 11 08:08:00 2007 From: ironfroggy at socialserve.com (Calvin Spealman) Date: Tue, 11 Dec 2007 02:08:00 -0500 Subject: [Tkinter-discuss] tk, scrollwheels, and osx Message-ID: <9D7C136E-022F-4D25-BE1C-C24FAEE5D082@socialserve.com> I've noticed this even outside of Python, but I have seen tk have problems dealing with mouse wheels (ie, doesn't see them at all) on OS X and even bad scrolling behavior like locking or jerky movement, especially for downward movement. Is there some known issue here, like the lack of handling certain events? There is a bug report about this from someone having issues scrolling IDLE. http://bugs.python.org/issue1574 From n3atione at hotmail.com Tue Dec 11 11:58:33 2007 From: n3atione at hotmail.com (Alex Garipidis) Date: Tue, 11 Dec 2007 12:58:33 +0200 Subject: [Tkinter-discuss] How can I edit a string inside a textbox? Message-ID: > oops, transcription error. try: > > end = text.search("\W", pos + " + 1c", regexp=True) > > or just > > end = text.search("\W", pos + "+1c", regexp=True) > > Hi Fredrik, thanks again for your answer :). Unfortunately I get the same error message with the "+1c"... "Bad text index +1c". Thank you for your time, Alex _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071211/6d4e4e9d/attachment.htm From michael.odonnell at uam.es Tue Dec 11 13:38:48 2007 From: michael.odonnell at uam.es (Mick O'Donnell) Date: Tue, 11 Dec 2007 04:38:48 -0800 (PST) Subject: [Tkinter-discuss] Canvas margins? In-Reply-To: <14258270.post@talk.nabble.com> References: <14242512.post@talk.nabble.com> <14243575.post@talk.nabble.com> <36CA9ED8-1BC0-4466-A63C-9E21DB27F9A4@greschke.com> <14258270.post@talk.nabble.com> Message-ID: <14273030.post@talk.nabble.com> >From CarlG carlgiesberts at hotmail.com: > I tried what you suggested, but the canvas maintains it's edge. What you need is: canvas = Canvas(root,width=300, height=500,bg=tk_bg, highlightthickness=0) Mick -- View this message in context: http://www.nabble.com/Canvas-margins--tp14242512p14273030.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From michael.odonnell at uam.es Tue Dec 11 13:48:57 2007 From: michael.odonnell at uam.es (Mick O'Donnell) Date: Tue, 11 Dec 2007 04:48:57 -0800 (PST) Subject: [Tkinter-discuss] How can I edit a string inside a textbox? In-Reply-To: References: Message-ID: <14273355.post@talk.nabble.com> From: Alex Garipidis > thanks again for your answer :). Unfortunately I get the same error > message with the "+1c"... "Bad text > index +1c". Alex, the following coder works for me under Python 2.5 under Windows XP: from Tkinter import * root = Tk() tw = Text(root) tw.insert(END, "The @cat sat on the mat.") tw.pack() root.update() pos=tw.search("@", "1.0") end = tw.search("\W", pos + "+1c", regexp=True) print pos, end If it fails on your setup, what version of Python do you have? What Platform? Mick -- View this message in context: http://www.nabble.com/How-can-I-edit-a-string-inside-a-textbox--tp14271911p14273355.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From rowen at cesmail.net Fri Dec 21 20:08:44 2007 From: rowen at cesmail.net (Russell E. Owen) Date: Fri, 21 Dec 2007 11:08:44 -0800 Subject: [Tkinter-discuss] Shortcut for trying Tcl/Tk 8.5 with Mac Python? Message-ID: I'd like to try out Aqua Tcl/Tk 8.5 with my Python* and was hoping for a quicker way than building a new python from source. I didn't expect this to work, but I tried modifying _tkinter.so so it found Tck/Tk 8.5. Not surprisingly "import Tkinter" then refused to load complaining about finding 8.5 instead of 8.4 in the headers. Better that than mysterious crashes! I suspect the recipe is to build a new version of python from source and save the _tkinter.so. Then I can switch back and forth between Tcl/Tk versions by just swapping that one file. Is there an easier way? Or has somebody already built a _tkinter.so for Aqua Tcl/Tk 8.5 that they'd be willing to share? If not I'll build one and make it available. -- Russell *If you are wondering "why the hurry?" it's because my application does not work well with any of the available universal versions of Tcl/Tk and I really want to release the app as a universal binary. All universal Tcl/Tk prior to 8.4.16 sometimes have an offset in the reported mouse position which causes grief in a graphical offsetter. 8.4.16 seems to fix that, but introduces a nasty memory leak (which a recent poster traced to the Text widget related to deleting and adding lines). From michael.odonnell at uam.es Sat Dec 22 09:50:56 2007 From: michael.odonnell at uam.es (Michael O'Donnell) Date: Sat, 22 Dec 2007 09:50:56 +0100 Subject: [Tkinter-discuss] TkAqua question Message-ID: <47e491110712220050g5367de0cyb5b09c6e6a538dd0@mail.gmail.com> Hi all, I distribute a Python/Tkinter application, on Macintosh and Windows. A recurring problem is that Tkinter on Mac assumes the TKAqua libraries are resident on the machine, and that these libraries are version 8.4. On MacOSX 1.3 this is not so, so I tell my users to install TclTkAqua8.4.10 from the sourceforge repository. Fine. But now I have a PPC Mac user running OSX 10.4 who has installed the latest version of TkAqua, 8.5, for other reasons, and now Tkinter doesn't work. What I want to do to fix all these problems is to include the TclTkAqua 8.4 libraries in my distribution, and tell Tkinter where it should look for the libraries. Is this possible? Mick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071222/f412a907/attachment.htm From kw at codebykevin.com Sat Dec 22 15:45:31 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Sat, 22 Dec 2007 09:45:31 -0500 Subject: [Tkinter-discuss] TkAqua question In-Reply-To: <47e491110712220050g5367de0cyb5b09c6e6a538dd0@mail.gmail.com> References: <47e491110712220050g5367de0cyb5b09c6e6a538dd0@mail.gmail.com> Message-ID: <476D230B.9090706@codebykevin.com> Michael O'Donnell wrote: > Hi all, > > I distribute a Python/Tkinter application, on Macintosh and Windows. > > A recurring problem is that Tkinter on Mac assumes the TKAqua libraries > are resident on the machine, and that these libraries are version 8.4. > > On MacOSX 1.3 this is not so, so I tell my users to install TclTkAqua8.4.10 > from the sourceforge repository. > > Fine. But now I have a PPC Mac user running OSX 10.4 who has installed > the latest version of TkAqua, 8.5, for other reasons, and now Tkinter > doesn't > work. > > What I want to do to fix all these problems is to include the TclTkAqua 8.4 > libraries in my distribution, and tell Tkinter where it should look for the > libraries. > > Is this possible? > > Mick Just include the Tk-Aqua frameworks in your application package with py2app. This is how I distribute my Tkinter application on the Mac. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From kw at codebykevin.com Sat Dec 22 17:21:28 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Sat, 22 Dec 2007 11:21:28 -0500 Subject: [Tkinter-discuss] TkAqua question In-Reply-To: <47e491110712220818t289c8aa3leda4710698283c95@mail.gmail.com> References: <47e491110712220050g5367de0cyb5b09c6e6a538dd0@mail.gmail.com> <476D230B.9090706@codebykevin.com> <47e491110712220818t289c8aa3leda4710698283c95@mail.gmail.com> Message-ID: <476D3988.2010602@codebykevin.com> Michael O'Donnell wrote: > Hi Kevin, > > Do you mean something like: > > APP = ['MyApp.py'] > DATA_FILES = [] > OPTIONS = {'argv_emulation': True, 'resources': > ['/Library/Frameworks/Tk.framework/Versions/8.4/Tk']} > > setup( > app=APP, > data_files=DATA_FILES, > options={'py2app': OPTIONS}, > setup_requires=['py2app'], > ) > > Do I have to tell Tkinter where to find the framework? > py2app looks in /Library/Frameworks by default to find Tcl and Tk. It won't wrap the stuff that Apple provides in /System/Library. If you have a universal build of Tcl/Tk 8.4.x in /Library/Frameworks you should be fine. You also need to make sure that you wrap both Tcl and Tk, Tk won't work without Tcl.framework being included also. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From kw at codebykevin.com Sat Dec 22 17:53:20 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Sat, 22 Dec 2007 11:53:20 -0500 Subject: [Tkinter-discuss] TkAqua question In-Reply-To: <47e491110712220843p4efd9008x69431ebdc8f947b@mail.gmail.com> References: <47e491110712220050g5367de0cyb5b09c6e6a538dd0@mail.gmail.com> <476D230B.9090706@codebykevin.com> <47e491110712220818t289c8aa3leda4710698283c95@mail.gmail.com> <476D3988.2010602@codebykevin.com> <47e491110712220843p4efd9008x69431ebdc8f947b@mail.gmail.com> Message-ID: <476D4100.2090804@codebykevin.com> Michael O'Donnell wrote: > > I am a bit confused. Why should p2app look for Tcl and Tk anyway? > Would it not be up to the executable produced by py2app to look > for these? And wouldn't that be part of the code of Tkinter? py2app has various flags that you can set specifying what to include. If your app uses Tkinter, py2app by default looks for the Tcl/Tk frameworks and wraps those up into the final application bundle. > > If I package the tcl and tk frameworks using Py2app, then they > end up within my application, with a pathname relative to the > application. So how does Tkinter, when it runs within my application, > know where to find the frameworks? It has a set of default > locations to look I believe? Don't I need to tell it where to look? > By setting an environmental veriable or such? py2app executes a Mac command-line tool (install_name_tool) that modifies where the final wrapped executable looks for its libraries. It handles all this stuff for you, in other words. If you want to find out more about how py2app works, look at its documentation--it has a lot of options. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From rowen at cesmail.net Thu Dec 27 06:20:04 2007 From: rowen at cesmail.net (Russell E. Owen) Date: Wed, 26 Dec 2007 21:20:04 -0800 Subject: [Tkinter-discuss] Running Python 2.5 with Aqua Tcl/Tk 8.5.0 Message-ID: If you would like to run Python 2.5 with Tcl/Tk 8.5.0... Kevin Waltzer was kind enough to send me a copy of his _tkinter.so and gave me permission to serve it. I just put it up here: along with brief installation instructions. This saves the trouble of rebuilding Python to work with Tcl/Tk 8.5 and makes it fairly easy to switch back and forth. I have an application that makes very heavy use of Tcl/Tk. I have not tested it extensively yet but so far it seems to work just fine. I have found only two issues: * The index method of the Text widget returns a Tcl object instead of a string. That meant I had to change one line in my code to put str() around the value. Not bad! * The vertical spacing between widgets has grown a bit so my windows are taller. However, people on MacOS X 10.5 may see repeated error messages about threading in your log file. This seems to be a known issue but I am not aware of a solution (though it is possible that rebuilding Tcl/Tk with threading disabled would resolve it). Kevin and others can say more about this than I can -- I'm still on 10.4. -- Russell From amit.finkler at gmail.com Mon Dec 31 13:56:55 2007 From: amit.finkler at gmail.com (Amit Finkler) Date: Mon, 31 Dec 2007 14:56:55 +0200 Subject: [Tkinter-discuss] Entry Widget - Setting a Default Text Message-ID: <4778E717.1050804@gmail.com> Hi, I'm building a GUI for my system using Tkinter. I created the following Entry and Label widgets: from Tkinter import * win = Tk() f2 = Frame(win, bd = 2, relief = 'groove') Lake_adr = StringVar() LakeAdr = Entry(f2, textvariable = Lake_adr) LakeAdrLabel = Label(f2, text = 'Lakeshore address') LakeAdr.grid(row = 1, column = 0) LakeAdrLabel.grid(row = 0, column = 0) f2.pack() What I want to do is to have a default value already appearing in this entry widget, which other functions can take using something like lake = int(LakeAdr.get()) and if I change the entry myself, these other functions, of course, will take the value I manually wrote. How do I do that? Thanks, Amit. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071231/473f74c4/attachment.htm From godson.g at gmail.com Mon Dec 31 15:05:56 2007 From: godson.g at gmail.com (Godson Gera) Date: Mon, 31 Dec 2007 19:35:56 +0530 Subject: [Tkinter-discuss] Entry Widget - Setting a Default Text In-Reply-To: <4778E717.1050804@gmail.com> References: <4778E717.1050804@gmail.com> Message-ID: On Dec 31, 2007 6:26 PM, Amit Finkler wrote: > Hi, > > > I'm building a GUI for my system using Tkinter. I created the following > Entry and Label widgets: > > > from Tkinter import * > > > win = Tk() > > f2 = Frame(win, bd = 2, relief = 'groove') > > > Lake_adr = StringVar() > > LakeAdr = Entry(f2, textvariable = Lake_adr) > > LakeAdrLabel = Label(f2, text = 'Lakeshore address') > > > LakeAdr.grid(row = 1, column = 0) > LakeAdrLabel.grid(row = 0, column = 0) > > > f2.pack() > > > What I want to do is to have a default value already appearing in this > entry widget, which other functions can take using something like > > Hi Amit, just call the set method of StringVar with the default value before you use it. Like below from Tkinter import* win= Tk() f2= Frame(win, bd = 2, relief = 'groove') Lake_adr = StringVar() Lake_adr.set("123") LakeAdr = Entry(f2, textvariable = Lake_adr) LakeAdrLabel = Label(f2, text = 'Lakeshore address') LakeAdr.grid(row= 1, column = 0) LakeAdrLabel.grid(row = 0, column = 0) f2.pack() How ever if you are only dealing with integers you can use IntVar -- Godson Gera, http://godson.in -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071231/91eb2c60/attachment.htm From amit.finkler at gmail.com Mon Dec 31 15:07:55 2007 From: amit.finkler at gmail.com (Amit Finkler) Date: Mon, 31 Dec 2007 16:07:55 +0200 Subject: [Tkinter-discuss] Entry Widget - Setting a Default Text In-Reply-To: References: <4778E717.1050804@gmail.com> Message-ID: <4778F7BB.4030908@gmail.com> Godson Gera wrote: > > > On Dec 31, 2007 6:26 PM, Amit Finkler > wrote: > > Hi, > > > I'm building a GUI for my system using Tkinter. I created the > following Entry and Label widgets: > > > from Tkinter import * > > > win = Tk() > > f2 = Frame(win, bd = 2, relief = 'groove') > > > Lake_adr = StringVar() > > LakeAdr = Entry(f2, textvariable = Lake_adr) > > LakeAdrLabel = Label(f2, text = 'Lakeshore address') > > > LakeAdr.grid(row = 1, column = 0) > LakeAdrLabel.grid(row = 0, column = 0) > > > f2.pack() > > > What I want to do is to have a default value already appearing in > this entry widget, which other functions can take using something like > > > Hi Amit, > > just call the set method of StringVar with the default value before > you use it. Like below > > from Tkinter import* > > win= Tk() > > f2= Frame(win, bd = 2, relief = 'groove') > > Lake_adr = StringVar() > Lake_adr.set("123") > LakeAdr = Entry(f2, textvariable = Lake_adr) > > LakeAdrLabel = Label(f2, text = 'Lakeshore address') > > > LakeAdr.grid(row= 1, column = 0) > LakeAdrLabel.grid(row = 0, column = 0) > > > f2.pack() > > How ever if you are only dealing with integers you can use IntVar > -- > Godson Gera, > http://godson.in Beautiful! It works. Thanks, Amit. > ------------------------------------------------------------------------ > > _______________________________________________ > 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: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071231/1638a16e/attachment.htm From Bernard.B.Yoo at aero.org Mon Dec 31 19:49:31 2007 From: Bernard.B.Yoo at aero.org (Bernard B Yoo) Date: Mon, 31 Dec 2007 10:49:31 -0800 Subject: [Tkinter-discuss] redirecting Python stdout/stderr to a Tkinter text widget from an embedded Python application Message-ID: Hi, I have a Python module that redirects stdout/stderr to a Tkinter text widget. When I run this from the Python interpreter, it behaves as I expect. When I run it from a Python batch file, it also behaves as expected. When I embed the module in a C program, the Tkinter text widget does not appear. Is there something special I must do in embedded Python programs to make Tkinter widgets appear? Bernard B. Yoo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071231/026d3e14/attachment.htm