From cam at bitflipper.ca Thu Jan 4 04:26:30 2007 From: cam at bitflipper.ca (Cam) Date: Wed, 03 Jan 2007 22:26:30 -0500 Subject: [Tkinter-discuss] Grid In-Reply-To: References: Message-ID: <459C73E6.7030003@bitflipper.ca> Any grid experts about? This minimal Tkinter program: from Tkinter import * root = Tk() root.geometry('640x480') B = Button(root) B.grid(column=0,row=0,sticky='wn') root.mainloop() produces a top-level with a Button centered in it. But I don't want the button in the middle, I want it in the upper left where you would sort of expect (0,0) to be. I thought the sticky option might do that but it doesn't. If it was just one button I'd use pack. But it's a bunch of buttons and they really need to be arranged in an array so I'm pretty much stuck with the grid manager. Anybody know what I'm doing wrong? Thanks Cam Farnell From mikael at isy.liu.se Thu Jan 4 12:58:57 2007 From: mikael at isy.liu.se (Mikael Olofsson) Date: Thu, 04 Jan 2007 12:58:57 +0100 Subject: [Tkinter-discuss] Grid In-Reply-To: <459C73E6.7030003@bitflipper.ca> References: <459C73E6.7030003@bitflipper.ca> Message-ID: <459CEC01.9010504@isy.liu.se> Cam wrote: > Any grid experts about? This minimal Tkinter program: > > from Tkinter import * > root = Tk() > root.geometry('640x480') > B = Button(root) > B.grid(column=0,row=0,sticky='wn') > root.mainloop() > > produces a top-level with a Button centered in it. But I don't want the > button in the middle, I want it in the upper left where you would sort > of expect (0,0) to be. I thought the sticky option might do that but > it doesn't. You need to configure the grid, which is done using the methods grid_columnconfigure and grid_rowconfigure. The following produces a grid with two rows and two colums and places your Button where you want it: from Tkinter import * root = Tk() root.geometry('640x480') root.grid_columnconfigure( 0, minsize=100, pad=5, weight=1 ) root.grid_columnconfigure( 1, minsize=100, pad=5, weight=1 ) root.grid_rowconfigure( 0, minsize=100, pad=5, weight=1 ) root.grid_rowconfigure( 1, minsize=100, pad=5, weight=1 ) B = Button(root) B.grid(column=0,row=0,sticky='wn') root.mainloop() HTH /MiO From harlinseritt at yahoo.com Thu Jan 4 14:13:11 2007 From: harlinseritt at yahoo.com (Harlin Seritt) Date: Thu, 4 Jan 2007 05:13:11 -0800 (PST) Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 35, Issue 1 In-Reply-To: Message-ID: <941744.79877.qm@web50605.mail.yahoo.com> Hi Cam, Sounds like you may need to incorporate an additional frame just for the buttons... then have that frame "gridded" to use sticky=NW this will keep all of your buttons in the button array together. HTH, Harlin Seritt 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. Grid (Cam) ---------------------------------------------------------------------- Message: 1 Date: Wed, 03 Jan 2007 22:26:30 -0500 From: Cam Subject: [Tkinter-discuss] Grid To: tkinter-discuss at python.org Message-ID: <459C73E6.7030003 at bitflipper.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Any grid experts about? This minimal Tkinter program: from Tkinter import * root = Tk() root.geometry('640x480') B = Button(root) B.grid(column=0,row=0,sticky='wn') root.mainloop() produces a top-level with a Button centered in it. But I don't want the button in the middle, I want it in the upper left where you would sort of expect (0,0) to be. I thought the sticky option might do that but it doesn't. If it was just one button I'd use pack. But it's a bunch of buttons and they really need to be arranged in an array so I'm pretty much stuck with the grid manager. Anybody know what I'm doing wrong? Thanks Cam Farnell ------------------------------ _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss End of Tkinter-discuss Digest, Vol 35, Issue 1 ********************************************** __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070104/e1ad14fb/attachment.htm From saintiss at gmx.net Fri Jan 5 10:21:54 2007 From: saintiss at gmx.net (SainTiss) Date: Fri, 5 Jan 2007 10:21:54 +0100 Subject: [Tkinter-discuss] fonts in python app Message-ID: <200701051021.54798.saintiss@gmx.net> Hi all, I'm trying to get this python app (atom3) running, which used to work perfectly fine, but now insists on showing all messages (any GUI text for that matter) in some greek-looking font (probably "symbol" or something). Mind you, the messages are NOT greek, but english, just the font looks greek. That makes me conclude what I need is a change of font, but the question is how do I do that? loading an options file with *font... things doesn't help. Besides, modifying the source code is not really desirable. I'm suspecting that the mapping on my system for e.g. helvetica somehow points to "symbol". Is there a way to change this? I'm using debian linux btw, with python 2.4.4 Thanks, Hans -- A liberal is a person whose interests aren't at stake at the moment -- Willis Player Hans Schippers Research Assistant of the Research Foundation - Flanders (FWO - Vlaanderen) http://www.win.ua.ac.be/~hschipp/ Formal Techniques in Software Engineering (FoTS) University of Antwerp Middelheimlaan 1 2020 Antwerpen - Belgium Phone: +32 3 265 38 71 Fax: +32 3 265 37 77 From kw at codebykevin.com Sat Jan 6 00:07:59 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 05 Jan 2007 18:07:59 -0500 Subject: [Tkinter-discuss] Shareware product using Tkinter Message-ID: <459EDA4F.4030209@codebykevin.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I know there is a lot of talk about Tkinter being an antiquated toolkit, unsuitable for commercial software development. However, I am using Tkinter in one of my shareware programs: http://www.codebykevin.com/packetstream.html (there's a screenshot) This application makes use of some recent advances in Tk development, including Tile (see http://tkinter.unpythonic.net/wiki/TileWrapper for the Python wrapper). It also makes use of some nice Tkinter widgets such as ToolTip (http://tkinter.unpythonic.net/wiki/ToolTip). If you pay attention to some of the specifics of the platform you are targeting (this app is for Mac OS X users) and to other points of application design, such as icons (I find the Tango set to be very polished and well-suited for the Mac; it doesn't scream "Linux"), then I think it's quite possible to make a nice, polished, professional-looking application with Tkinter. I'm curious if anyone has thought about gathering a listing of other Tkinter applications, commercial or otherwise, that are well-designed/attractive. Perhaps a screenshot page at the Tkinter wiki or elsewhere? - -- Kevin Walzer Code by Kevin http://www.codebykevin.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQFFntpOEsLm8HXyq4sRAuxMAJQOpHKZf9dGrxO/0F0UVIPMr8vZAJsGIHT9 pYgEgO+j2Q83GocIWWOzqA== =7aqI -----END PGP SIGNATURE----- From klappnase at web.de Sat Jan 6 20:11:56 2007 From: klappnase at web.de (Michael Lange) Date: Sat, 6 Jan 2007 20:11:56 +0100 Subject: [Tkinter-discuss] Using PIL with Tkimg Message-ID: <20070106201156.624ed082.klappnase@web.de> First, a happy new year to all of you! And now for something completely different: I want to display different image formats in a Tkinter.Canvas and be able to scale the images to a requested size. I noticed that some images look better when using Tkimg than with PIL, which just seems to do an on-the-fly conversion into GIF (is this correct?) which sometimes results in a significant loss of quality. Unfortunately when using Tkimg with a plain Tkinter.PhotoImage there is not much support for scaling the image, so I tried to use them both, however without luck. The ImageTk.PhotoImage seems to ignore the native file format support provided by Tkimg and I could not find a way to send the image data from the resized PIL Image to a standard Tkinter.PhotoImage . I tried passing the data returned by Image.tostring() to the PhotoImage's data argument, but without success. Does anyone know, is this possible at all, and if it is, how to accomplish this? Thanks in advance Michael From klappnase at web.de Sat Jan 6 20:33:56 2007 From: klappnase at web.de (Michael Lange) Date: Sat, 6 Jan 2007 20:33:56 +0100 Subject: [Tkinter-discuss] Shareware product using Tkinter In-Reply-To: <459EDA4F.4030209@codebykevin.com> References: <459EDA4F.4030209@codebykevin.com> Message-ID: <20070106203356.04da9827.klappnase@web.de> On Fri, 05 Jan 2007 18:07:59 -0500 Kevin Walzer wrote: (...) > > I'm curious if anyone has thought about gathering a listing of other > Tkinter applications, commercial or otherwise, that are > well-designed/attractive. Perhaps a screenshot page at the Tkinter wiki > or elsewhere? > Cool idea, two apps that come to my mind are PySol (http://www.pysol.org/) and skencil (a.k.a. sketch, http://www.skencil.org/). Alas, both seem to plan to move away from Tkinter :( Michael From harlinseritt at yahoo.com Sun Jan 7 13:41:41 2007 From: harlinseritt at yahoo.com (Harlin Seritt) Date: Sun, 7 Jan 2007 04:41:41 -0800 (PST) Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 35, Issue 3 In-Reply-To: Message-ID: <292573.67539.qm@web50601.mail.yahoo.com> For those who come by here and read these words and misunderstand them... >>"I know there is a lot of talk about Tkinter being an antiquated toolkit, unsuitable for commercial software development." Functionality never goes out of style for people who really know what they want out of an application. I honestly can't think of too many things you can't accomplish with Tkinter if you're writing a GUI app. Of course the great thing is that with a little tweaking here and there, your Tkinter app can look as beautiful as you like! Harlin Seritt 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. Shareware product using Tkinter (Kevin Walzer) ---------------------------------------------------------------------- Message: 1 Date: Fri, 05 Jan 2007 18:07:59 -0500 From: Kevin Walzer Subject: [Tkinter-discuss] Shareware product using Tkinter To: tkinter-discuss at python.org Message-ID: <459EDA4F.4030209 at codebykevin.com> Content-Type: text/plain; charset=ISO-8859-1 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I know there is a lot of talk about Tkinter being an antiquated toolkit, unsuitable for commercial software development. However, I am using Tkinter in one of my shareware programs: http://www.codebykevin.com/packetstream.html (there's a screenshot) This application makes use of some recent advances in Tk development, including Tile (see http://tkinter.unpythonic.net/wiki/TileWrapper for the Python wrapper). It also makes use of some nice Tkinter widgets such as ToolTip (http://tkinter.unpythonic.net/wiki/ToolTip). If you pay attention to some of the specifics of the platform you are targeting (this app is for Mac OS X users) and to other points of application design, such as icons (I find the Tango set to be very polished and well-suited for the Mac; it doesn't scream "Linux"), then I think it's quite possible to make a nice, polished, professional-looking application with Tkinter. I'm curious if anyone has thought about gathering a listing of other Tkinter applications, commercial or otherwise, that are well-designed/attractive. Perhaps a screenshot page at the Tkinter wiki or elsewhere? - -- Kevin Walzer Code by Kevin http://www.codebykevin.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQFFntpOEsLm8HXyq4sRAuxMAJQOpHKZf9dGrxO/0F0UVIPMr8vZAJsGIHT9 pYgEgO+j2Q83GocIWWOzqA== =7aqI -----END PGP SIGNATURE----- ------------------------------ _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss End of Tkinter-discuss Digest, Vol 35, Issue 3 ********************************************** __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070107/2c2185b0/attachment.htm From fredrik at pythonware.com Sun Jan 7 13:42:11 2007 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 07 Jan 2007 13:42:11 +0100 Subject: [Tkinter-discuss] Using PIL with Tkimg In-Reply-To: <20070106201156.624ed082.klappnase@web.de> References: <20070106201156.624ed082.klappnase@web.de> Message-ID: Michael Lange wrote: > I want to display different image formats in a Tkinter.Canvas and be > able to scale the images to a requested size. I noticed that some images > look better when using Tkimg than with PIL, which just seems to > do an on-the-fly conversion into GIF (is this correct?) nope. > which sometimes results in a significant loss of quality. are you perhaps using nearest-neighbour filtering? try using BILINEAR (or, if you have the CPU, ANTIALIAS) instead. From hsa01 at bitflipper.ca Sat Jan 6 21:35:04 2007 From: hsa01 at bitflipper.ca (Cam Farnell) Date: Sat, 06 Jan 2007 15:35:04 -0500 Subject: [Tkinter-discuss] Shareware product using Tkinter In-Reply-To: <20070106203356.04da9827.klappnase@web.de> References: <459EDA4F.4030209@codebykevin.com> <20070106203356.04da9827.klappnase@web.de> Message-ID: <45A007F8.2080301@bitflipper.ca> And there's always Rapyd-Tk (www.bitflipper.ca/rapyd) which is a graphical program designed to make it easier to write and maintain Tkinter applications in the first place. Given it's nature, it's not likely to move away from Tkinter. Cam Michael Lange wrote: > On Fri, 05 Jan 2007 18:07:59 -0500 > Kevin Walzer wrote: > > (...) > >>I'm curious if anyone has thought about gathering a listing of other >>Tkinter applications, commercial or otherwise, that are >>well-designed/attractive. Perhaps a screenshot page at the Tkinter wiki >>or elsewhere? >> > > > Cool idea, two apps that come to my mind are PySol (http://www.pysol.org/) > and skencil (a.k.a. sketch, http://www.skencil.org/). Alas, both seem > to plan to move away from Tkinter :( > > Michael > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > From klappnase at web.de Sun Jan 7 18:33:44 2007 From: klappnase at web.de (Michael Lange) Date: Sun, 7 Jan 2007 18:33:44 +0100 Subject: [Tkinter-discuss] Using PIL with Tkimg In-Reply-To: References: <20070106201156.624ed082.klappnase@web.de> Message-ID: <20070107183344.33a9cedb.klappnase@web.de> On Sun, 07 Jan 2007 13:42:11 +0100 Fredrik Lundh wrote: > Michael Lange wrote: > > > I want to display different image formats in a Tkinter.Canvas and be > > able to scale the images to a requested size. I noticed that some images > > look better when using Tkimg than with PIL, which just seems to > > do an on-the-fly conversion into GIF (is this correct?) > > nope. > > > which sometimes results in a significant loss of quality. > > are you perhaps using nearest-neighbour filtering? try using BILINEAR > (or, if you have the CPU, ANTIALIAS) instead. > > Thanks Frederik, as usually you are right, using ANTIALIAS it is much better. Still some images are not displayed correctly; I have uploaded a little demo screenshot of what I mean to . The PIL image in this example looks a lot like a GIF image created with convert or some other utility from the original PNG, that is why I thought about the on-the-fly conversion into GIF. When I call Image.save() on the image returned by Image.open() the resulting image looks ok, so I guess the problem must be with the ImageTk.PhotoImage . Is there any way to avoid effects like these that I missed so far? Thanks in advance Michael From fatuheeva at yahoo.com Mon Jan 8 23:05:44 2007 From: fatuheeva at yahoo.com (Michael Castleton) Date: Mon, 8 Jan 2007 14:05:44 -0800 (PST) Subject: [Tkinter-discuss] tkinter and pythonWin Message-ID: <8227653.post@talk.nabble.com> Hello, I am wondering if there is any way to get pythonWin to operate properly with tkinter? I have found links suggesting the two will not work together and experienced problems myself: "command = frame.quit" will lock it up everytime. If there is no way to make them happy together I will live with it but if anyone has ideas.... Thanks, Mike -- View this message in context: http://www.nabble.com/tkinter-and-pythonWin-tf2942440.html#a8227653 Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From eric_dexter at netzero.net Wed Jan 10 04:50:34 2007 From: eric_dexter at netzero.net (eric_dexter at netzero.net) Date: Wed, 10 Jan 2007 03:50:34 GMT Subject: [Tkinter-discuss] wck question Message-ID: <20070109.195058.751.134238@webmail16.lax.untd.com> An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070110/87dfa63c/attachment.asc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070110/87dfa63c/attachment.htm From eric_dexter at netzero.net Wed Jan 10 12:24:25 2007 From: eric_dexter at netzero.net (eric_dexter at netzero.net) Date: Wed, 10 Jan 2007 11:24:25 GMT Subject: [Tkinter-discuss] re wck question Message-ID: <20070110.032434.2671.1874107@webmail11.lax.untd.com> An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070110/df245c03/attachment.asc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070110/df245c03/attachment.htm From bialix at ukr.net Fri Jan 12 16:09:50 2007 From: bialix at ukr.net (Alexander Belchenko) Date: Fri, 12 Jan 2007 17:09:50 +0200 Subject: [Tkinter-discuss] return value in event handler Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I saw recipe in Python Cookbook about multilistbox implementation. (see code below). I try to understand why for event handlers have return value 'break'. E.g., shortest example: lb.bind('', lambda e: 'break') Does this mean something special? What other possible values exists? The code from recipe: from Tkinter import * class MultiListbox(Frame): def __init__(self, master, lists): Frame.__init__(self, master) self.lists = [] for l,w in lists: frame = Frame(self); frame.pack(side=LEFT, expand=YES, fill=BOTH) Label(frame, text=l, borderwidth=1, relief=RAISED).pack(fill=X) lb = Listbox(frame, width=w, borderwidth=0, selectborderwidth=0, relief=FLAT, exportselection=FALSE) lb.pack(expand=YES, fill=BOTH) self.lists.append(lb) lb.bind('', lambda e, s=self: s._select(e.y)) lb.bind('', lambda e, s=self: s._select(e.y)) lb.bind('', lambda e: 'break') lb.bind('', lambda e, s=self: s._b2motion(e.x, e.y)) lb.bind('', lambda e, s=self: s._button2(e.x, e.y)) frame = Frame(self); frame.pack(side=LEFT, fill=Y) Label(frame, borderwidth=1, relief=RAISED).pack(fill=X) sb = Scrollbar(frame, orient=VERTICAL, command=self._scroll) sb.pack(expand=YES, fill=Y) self.lists[0]['yscrollcommand']=sb.set def _select(self, y): row = self.lists[0].nearest(y) self.selection_clear(0, END) self.selection_set(row) return 'break' def _button2(self, x, y): for l in self.lists: l.scan_mark(x, y) return 'break' def _b2motion(self, x, y): for l in self.lists: l.scan_dragto(x, y) return 'break' def _scroll(self, *args): for l in self.lists: apply(l.yview, args) def curselection(self): return self.lists[0].curselection() def delete(self, first, last=None): for l in self.lists: l.delete(first, last) def get(self, first, last=None): result = [] for l in self.lists: result.append(l.get(first,last)) if last: return apply(map, [None] + result) return result def index(self, index): self.lists[0].index(index) def insert(self, index, *elements): for e in elements: i = 0 for l in self.lists: l.insert(index, e[i]) i = i + 1 def size(self): return self.lists[0].size() def see(self, index): for l in self.lists: l.see(index) def selection_anchor(self, index): for l in self.lists: l.selection_anchor(index) def selection_clear(self, first, last=None): for l in self.lists: l.selection_clear(first, last) def selection_includes(self, index): return self.lists[0].selection_includes(index) def selection_set(self, first, last=None): for l in self.lists: l.selection_set(first, last) if __name__ == '__main__': tk = Tk() Label(tk, text='MultiListbox').pack() mlb = MultiListbox(tk, (('Subject', 40), ('Sender', 20), ('Date', 10))) for i in range(1000): mlb.insert(END, ('Important Message: %d' % i, 'John Doe', '10/10/%04d' % (1900+i))) mlb.pack(expand=YES,fill=BOTH) tk.mainloop() -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFp6S+zYr338mxwCURAkBGAKCMg36UYfqUH/H2Ykazae6OgDgPywCeN5yZ 4iLRCidTkAMSvvDYNygJBGQ= =2RAF -----END PGP SIGNATURE----- From rowen at cesmail.net Fri Jan 12 21:03:42 2007 From: rowen at cesmail.net (Russell E Owen) Date: Fri, 12 Jan 2007 12:03:42 -0800 Subject: [Tkinter-discuss] return value in event handler References: Message-ID: In article , Alexander Belchenko wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I saw recipe in Python Cookbook about multilistbox implementation. > (see code below). I try to understand why for event handlers > have return value 'break'. This stops event propagation. I don't know of any other "interesting" return values. -- Russell From howard at eegsoftware.com Fri Jan 12 22:10:58 2007 From: howard at eegsoftware.com (Howard Lightstone) Date: Fri, 12 Jan 2007 13:10:58 -0800 Subject: [Tkinter-discuss] Rebuilding tkinter using VC8 Message-ID: <45A788E2.13543.14788482@howard.eegsoftware.com> I am having some difficulties rebuilding tkinter using VC++ 2005 (the only M$soft compiler you can buy now). I was able to get Python 2.5 to rebuild. I had to get tcl/tk 8.4.14 to be able to compile with VC8 (using the kind of process specified in the python build documentation). Tix, however, will not build using either 8.4.0 or 8.4.2. It looks like the VC8 makefile changes have never made it there. The TIX mailing list looks suspiciously empty. Is anyone working on this? I tried to make up a "solution" file but I get floods of linkage and/or compile errors no matter how I try setting the build options. Unfortunately, I HAVE to rebuild python with VC8 (since it is embedded) and thus all the .pyds and supporting DLLs need to be using the same libraries...... From chris at niekel.net Sat Jan 13 22:27:37 2007 From: chris at niekel.net (Chris Niekel) Date: Sat, 13 Jan 2007 22:27:37 +0100 Subject: [Tkinter-discuss] Confused by frames Message-ID: <20070113212737.GE6314@kira.niekel.net> Hi, I'm trying to combine a couple of widgets into a frame as a reusable component. Somehow though, things change when I put some part in a class, derived from Frame. Version 1: class F1(Frame): def __init__(self, *args, **kw): Frame.__init__(self, *args, **kw) Label(text="F1").grid(row=5,column=5) r = Tk() b = Button(r, text='button').grid(row=0,column=1) f = F1(r).grid(row=0,column=0) r.mainloop() Version 2: from Tkinter import * r = Tk() b = Button(r, text='button').grid(row=0,column=1) f1 = Frame(r) f1.grid(row=0,column=0) Label(f1, text='F1').grid(row=5,column=5) r.mainloop() I would think these are equivalent, but they're not. Version 2 has the behaviour I expect (a new frame, so the label is on the left). Did I do something wrong in version 1, or is there another way to make a class with the label which behaves like a frame? Regards, Chris From bialix at ukr.net Sun Jan 14 01:49:16 2007 From: bialix at ukr.net (Alexander Belchenko) Date: Sun, 14 Jan 2007 02:49:16 +0200 Subject: [Tkinter-discuss] Confused by frames In-Reply-To: <20070113212737.GE6314@kira.niekel.net> References: <20070113212737.GE6314@kira.niekel.net> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris Niekel ?????: > Hi, > > I'm trying to combine a couple of widgets into a frame as a reusable > component. Somehow though, things change when I put some part in a class, > derived from Frame. > > Version 1: > > class F1(Frame): > def __init__(self, *args, **kw): > Frame.__init__(self, *args, **kw) > Label(text="F1").grid(row=5,column=5) Last line contains error: you need to pass self as master for Label: Label(self, text="F1").grid(row=5,column=5) > r = Tk() > > b = Button(r, text='button').grid(row=0,column=1) > f = F1(r).grid(row=0,column=0) > r.mainloop() > > Version 2: > > from Tkinter import * > r = Tk() > > b = Button(r, text='button').grid(row=0,column=1) > f1 = Frame(r) > f1.grid(row=0,column=0) > Label(f1, text='F1').grid(row=5,column=5) > r.mainloop() > > > I would think these are equivalent, but they're not. Version 2 has the > behaviour I expect (a new frame, so the label is on the left). > > Did I do something wrong in version 1, or is there another way to make a > class with the label which behaves like a frame? > > Regards, > Chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFqX4MzYr338mxwCURAsJEAJ49MBKjVsSY5evFYivWAXih50rX2wCfZBsu HBf9aPjq2tb8q6H2ln+6KUs= =c1SZ -----END PGP SIGNATURE----- From xjp at ptitevie44.tchatcheblog.com Sat Jan 13 04:39:14 2007 From: xjp at ptitevie44.tchatcheblog.com (Gilbert E. Hurst) Date: Fri, 12 Jan 2007 22:39:14 -0500 Subject: [Tkinter-discuss] The default renderer renders the component just as it would have if the custom tag or renderer were not used. Message-ID: <001001c736c5$02baeb10$58586e9d@kcab> Currently, no simple solutions exist to tackle this possible conflict. Code Example 1 performs all three steps, printing Hello, world! Each of those JavaScript arrays includes the displayed label and the actual value of an item in the combobox. It is not as strict and more based on the "honor" system as a key could be used in more than one application. Currently, no simple solutions exist to tackle this possible conflict. For the source code, see the edit. This presentation will provide an overall introduction to the XAP project and give attendees an understanding of the project's structure and capabilities. Highlights include step by step creation of a XAP application. Hence, for each AJAX-enabled web page, the JavaScript functions must always be present, and the developer must code all the events that trigger the requests. ejs, I use double quotes around the response text and don't escape the single quotes. jsp file in the download bundle. What will happend if the request is XMLHttpRequest, Will it behave as is or no checking for session existence. The FileUpload component's children are set to render themselves, so no action is necessary in the FileUploadRenderer. For instance, the Invoice Viewer sample includes a servlet that you can call to asynchronously render new content in the portlet. I realized there was a simpler way to do this by using the built in functionalities of the servlet API using the HttpSession API. The Phobos project is focussed on building a web application framework that allows you to develop your web applications with a scripting language. Available Script EnginesA ScriptEngineManager object provides the discovery mechanism for the the scripting framework. This approach is useful for mapping a single parent component to a single child component, but its real strength is mapping a single parent component to multiple child components. Each principle and its nuances are illustrated in detail with real world examples and counter-examples from both inside and outside Yahoo! Each principle and its nuances are illustrated in detail with real world examples and counter-examples from both inside and outside Yahoo! Powered by Sun Microsystems, Inc. Check out the new tutorial, How to Create an Ajax-Enabled Phobos Application for a gentle introduction to building a simple Phobos application with AJAX functionality. To make an asynchronous call for content to dynamically update the portlet, the sample makes the dojo. A portlet can fetch content from various data sources to create a mashup. CollabNet is a registered trademark of CollabNet, Inc. This approach is useful for mapping a single parent component to a single child component, but its real strength is mapping a single parent component to multiple child components. This is an unofficial, temporary feed only and might be offline any time. The map displays the locations with critical inventory status with a unique icon that flags the need for corrective measures. In this case the handleResourceReqestmethod is invoked with script. The FileUpload component was designed to add AJAX functionality to the JavaServer Faces technology's javax. orgFeedback: Email the webmaster Which strategies are programmers using to make life easier for themselves as well as their users? Log in as developer, navigate to the Portlet Samples tab, and you see MashupMapPortlet on the portal page. For more info see the Updates page. In this way, pieces of the page can be rendered againwithout going through the entire life cycle and submitting the entirepage. To learn more about dojo. This listener function plots the coordinates on the map. Use the Java Powered brand to build customer confidence and create product demand and awareness. Maintaining Portlet StateWhen you dynamically update portlet content with an AJAX call to a servlet, how do you maintain the portlet's state? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070112/87628f6c/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 21017 bytes Desc: not available Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20070112/87628f6c/attachment-0001.gif From harlinseritt at yahoo.com Sun Jan 14 16:24:24 2007 From: harlinseritt at yahoo.com (Harlin Seritt) Date: Sun, 14 Jan 2007 07:24:24 -0800 (PST) Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 35, Issue 10 In-Reply-To: Message-ID: <306688.48621.qm@web50615.mail.yahoo.com> Hi Chris, Looks like you're trying to do the same thing with 'f' and 'f1'. If so, you're telling it that f is a frame class without the grid method (though you do it tell it to "do" that later) while f1 is a frame class *including* the grid method you describe. >From my experience of doing this in the past, you make 'f1' be something besides a mere frame if this makes sense. Later on in your script this will cause some weirdness (at least to the developer) in it's behavior as a class. Although on a higher level it makes sense and I can easily see what you're doing and where you're going with it, the interpreter does not! That's where the weirdness comes in -- though it's not really weirdness -- an interpreter (even a very high level one like Python) follows a very strict protocol of how it assigns classes and such. Gee I feel like I went around the world on trying to explain that one. Hope This Helps (If it doesn't, forget I ever existed ;-) ) Harlin Seritt 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. Confused by frames (Chris Niekel) 2. Re: Confused by frames (Alexander Belchenko) ---------------------------------------------------------------------- Message: 1 Date: Sat, 13 Jan 2007 22:27:37 +0100 From: Chris Niekel Subject: [Tkinter-discuss] Confused by frames To: Tkinter-discuss at python.org Message-ID: <20070113212737.GE6314 at kira.niekel.net> Content-Type: text/plain; charset=us-ascii Hi, I'm trying to combine a couple of widgets into a frame as a reusable component. Somehow though, things change when I put some part in a class, derived from Frame. Version 1: class F1(Frame): def __init__(self, *args, **kw): Frame.__init__(self, *args, **kw) Label(text="F1").grid(row=5,column=5) r = Tk() b = Button(r, text='button').grid(row=0,column=1) f = F1(r).grid(row=0,column=0) r.mainloop() Version 2: from Tkinter import * r = Tk() b = Button(r, text='button').grid(row=0,column=1) f1 = Frame(r) f1.grid(row=0,column=0) Label(f1, text='F1').grid(row=5,column=5) r.mainloop() I would think these are equivalent, but they're not. Version 2 has the behaviour I expect (a new frame, so the label is on the left). Did I do something wrong in version 1, or is there another way to make a class with the label which behaves like a frame? Regards, Chris ------------------------------ Message: 2 Date: Sun, 14 Jan 2007 02:49:16 +0200 From: Alexander Belchenko Subject: Re: [Tkinter-discuss] Confused by frames To: tkinter-discuss at python.org Message-ID: Content-Type: text/plain; charset=UTF-8 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris Niekel ?????: > Hi, > > I'm trying to combine a couple of widgets into a frame as a reusable > component. Somehow though, things change when I put some part in a class, > derived from Frame. > > Version 1: > > class F1(Frame): > def __init__(self, *args, **kw): > Frame.__init__(self, *args, **kw) > Label(text="F1").grid(row=5,column=5) Last line contains error: you need to pass self as master for Label: Label(self, text="F1").grid(row=5,column=5) > r = Tk() > > b = Button(r, text='button').grid(row=0,column=1) > f = F1(r).grid(row=0,column=0) > r.mainloop() > > Version 2: > > from Tkinter import * > r = Tk() > > b = Button(r, text='button').grid(row=0,column=1) > f1 = Frame(r) > f1.grid(row=0,column=0) > Label(f1, text='F1').grid(row=5,column=5) > r.mainloop() > > > I would think these are equivalent, but they're not. Version 2 has the > behaviour I expect (a new frame, so the label is on the left). > > Did I do something wrong in version 1, or is there another way to make a > class with the label which behaves like a frame? > > Regards, > Chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFqX4MzYr338mxwCURAsJEAJ49MBKjVsSY5evFYivWAXih50rX2wCfZBsu HBf9aPjq2tb8q6H2ln+6KUs= =c1SZ -----END PGP SIGNATURE----- ------------------------------ _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss End of Tkinter-discuss Digest, Vol 35, Issue 10 *********************************************** --------------------------------- Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070114/fc83bf64/attachment.htm From ajkadri at googlemail.com Mon Jan 15 00:06:26 2007 From: ajkadri at googlemail.com (Asrarahmed Kadri) Date: Sun, 14 Jan 2007 23:06:26 +0000 Subject: [Tkinter-discuss] Change the font size of the lines and rectangle on a Tkinter Canvas Message-ID: Hi Folks, I have a Tkinter canvas on which there are two axes: X and Y and a horizontal bar chart. I want to provide with a functionality of changing the font size, in this case the width of the lines. Is it possible to do it dynamically; I mean the graph is already drawn, now with a Menu, suppose I want to provide the user with options of 50%, 100% and 200% font size. Can you tell me how to do it.? Thanks in anticipation. Best Regards, -- To HIM you shall return. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070114/89846436/attachment.htm From bialix at ukr.net Mon Jan 15 08:15:12 2007 From: bialix at ukr.net (Alexander Belchenko) Date: Mon, 15 Jan 2007 09:15:12 +0200 Subject: [Tkinter-discuss] icon for main window Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I wrote simple GUI program. But I have problem with setting icon for main window of program. Icon works on Win32 well, but linux user report about error. The code in question: # create root window self.root = Tk() self.root.title('Bazaar configuration') if os.path.isfile('./olive-branches.ico'): self.root.iconbitmap('./olive-branches.ico') As I say above on windows this code works well. But on Linux it produce traceback: > Traceback (most recent call last): > File "bzr-config.py", line 9, in ? > sys.exit(bzrconf.main()) > File "/stuph/projects/bzr/bzr.repo/bzr-config/bzrconf/__init__.py", line > 20, in main > app = Application([gm, am]) > File > "/stuph/projects/bzr/bzr.repo/bzr-config/bzrconf/gui/tkgui/__init__.py", > line 22, in __init__ > self.root.iconbitmap('olive-branches.ico') > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1451, in wm_iconbitmap > return self.tk.call('wm', 'iconbitmap', self._w, bitmap) > _tkinter.TclError: bitmap "olive-branches.ico" not defined Does icons are windows-only feature, or I miss something important? Full code as bzr branch here: - -- Alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFqyoAzYr338mxwCURAnYxAJ4wzwwLxAISX79dzvu/a7KYgfvARQCcCtYa 4uWQFjj4bKGBDLMlOeBNm+I= =uvXm -----END PGP SIGNATURE----- From bialix at ukr.net Mon Jan 15 08:20:13 2007 From: bialix at ukr.net (Alexander Belchenko) Date: Mon, 15 Jan 2007 09:20:13 +0200 Subject: [Tkinter-discuss] icon for main window Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I wrote simple GUI program. But I have problem with setting icon for main window of program. Icon works on Win32 well, but linux user report about error. The code in question: # create root window self.root = Tk() self.root.title('Bazaar configuration') if os.path.isfile('./olive-branches.ico'): self.root.iconbitmap('./olive-branches.ico') As I say above on windows this code works well. But on Linux it produce traceback: > Traceback (most recent call last): > File "bzr-config.py", line 9, in ? > sys.exit(bzrconf.main()) > File "/stuph/projects/bzr/bzr.repo/bzr-config/bzrconf/__init__.py", line > 20, in main > app = Application([gm, am]) > File > "/stuph/projects/bzr/bzr.repo/bzr-config/bzrconf/gui/tkgui/__init__.py", > line 22, in __init__ > self.root.iconbitmap('olive-branches.ico') > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1451, in wm_iconbitmap > return self.tk.call('wm', 'iconbitmap', self._w, bitmap) > _tkinter.TclError: bitmap "olive-branches.ico" not defined Does icons are windows-only feature, or I miss something important? Full code as bzr branch here: http://bazaar.launchpad.net/~bialix/bzr-config/trunk Use command $ bzr checkout --lightweight http://bazaar.launchpad.net/~bialix/bzr-config/trunk bzr-config to get full sources. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFqystzYr338mxwCURAiExAKCLa9wn/f0cAYC7IiuQE4poohnnhgCeLuOH 29fBLziyMuXD4fPaJK+OEIc= =WqsE -----END PGP SIGNATURE----- From klappnase at web.de Mon Jan 15 10:59:55 2007 From: klappnase at web.de (Michael Lange) Date: Mon, 15 Jan 2007 10:59:55 +0100 Subject: [Tkinter-discuss] icon for main window In-Reply-To: References: Message-ID: <20070115105955.25e06ea3.klappnase@web.de> On Mon, 15 Jan 2007 09:20:13 +0200 Alexander Belchenko wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I wrote simple GUI program. But I have problem with setting icon for main window > of program. Icon works on Win32 well, but linux user report about error. > > The code in question: > > # create root window > self.root = Tk() > self.root.title('Bazaar configuration') > if os.path.isfile('./olive-branches.ico'): > self.root.iconbitmap('./olive-branches.ico') > Hi Alexander, on linux you will need the fully qualified path to an .xbm bitmap preceded by an "@", like self.root.iconbitmap('@/usr/share/icons/olive-branches.xbm'). I hope this helps Michael From ht at inf.ed.ac.uk Mon Jan 15 15:43:35 2007 From: ht at inf.ed.ac.uk (Henry S. Thompson) Date: Mon, 15 Jan 2007 14:43:35 +0000 Subject: [Tkinter-discuss] Rebuilding tkinter using VC8 In-Reply-To: <45A788E2.13543.14788482@howard.eegsoftware.com> (Howard Lightstone's message of "Fri, 12 Jan 2007 13:10:58 -0800") References: <45A788E2.13543.14788482@howard.eegsoftware.com> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Howard Lightstone writes: > I am having some difficulties rebuilding tkinter using VC++ > 2005 (the only M$soft compiler you can buy now). > > I was able to get Python 2.5 to rebuild. I had to get tcl/tk > 8.4.14 to be able to compile with VC8 (using the kind of > process specified in the python build documentation). > > Tix, however, will not build using either 8.4.0 or 8.4.2. It looks > like the VC8 makefile changes have never made it there. Are you _sure_ that using gcc won't work for you? After a lengthy, complex and not completely successful attempt to use the (free) Microsoft Visual C++ Toolkit Compiler per the Python 2.4 Extensions w/ the MS Toolkit Compiler instructions [1], I switched to using the Mingw/MSYS approach [2]. Works well for 2.4, should work for 2.5 as far as I can see. ht [1] http://www.vrplumber.com/programming/mstoolkit/ [2] http://www.mingw.org/MinGWiki/index.php/Python%20extensions - -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh Half-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht at inf.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail really from me _always_ has this .sig -- mail without it is forged spam] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFFq5MXkjnJixAXWBoRAr1/AJoCF6MZOP//7jlpvUl8XFfHhFDJ8QCcC/WV vfLQKdebKTYNVFzUVyNXWxY= =lGzL -----END PGP SIGNATURE----- From bob at passcal.nmt.edu Thu Jan 18 00:48:02 2007 From: bob at passcal.nmt.edu (Bob Greschke) Date: Wed, 17 Jan 2007 16:48:02 -0700 Subject: [Tkinter-discuss] Making a keyboard In-Reply-To: <292573.67539.qm@web50601.mail.yahoo.com> References: <292573.67539.qm@web50601.mail.yahoo.com> Message-ID: I'm making a popup keyboard for some touchscreen input. I have, for example, got: Button(KBFrm, text = "1", command = Command(kbhit, "1")... def kbhit(K, e = None): Root.event_generate("<"+K+">") return The letter keys work OK, but in the number keys 1 through 5 don't seem to do anything, but 6-9 and 0 work. Looking at e.keysym and e.keysym_num in a whole other routine says that the 1 key on a keyboard generates 1, and 49, so I don't get what is going on. Are <1> through <5> some kind of shortcuts for mouse button stuff? Also, is there something like a dictionary in the system where I can get the keysym for the punctuation keys like KeySyms["$"] = "dollar" or do I have to make one myself? Thanks! Bob From jrcagle at juno.com Thu Jan 18 08:31:31 2007 From: jrcagle at juno.com (Jeff Cagle) Date: Thu, 18 Jan 2007 02:31:31 -0500 Subject: [Tkinter-discuss] Find_closest, bbox, and weirdness In-Reply-To: References: Message-ID: <45AF2253.2080903@juno.com> So I was trying to pretty up a GUI. It took 20 minutes to write code to place names in a circle and draw arrows to the names that are related (actually, the names are filenames, and the arrows represent 'import' or 'from ... import' statements). It's taken a couple of hours to try to clean it up so that the arrows go up to the bounding box of the text, but not inside. Here was the plan: Compute the line that connects the centers of the text objects. Figure out where that line intersects the bounding boxes of the texts, and draw the lines to the intersection points instead of center-to-center. It all works ... except that I don't get the right bounding boxes. Here's the code: ---- # x0,y0 is one text object; x1,y1 is the other. print "Center coords: (%.1f,%.1f) and (%.1f, %.1f)" % (x0,y0,x1,y1) start_id = self.mainw.f.c.find_closest(x0,y0)[0] # <---- should return the text object itself, right? start_x0,start_y0,start_x1,start_y1 = self.mainw.f.c.bbox(start_id) print "Bounding box near (x0,y0): (%.1f,%.1f) x (%.1f,%.1f)" % \ (start_x0,start_y0,start_x1,start_y1) end_id = self.mainw.f.c.find_closest(x1,y1)[0] # <---- and the other one ... end_x0,end_y0,end_x1,end_y1 = self.mainw.f.c.bbox(end_id) print "Bounding box near (x1,y1): (%.1f,%.1f) x (%.1f,%.1f)" % \ (end_x0,end_y0,end_x1,end_y1) ---- To my shock, find_closest returns the same start_id and end_id ... namely, 1 ... every single time. Tkinter appears to be unable to capture the object closest to the coordinates, or else I'm not understanding how to use .find_closest(). Here's a typical result: Center coords: (200.0,380.0) and (375.5, 240.1) # (x0,y0) and (x1,y1) start_id: 1 Bounding box near (x0,y0): (29.0,4.0) x (31.0,17.0) end_id: 1 Bounding box near (x1,y1): (29.0,4.0) x (31.0,17.0) Truncating around box near x0,y0 Testing point (29, 516.36794949889111) Testing point (31, 514.77300272112632) Testing point (671.48908696117667, 4) Testing point (655.18760257156146, 17) fall-through # <---- Well, duh! None of these points is on the bounding box. Truncating around box near x1,y1 Testing point (29, 516.36794949889111) Testing point (31, 514.77300272112632) Testing point (671.48908696117667, 4) Testing point (655.18760257156146, 17) fall-through # Ditto. The bounding box in every single case is (29,4) x (31,17). What's going on? (Also, there isn't an object bounded by those coordinates on my screen!!) Thanks, Jeff Cagle From klappnase at web.de Thu Jan 18 10:38:54 2007 From: klappnase at web.de (Michael Lange) Date: Thu, 18 Jan 2007 10:38:54 +0100 Subject: [Tkinter-discuss] Making a keyboard In-Reply-To: References: <292573.67539.qm@web50601.mail.yahoo.com> Message-ID: <20070118103854.5b626ed2.klappnase@web.de> On Wed, 17 Jan 2007 16:48:02 -0700 Bob Greschke wrote: > I'm making a popup keyboard for some touchscreen input. > I have, for example, got: > > Button(KBFrm, text = "1", command = Command(kbhit, "1")... > > > def kbhit(K, e = None): > Root.event_generate("<"+K+">") > return > > > The letter keys work OK, but in the number keys 1 through 5 don't > seem to do anything, but 6-9 and 0 work. Looking at e.keysym and > e.keysym_num in a whole other routine says that the 1 key on a > keyboard generates 1, and 49, so I don't get what is going on. Are > <1> through <5> some kind of shortcuts for mouse button stuff? > In fact, <1> is a synonym for , so you better be explicit and use events. > Also, is there something like a dictionary in the system where I can > get the keysym for the punctuation keys like > > KeySyms["$"] = "dollar" > > or do I have to make one myself? > Maybe you can use a test script to find them out: >>> from Tkinter import * >>> c=Canvas() >>> c.pack() >>> def test(ev): ... print ev.keysym ... >>> c.config(takefocus=1) >>> c.bind('<1>', lambda eveent:c.focus_set()) '3084582540L' >>> c.bind('', test) '3084591988Ltest' # some keystrokes: Shift_L dollar Shift_L percent Shift_L parenleft ISO_Level3_Shift ?? I am not sure if the keys that use modifiers are relieable when used on different systems. I hope this helps Michael From jrcagle at juno.com Thu Jan 18 20:24:24 2007 From: jrcagle at juno.com (Jeff Cagle) Date: Thu, 18 Jan 2007 14:24:24 -0500 Subject: [Tkinter-discuss] more info on find_closest problem In-Reply-To: References: Message-ID: <45AFC968.8010806@juno.com> Well, I take one thing back: There was a text object at the point (30,10) -- a text object that was updated with mouse x,y coords every time a event fired. When without that text object, find_closest() works well. With it, find_closest gets confused again. It should be possible, I hope, to work around this issue by means of tags for the text objects. But I'm curious: why is this happening? Here's the code, with updated output: [code="seems like it oughta work"] def display(self): self.mainw = Tk() self.mainw.f = Frame(self.mainw) self.mainw.f.c = Canvas(self.mainw.f,width=400,height=400) # remove next line for success with find_closest() self.mainw.f.c.mouse_text = self.mainw.f.c.create_text(30,10,text='') ... self.print_canvas() print "Center coords: (%.1f,%.1f) and (%.1f, %.1f)" % (x0,y0,x1,y1) f = mathutils.line_func((x0,y0),(x1,y1)) g = mathutils.inv_line_func((x0,y0),(x1,y1)) print "Objects near (%.1f,%.1f)" % (x0,y0), \ self.mainw.f.c.find_closest(x0,y0) start_id = self.mainw.f.c.find_closest(x0,y0)[0] print "start_id: ", start_id start_x0,start_y0,start_x1,start_y1 = self.mainw.f.c.bbox(start_id) print "Bounding box near (%.1f,%.1f): (%.1f,%.1f) x (%.1f,%.1f)" % \ (x0,y0,start_x0,start_y0,start_x1,start_y1) print "Objects near (%.1f,%.1f)" % (x1,y1), \ self.mainw.f.c.find_closest(x1,y1) end_id = self.mainw.f.c.find_closest(x1,y1)[0] print "end_id: ", end_id end_x0,end_y0,end_x1,end_y1 = self.mainw.f.c.bbox(end_id) print "Bounding box near (%.1f,%.1f): (%.1f,%.1f) x (%.1f,%.1f)" % \ (x1,y1,end_x0,end_y0,end_x1,end_y1) raw_input("Press to continue...") ... [/code] [output="without offending text object"] >>> p.display() The canvas contains ------------------ Item_ID Type coords 1 text [200.0, 20.0] 2 text [278.09907304116047, 37.825603777564567] 3 text [340.72966684424534, 87.771835665427943] 4 text [375.48702419272826, 159.94623188786341] 5 text [375.48702419272826, 240.05376811213657] 6 text [340.72966684424534, 312.22816433457206] 7 text [278.09907304116047, 362.17439622243546] 8 text [200.00000000000003, 380.0] 9 text [121.90092695883955, 362.17439622243546] 10 text [59.270333155754656, 312.22816433457206] 11 text [24.512975807271744, 240.05376811213659] 12 text [24.512975807271744, 159.94623188786343] 13 text [59.270333155754628, 87.771835665428] 14 text [121.90092695883949, 37.825603777564567] Center coords: (278.1,37.8) and (375.5, 159.9) Objects near (278.1,37.8) (2,) start_id: 2 Bounding box near (278.1,37.8): (269.0,32.0) x (288.0,45.0) Objects near (375.5,159.9) (4,) end_id: 4 Bounding box near (375.5,159.9): (362.0,154.0) x (388.0,167.0) Press to continue... [/output] [output="with offending text object"] >>> p.display() The canvas contains ------------------ Item_ID Type coords 1 text [30.0, 10.0] 2 text [200.0, 20.0] 3 text [278.09907304116047, 37.825603777564567] 4 text [340.72966684424534, 87.771835665427943] 5 text [375.48702419272826, 159.94623188786341] 6 text [375.48702419272826, 240.05376811213657] 7 text [340.72966684424534, 312.22816433457206] 8 text [278.09907304116047, 362.17439622243546] 9 text [200.00000000000003, 380.0] 10 text [121.90092695883955, 362.17439622243546] 11 text [59.270333155754656, 312.22816433457206] 12 text [24.512975807271744, 240.05376811213659] 13 text [24.512975807271744, 159.94623188786343] 14 text [59.270333155754628, 87.771835665428] 15 text [121.90092695883949, 37.825603777564567] Center coords: (278.1,37.8) and (375.5, 159.9) Objects near (278.1,37.8) (1,) start_id: 1 Bounding box near (278.1,37.8): (29.0,4.0) x (31.0,17.0) Objects near (375.5,159.9) (1,) end_id: 1 Bounding box near (375.5,159.9): (29.0,4.0) x (31.0,17.0) Press to continue... [/output] Thanks for any insights, Jeff Cagle From rowen at cesmail.net Thu Jan 18 21:36:18 2007 From: rowen at cesmail.net (Russell E Owen) Date: Thu, 18 Jan 2007 12:36:18 -0800 Subject: [Tkinter-discuss] Find_closest, bbox, and weirdness References: <45AF2253.2080903@juno.com> Message-ID: In article <45AF2253.2080903 at juno.com>, Jeff Cagle wrote: > So I was trying to pretty up a GUI. It took 20 minutes to write code to > place names in a circle and draw arrows to the names that are related > (actually, the names are filenames, and the arrows represent 'import' or > 'from ... import' statements). > > It's taken a couple of hours to try to clean it up so that the arrows go > up to the bounding box of the text, but not inside. > > Here was the plan: Compute the line that connects the centers of the > text objects. Figure out where that line intersects the bounding boxes > of the texts, and draw the lines to the intersection points instead of > center-to-center. > > It all works ... except that I don't get the right bounding boxes. > Here's the code: it sounds like object with ID 1 may be overlapping all the other objects. Tk's find_closest is primitive in how it handles overlap. Unless you can guarantee that your text objects will never overlap I suggest you find the closest one yourself. Keep a list of object coords and scan through them. If the objects can be moved around then use a callback to update the position. -- Russell From jrcagle at juno.com Thu Jan 18 22:16:23 2007 From: jrcagle at juno.com (Jeff Cagle) Date: Thu, 18 Jan 2007 16:16:23 -0500 Subject: [Tkinter-discuss] more find_closest followup In-Reply-To: References: Message-ID: <45AFE3A7.3060905@juno.com> In the end, find_closest was giving odd results even when the offending mouse_text object was not created. So I fired it and replaced it with a 'find_closest_label()' that searches only the text labels for the closest match. Problem solved ... errr ... worked around. Jeff From Cameron at phaseit.net Thu Jan 18 22:21:49 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Thu, 18 Jan 2007 21:21:49 +0000 Subject: [Tkinter-discuss] Find_closest, bbox, and weirdness In-Reply-To: References: <45AF2253.2080903@juno.com> Message-ID: <20070118212149.GB24852@lairds.us> On Thu, Jan 18, 2007 at 12:36:18PM -0800, Russell E Owen wrote: . . . > > Here was the plan: Compute the line that connects the centers of the > > text objects. Figure out where that line intersects the bounding boxes > > of the texts, and draw the lines to the intersection points instead of > > center-to-center. > > > > It all works ... except that I don't get the right bounding boxes. > > Here's the code: > > it sounds like object with ID 1 may be overlapping all the other > objects. Tk's find_closest is primitive in how it handles overlap. > > Unless you can guarantee that your text objects will never overlap I > suggest you find the closest one yourself. Keep a list of object coords > and scan through them. If the objects can be moved around then use a > callback to update the position. . . . ? I've had *great* results with "closest". While I agree that your approach should be kept in mind, it's not the first one I try when I'm in the situation I understand from the original description. Do you have any details on how "closest" has failed for you? From Vasilis.Vlachoudis at cern.ch Fri Jan 19 10:14:43 2007 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Fri, 19 Jan 2007 10:14:43 +0100 Subject: [Tkinter-discuss] Resetting to default background color Message-ID: <2AACD4EB2F123248A064A23843B3A173020BDE@cernxchg47.cern.ch> Dear All, How can I reset the background color of widget to the default one? Imagine that I create an entry widget with a specific background color i.e. white e=Entry(root, background="white") e.pack() ... and at a later state I want to configure the color to the default system one (equivalent like when I create it: e=Entry(root)) I've tried e["background"] = "" # didn't work e["background"] = None # nothing del e["background"] # neither Cheers Vasilis -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070119/8b722144/attachment.htm From bob at passcal.nmt.edu Fri Jan 19 17:28:58 2007 From: bob at passcal.nmt.edu (Bob Greschke) Date: Fri, 19 Jan 2007 09:28:58 -0700 Subject: [Tkinter-discuss] Resetting to default background color In-Reply-To: <2AACD4EB2F123248A064A23843B3A173020BDE@cernxchg47.cern.ch> References: <2AACD4EB2F123248A064A23843B3A173020BDE@cernxchg47.cern.ch> Message-ID: I change button colors quite a bit in my programs and I just have a line at the beginning like: DefClr = Root.cget("bg") I then just set the background color of whatever I've changed to this to return the color to the normal default color. Bob On Jan 19, 2007, at 02:14, Vasilis Vlachoudis wrote: > Dear All, > > > > How can I reset the background color of widget to the default one? > > > > Imagine that I create an entry widget with a specific background > color i.e. white > > e=Entry(root, background=?white?) > > e.pack() > > ? > > and at a later state I want to configure the color to the default > system one (equivalent like when I create it: e=Entry(root)) > > I?ve tried > > e[?background?] = ?? # didn?t work > > e[?background?] = None # nothing > > del e[?background?] # neither > > > > Cheers > > Vasilis > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss From rowen at cesmail.net Thu Jan 18 22:30:47 2007 From: rowen at cesmail.net (Russell E Owen) Date: Thu, 18 Jan 2007 13:30:47 -0800 Subject: [Tkinter-discuss] Find_closest, bbox, and weirdness In-Reply-To: <20070118212149.GB24852@lairds.us> References: <45AF2253.2080903@juno.com> <20070118212149.GB24852@lairds.us> Message-ID: At 9:21 PM +0000 2007-01-18, Cameron Laird wrote: >On Thu, Jan 18, 2007 at 12:36:18PM -0800, Russell E Owen wrote: > . > . > . >> > Here was the plan: Compute the line that connects the centers of the >> > text objects. Figure out where that line intersects the bounding boxes >> > of the texts, and draw the lines to the intersection points instead of >> > center-to-center. >> > >> > It all works ... except that I don't get the right bounding boxes. >> > Here's the code: >> >> it sounds like object with ID 1 may be overlapping all the other >> objects. Tk's find_closest is primitive in how it handles overlap. >> >> Unless you can guarantee that your text objects will never overlap I >> suggest you find the closest one yourself. Keep a list of object coords >> and scan through them. If the objects can be moved around then use a >> callback to update the position. > . > . > . >? I've had *great* results with "closest". While I agree >that your approach should be kept in mind, it's not the >first one I try when I'm in the situation I understand from >the original description. Do you have any details on how >"closest" has failed for you? My problem was find_closest's handling of overlapping objects. I built a star display (stars on an Az/Alt grid). I wanted data for the star closest to the pointer displayed. But sometimes the blobs representing stars overlap causing data for the wrong star to be displayed. I suppose I could have added an invisible single pixel object at the center of each visible blob and found using that. But I'm happier with my solution. -- Russell From bob at passcal.nmt.edu Fri Jan 19 20:53:48 2007 From: bob at passcal.nmt.edu (Bob Greschke) Date: Fri, 19 Jan 2007 12:53:48 -0700 Subject: [Tkinter-discuss] Multiple displays/monitors? Message-ID: <28EFB9B7-ACD3-4303-9B58-C52E18EE2CD2@passcal.nmt.edu> Some of my programs start up and initially size themselves to, for example, 80% of the display height and width (usually because they are going to be graphing something). That works 100% of the time until someone has multiple monitors then winfo_screenheight() and width() get misleading. They seem to return the max dimensions (width +width and largest height), which isn't so bad if the two monitors are really the same, but with things like Mac laptops and Cinema displays it is usually not even close. Is there a way to find out about multiple monitors through Tkinter? I played with a bunch of the winfo methods, but didn't figure anything out. ALL :) I want to do is get the dimensions of the two (or more) displays and start the program in the center of the larger of the two for lack of a better plan. Thanks! Bob From mannslists at invigorated.org Sun Jan 21 14:44:10 2007 From: mannslists at invigorated.org (Mannequin*) Date: Sun, 21 Jan 2007 13:44:10 +0000 Subject: [Tkinter-discuss] What is wrong with this? Message-ID: <45B36E2A.9080000@invigorated.org> Hi all, I have this test (below). What I'm trying to do is when the user clicks on the '7' button, 7 will appear in the disabled entry widget. My problem is, when the script starts, it automatically throws '7' in to the entry widget, and nothing happens when the '7' button is clicked. Might this be an issue where I have to use a StringVar, or is this just my bad logic? Thanks! -M. ------------------------------------------------------------------------------------- #!/usr/bin/env python from Tkinter import * class SmallTest (Frame): def __init__ (self, parent = None): # Class 'constants' self.title = "SmallTest" # Set title and border width self.root = Tk () self.root.title (self.title) self.root.config (borderwidth = 3) self.root.resizable (width = False, height = False) # Initialize Frame object Frame.__init__ (self, parent) self.pack (fill = 'both', expand = 'yes') # Populate the window self.place = 0 self.create_widgets () def create_widgets (self): # Create the main frame self.mainframe = Frame (self, borderwidth = 2) self.mainframe.pack (expand = 'yes', fill = 'both', side = TOP) # Create the display self.entryframe = Frame (self.mainframe, borderwidth = 2) self.entryframe.pack (expand = 'yes', fill = 'both', side = TOP) self.entry = Entry (self.entryframe, justify = RIGHT, state = DISABLED) self.entry.pack (expand = 'yes', fill = 'x', side = TOP) # Create the number and operator buttons self.topbuttonframe = Frame (self.mainframe, borderwidth = 2) self.topbuttonframe.pack (expand = 'yes', fill = 'both', side = TOP) self.button7 = Button (self.topbuttonframe, text = "7", width = 2, command = self.buttonAction ('7')) self.button7.pack (expand = 'yes', fill = 'both', side = LEFT) def buttonAction (self, action = '+'): self.entry["state"] = NORMAL self.entry.insert (self.place, action) self.place = self.place + 1 self.entry["state"] = DISABLED if (__name__ == "__main__"): a = SmallTest () a.mainloop () ------------------------------------------------------------------------------------- From stewart at midwinter.ca Sun Jan 21 16:58:43 2007 From: stewart at midwinter.ca (Stewart Midwinter) Date: Sun, 21 Jan 2007 08:58:43 -0700 Subject: [Tkinter-discuss] What is wrong with this? In-Reply-To: <45B36E2A.9080000@invigorated.org> References: <45B36E2A.9080000@invigorated.org> Message-ID: The problem with your test app is that in your button definition, you didn't just provide the name of a method for the callback,you also provided an argument for it. That ensures that the callback will be called as soon as the button is instantiated. To get around this, one approach is to use a lambda function. Another approach is to create a separate function for each button and call it without any arguments. Here are the final lines of your test app with the 2nd approach: # Create the number and operator buttons self.topbuttonframe = Frame (self.mainframe, borderwidth = 2) self.topbuttonframe.pack (expand = 'yes', fill = 'both', side = TOP) self.button7 = Button (self.topbuttonframe, text = "7", width = 2, command = self.buttonAction7) self.button7.pack (expand = 'yes', fill = 'both', side = LEFT) def buttonAction7 (self): action = '7' self.entry["state"] = NORMAL self.entry.insert (self.place, action) self.place = self.place + 1 self.entry["state"] = DISABLED cheers Stewart From mannslists at invigorated.org Sun Jan 21 17:59:29 2007 From: mannslists at invigorated.org (Mannequin*) Date: Sun, 21 Jan 2007 16:59:29 +0000 Subject: [Tkinter-discuss] What is wrong with this? In-Reply-To: References: <45B36E2A.9080000@invigorated.org> Message-ID: <45B39BF1.1000700@invigorated.org> Stewart Midwinter wrote: > The problem with your test app is that in your button definition, you > didn't just provide the name of a method for the callback,you also > provided an argument for it. That ensures that the callback will be > called as soon as the button is instantiated. > > To get around this, one approach is to use a lambda function. Another > approach is to create a separate function for each button and call it > without any arguments. Here are the final lines of your test app with > the 2nd approach: Thanks for the reply. I thought it was probably something like that with the tests I've done. I was reading a book that said I could do it, but it's a bit old (for Python 2.1). I only really use it for a reference. So I've implemented what I wanted through lambda, which works perfectly well. Thanks for your help! -M. ------------------------------------------------------------------------------------- # ... self.button7 = Button (self.topbuttonframe, text = "7", width = 2, command = lambda y = '7' : self.buttonAction(y)) # ... def buttonAction (self, action = '+'): self.entry["state"] = NORMAL self.entry.insert (self.place, action) self.place = self.place + 1 self.entry["state"] = DISABLED # ... ------------------------------------------------------------------------------------- From Cameron at phaseit.net Sun Jan 21 18:25:27 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Sun, 21 Jan 2007 17:25:27 +0000 Subject: [Tkinter-discuss] What is wrong with this? In-Reply-To: <45B39BF1.1000700@invigorated.org> References: <45B36E2A.9080000@invigorated.org> <45B39BF1.1000700@invigorated.org> Message-ID: <20070121172527.GA4280@lairds.us> On Sun, Jan 21, 2007 at 04:59:29PM +0000, Mannequin* wrote: . . . > the tests I've done. I was reading a book that said I could do it, but > it's a bit old (for Python 2.1). I only really use it for a reference. . . . ?! You've got me curious. These Tkinter command semantics haven't changed for at least a decade; it's not a question of version skew. I'm not aware of any book which confuses functions with their evaluations as you describe; which is it? Maybe we can help you obtain better references. From mannslists at invigorated.org Sun Jan 21 18:43:28 2007 From: mannslists at invigorated.org (Mannequin*) Date: Sun, 21 Jan 2007 17:43:28 +0000 Subject: [Tkinter-discuss] What is wrong with this? In-Reply-To: <20070121172527.GA4280@lairds.us> References: <45B36E2A.9080000@invigorated.org> <45B39BF1.1000700@invigorated.org> <20070121172527.GA4280@lairds.us> Message-ID: <45B3A640.4030403@invigorated.org> Cameron Laird wrote: > On Sun, Jan 21, 2007 at 04:59:29PM +0000, Mannequin* wrote: > . > . > . >> the tests I've done. I was reading a book that said I could do it, but >> it's a bit old (for Python 2.1). I only really use it for a reference. > . > . > . > ?! > > You've got me curious. These Tkinter command semantics > haven't changed for at least a decade; it's not a question > of version skew. I'm not aware of any book which confuses > functions with their evaluations as you describe; which is > it? > > Maybe we can help you obtain better references. It is the "Python 2.1 Bible", by Dave Brueck and Stephen Tanner, published by Hungry Minds Inc. They have a script on page 352 - 353 that pretty much has the example where I gleaned that you could what I tried to do. What confuses me is that in the comments before these two sections below, the author wrote in reference to the Button["command"] method (which applies to the other methods of defining an action for a widget) that you couldn't pass an argument: "Button["command"] is the function to execute (without arguments)..." But clearly in the example that I've copied below, the author uses arguments! ------------------------------------------------------------------------------------- # For reference, SpamButton is a button created previously in this script. # ... SpamButton["command"]=self.BuildButtonAction("Spam") # ... Tkinter.Button(ButtonFrame,text="Beans",\ command=self.BuildButtonAction("Beans")).pack(side=Tkinter.LEFT) # ... ------------------------------------------------------------------------------------- I do have other references, Python's home page and "Programming Python", by Mark Lutz, published by O'Reilly, for instance. But the "Python 2.1 Bible" is written that it is easier for a quick reference. (Yes, I somehow thing a properly arranged book is still quicker than the internet. :) ) -M. From Cameron at phaseit.net Mon Jan 22 16:38:12 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Mon, 22 Jan 2007 15:38:12 +0000 Subject: [Tkinter-discuss] Multiple displays/monitors? In-Reply-To: <28EFB9B7-ACD3-4303-9B58-C52E18EE2CD2@passcal.nmt.edu> References: <28EFB9B7-ACD3-4303-9B58-C52E18EE2CD2@passcal.nmt.edu> Message-ID: <20070122153812.GA7317@lairds.us> On Fri, Jan 19, 2007 at 12:53:48PM -0700, Bob Greschke wrote: . . . > Some of my programs start up and initially size themselves to, for > example, 80% of the display height and width (usually because they > are going to be graphing something). That works 100% of the time > until someone has multiple monitors then winfo_screenheight() and > width() get misleading. They seem to return the max dimensions (width > +width and largest height), which isn't so bad if the two monitors > are really the same, but with things like Mac laptops and Cinema > displays it is usually not even close. > > Is there a way to find out about multiple monitors through Tkinter? > I played with a bunch of the winfo methods, but didn't figure > anything out. ALL :) I want to do is get the dimensions of the two > (or more) displays and start the program in the center of the larger > of the two for lack of a better plan. . . . No. I don't like bearing bad news. It's apparently true, though: Tk itself, underlying Tkinter, has no clean way of getting at the information you're (sensibly!) after. While is old, it remains an issue for quite a few current Tk maintainers. If the matter interests you enough, you can probably help achieve an enhancement in a forthcoming Tk release, which presumably would then be available in Tkinter. OR perhaps you could even take ideas from the Tk students, and patch them directly into Tkinter. For now, though, there's no easy answer apart from, "No." From Cameron at phaseit.net Mon Jan 22 16:47:29 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Mon, 22 Jan 2007 15:47:29 +0000 Subject: [Tkinter-discuss] Multiple displays/monitors? Message-ID: <20070122154729.GA8436@lairds.us> On Mon, Jan 22, 2007 at 03:38:12PM +0000, I advised: > . > . > . > > Is there a way to find out about multiple monitors through Tkinter? > > I played with a bunch of the winfo methods, but didn't figure > > anything out. ALL :) I want to do is get the dimensions of the two > > (or more) displays and start the program in the center of the larger > > of the two for lack of a better plan. > . > . > . > No. > > I don't like bearing bad news. It's apparently true, though: > Tk itself, underlying Tkinter, has no clean way of getting at > the information you're (sensibly!) after. While http://sourceforge.net/tracker/?func=detail&aid=533519&group_id=12997&atid=112997 > > is old, it remains an issue for quite a few current Tk maintainers. > If the matter interests you enough, you can probably help achieve > an enhancement in a forthcoming Tk release, which presumably would > then be available in Tkinter. > > OR perhaps you could even take ideas from the Tk students, and > patch them directly into Tkinter. > > For now, though, there's no easy answer apart from, "No." . . . I should also mention . From klappnase at web.de Mon Jan 22 18:51:26 2007 From: klappnase at web.de (Michael Lange) Date: Mon, 22 Jan 2007 18:51:26 +0100 Subject: [Tkinter-discuss] ANN: Updated TkTreectrl wrapper module Message-ID: <20070122185126.7e852b6b.klappnase@web.de> Hello all, there is an updated version of the TkinterTreectrl package available at < http://klappnase.zexxo.net/TkinterTreectrl/index.html >. The new version (0.7) includes all the features added in treectrl-2.2 , plus a few bug fixes. I also included a patch for treectrl-2.2.1 that fixes a segfault that occurs when using the treectrl widget with Python-2.5 on unix systems. Regards Michael From harlinseritt at yahoo.com Tue Jan 23 00:59:29 2007 From: harlinseritt at yahoo.com (Harlin Seritt) Date: Mon, 22 Jan 2007 15:59:29 -0800 (PST) Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 35, Issue 15 In-Reply-To: Message-ID: <51831.29547.qm@web50609.mail.yahoo.com> Vasilis, Would you mind posting your full code for this? Thanks, Harlin Seritt 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. more info on find_closest problem (Jeff Cagle) 2. Re: Find_closest, bbox, and weirdness (Russell E Owen) 3. more find_closest followup (Jeff Cagle) 4. Re: Find_closest, bbox, and weirdness (Cameron Laird) 5. Resetting to default background color (Vasilis Vlachoudis) ---------------------------------------------------------------------- Message: 1 Date: Thu, 18 Jan 2007 14:24:24 -0500 From: Jeff Cagle Subject: [Tkinter-discuss] more info on find_closest problem To: tkinter-discuss at python.org Message-ID: <45AFC968.8010806 at juno.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Well, I take one thing back: There was a text object at the point (30,10) -- a text object that was updated with mouse x,y coords every time a event fired. When without that text object, find_closest() works well. With it, find_closest gets confused again. It should be possible, I hope, to work around this issue by means of tags for the text objects. But I'm curious: why is this happening? Here's the code, with updated output: [code="seems like it oughta work"] def display(self): self.mainw = Tk() self.mainw.f = Frame(self.mainw) self.mainw.f.c = Canvas(self.mainw.f,width=400,height=400) # remove next line for success with find_closest() self.mainw.f.c.mouse_text = self.mainw.f.c.create_text(30,10,text='') ... self.print_canvas() print "Center coords: (%.1f,%.1f) and (%.1f, %.1f)" % (x0,y0,x1,y1) f = mathutils.line_func((x0,y0),(x1,y1)) g = mathutils.inv_line_func((x0,y0),(x1,y1)) print "Objects near (%.1f,%.1f)" % (x0,y0), \ self.mainw.f.c.find_closest(x0,y0) start_id = self.mainw.f.c.find_closest(x0,y0)[0] print "start_id: ", start_id start_x0,start_y0,start_x1,start_y1 = self.mainw.f.c.bbox(start_id) print "Bounding box near (%.1f,%.1f): (%.1f,%.1f) x (%.1f,%.1f)" % \ (x0,y0,start_x0,start_y0,start_x1,start_y1) print "Objects near (%.1f,%.1f)" % (x1,y1), \ self.mainw.f.c.find_closest(x1,y1) end_id = self.mainw.f.c.find_closest(x1,y1)[0] print "end_id: ", end_id end_x0,end_y0,end_x1,end_y1 = self.mainw.f.c.bbox(end_id) print "Bounding box near (%.1f,%.1f): (%.1f,%.1f) x (%.1f,%.1f)" % \ (x1,y1,end_x0,end_y0,end_x1,end_y1) raw_input("Press to continue...") ... [/code] [output="without offending text object"] >>> p.display() The canvas contains ------------------ Item_ID Type coords 1 text [200.0, 20.0] 2 text [278.09907304116047, 37.825603777564567] 3 text [340.72966684424534, 87.771835665427943] 4 text [375.48702419272826, 159.94623188786341] 5 text [375.48702419272826, 240.05376811213657] 6 text [340.72966684424534, 312.22816433457206] 7 text [278.09907304116047, 362.17439622243546] 8 text [200.00000000000003, 380.0] 9 text [121.90092695883955, 362.17439622243546] 10 text [59.270333155754656, 312.22816433457206] 11 text [24.512975807271744, 240.05376811213659] 12 text [24.512975807271744, 159.94623188786343] 13 text [59.270333155754628, 87.771835665428] 14 text [121.90092695883949, 37.825603777564567] Center coords: (278.1,37.8) and (375.5, 159.9) Objects near (278.1,37.8) (2,) start_id: 2 Bounding box near (278.1,37.8): (269.0,32.0) x (288.0,45.0) Objects near (375.5,159.9) (4,) end_id: 4 Bounding box near (375.5,159.9): (362.0,154.0) x (388.0,167.0) Press to continue... [/output] [output="with offending text object"] >>> p.display() The canvas contains ------------------ Item_ID Type coords 1 text [30.0, 10.0] 2 text [200.0, 20.0] 3 text [278.09907304116047, 37.825603777564567] 4 text [340.72966684424534, 87.771835665427943] 5 text [375.48702419272826, 159.94623188786341] 6 text [375.48702419272826, 240.05376811213657] 7 text [340.72966684424534, 312.22816433457206] 8 text [278.09907304116047, 362.17439622243546] 9 text [200.00000000000003, 380.0] 10 text [121.90092695883955, 362.17439622243546] 11 text [59.270333155754656, 312.22816433457206] 12 text [24.512975807271744, 240.05376811213659] 13 text [24.512975807271744, 159.94623188786343] 14 text [59.270333155754628, 87.771835665428] 15 text [121.90092695883949, 37.825603777564567] Center coords: (278.1,37.8) and (375.5, 159.9) Objects near (278.1,37.8) (1,) start_id: 1 Bounding box near (278.1,37.8): (29.0,4.0) x (31.0,17.0) Objects near (375.5,159.9) (1,) end_id: 1 Bounding box near (375.5,159.9): (29.0,4.0) x (31.0,17.0) Press to continue... [/output] Thanks for any insights, Jeff Cagle ------------------------------ Message: 2 Date: Thu, 18 Jan 2007 12:36:18 -0800 From: Russell E Owen Subject: Re: [Tkinter-discuss] Find_closest, bbox, and weirdness To: tkinter-discuss at python.org Message-ID: In article <45AF2253.2080903 at juno.com>, Jeff Cagle wrote: > So I was trying to pretty up a GUI. It took 20 minutes to write code to > place names in a circle and draw arrows to the names that are related > (actually, the names are filenames, and the arrows represent 'import' or > 'from ... import' statements). > > It's taken a couple of hours to try to clean it up so that the arrows go > up to the bounding box of the text, but not inside. > > Here was the plan: Compute the line that connects the centers of the > text objects. Figure out where that line intersects the bounding boxes > of the texts, and draw the lines to the intersection points instead of > center-to-center. > > It all works ... except that I don't get the right bounding boxes. > Here's the code: it sounds like object with ID 1 may be overlapping all the other objects. Tk's find_closest is primitive in how it handles overlap. Unless you can guarantee that your text objects will never overlap I suggest you find the closest one yourself. Keep a list of object coords and scan through them. If the objects can be moved around then use a callback to update the position. -- Russell ------------------------------ Message: 3 Date: Thu, 18 Jan 2007 16:16:23 -0500 From: Jeff Cagle Subject: [Tkinter-discuss] more find_closest followup To: tkinter-discuss at python.org Message-ID: <45AFE3A7.3060905 at juno.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed In the end, find_closest was giving odd results even when the offending mouse_text object was not created. So I fired it and replaced it with a 'find_closest_label()' that searches only the text labels for the closest match. Problem solved ... errr ... worked around. Jeff ------------------------------ Message: 4 Date: Thu, 18 Jan 2007 21:21:49 +0000 From: Cameron Laird Subject: Re: [Tkinter-discuss] Find_closest, bbox, and weirdness To: Russell E Owen Cc: tkinter-discuss at python.org Message-ID: <20070118212149.GB24852 at lairds.us> Content-Type: text/plain; charset=us-ascii On Thu, Jan 18, 2007 at 12:36:18PM -0800, Russell E Owen wrote: . . . > > Here was the plan: Compute the line that connects the centers of the > > text objects. Figure out where that line intersects the bounding boxes > > of the texts, and draw the lines to the intersection points instead of > > center-to-center. > > > > It all works ... except that I don't get the right bounding boxes. > > Here's the code: > > it sounds like object with ID 1 may be overlapping all the other > objects. Tk's find_closest is primitive in how it handles overlap. > > Unless you can guarantee that your text objects will never overlap I > suggest you find the closest one yourself. Keep a list of object coords > and scan through them. If the objects can be moved around then use a > callback to update the position. . . . ? I've had *great* results with "closest". While I agree that your approach should be kept in mind, it's not the first one I try when I'm in the situation I understand from the original description. Do you have any details on how "closest" has failed for you? ------------------------------ Message: 5 Date: Fri, 19 Jan 2007 10:14:43 +0100 From: "Vasilis Vlachoudis" Subject: [Tkinter-discuss] Resetting to default background color To: Message-ID: <2AACD4EB2F123248A064A23843B3A173020BDE at cernxchg47.cern.ch> Keywords: CERN SpamKiller Note: -50 Charset: west-latin Content-Type: text/plain; charset="us-ascii" Dear All, How can I reset the background color of widget to the default one? Imagine that I create an entry widget with a specific background color i.e. white e=Entry(root, background="white") e.pack() ... and at a later state I want to configure the color to the default system one (equivalent like when I create it: e=Entry(root)) I've tried e["background"] = "" # didn't work e["background"] = None # nothing del e["background"] # neither Cheers Vasilis -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070119/8b722144/attachment.html ------------------------------ _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss End of Tkinter-discuss Digest, Vol 35, Issue 15 *********************************************** --------------------------------- Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070122/8dd00e17/attachment.htm From Vasilis.Vlachoudis at cern.ch Tue Jan 23 11:32:18 2007 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Tue, 23 Jan 2007 11:32:18 +0100 Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 35, Issue 15 In-Reply-To: <51831.29547.qm@web50609.mail.yahoo.com> References: <51831.29547.qm@web50609.mail.yahoo.com> Message-ID: <45B5E432.3050801@cern.ch> Hi Harlin, sorry but I didn't quite understand, you need the full code of the project I am writing or on the specific example that I've send to the list? The full code of the project together with screenshots, documentation etc can be found at http://www.fluka.org/flair while for the specific question on resetting the background color, I will have to make the configuration dialog as a standalone program. Regards Vasilis Harlin Seritt wrote: > Vasilis, > > Would you mind posting your full code for this? > > Thanks, > > Harlin Seritt > > > */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. more info on find_closest problem (Jeff Cagle) > 2. Re: Find_closest, bbox, and weirdness (Russell E Owen) > 3. more find_closest followup (Jeff Cagle) > 4. Re: Find_closest, bbox, and weirdness (Cameron Laird) > 5. Resetting to default background color (Vasilis Vlachoudis) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 18 Jan 2007 14:24:24 -0500 > From: Jeff Cagle > Subject: [Tkinter-discuss] more info on find_closest problem > To: tkinter-discuss at python.org > Message-ID: <45AFC968.8010806 at juno.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Well, I take one thing back: There was a text object at the point > (30,10) -- a text object that was updated with mouse x,y coords every > time a event fired. When without that text object, > find_closest() works well. With it, find_closest gets confused again. > > It should be possible, I hope, to work around this issue by means of > tags for the text objects. But I'm curious: why is this happening? > > Here's the code, with updated output: > > [code="seems like it oughta work"] > def display(self): > self.mainw = Tk() > self.mainw.f = Frame(self.mainw) > self.mainw.f.c = Canvas(self.mainw.f,width=400,height=400) > # remove next line for success with find_closest() > self.mainw.f.c.mouse_text = > self.mainw.f.c.create_text(30,10,text='') > > ... > self.print_canvas() > print "Center coords: (%.1f,%.1f) and (%.1f, %.1f)" % (x0,y0,x1,y1) > f = mathutils.line_func((x0,y0),(x1,y1)) > g = mathutils.inv_line_func((x0,y0),(x1,y1)) > > print "Objects near (%.1f,%.1f)" % (x0,y0), \ > self.mainw.f.c.find_closest(x0,y0) > start_id = self.mainw.f.c.find_closest(x0,y0)[0] > print "start_id: ", start_id > start_x0,start_y0,start_x1,start_y1 = self.mainw.f.c.bbox(start_id) > print "Bounding box near (%.1f,%.1f): (%.1f,%.1f) x (%.1f,%.1f)" % \ > (x0,y0,start_x0,start_y0,start_x1,start_y1) > > print "Objects near (%.1f,%.1f)" % (x1,y1), \ > self.mainw.f.c.find_closest(x1,y1) > end_id = self.mainw.f.c.find_closest(x1,y1)[0] > print "end_id: ", end_id > end_x0,end_y0,end_x1,end_y1 = self.mainw.f.c.bbox(end_id) > print "Bounding box near (%.1f,%.1f): (%.1f,%.1f) x (%.1f,%.1f)" % \ > (x1,y1,end_x0,end_y0,end_x1,end_y1) > > raw_input("Press to continue...") > ... > [/code] > [output="without offending text object"] > >>> p.display() > The canvas contains > ------------------ > Item_ID Type coords > 1 text [200.0, 20.0] > 2 text [278.09907304116047, 37.825603777564567] > 3 text [340.72966684424534, 87.771835665427943] > 4 text [375.48702419272826, 159.94623188786341] > 5 text [375.48702419272826, 240.05376811213657] > 6 text [340.72966684424534, 312.22816433457206] > 7 text [278.09907304116047, 362.17439622243546] > 8 text [200.00000000000003, 380.0] > 9 text [121.90092695883955, 362.17439622243546] > 10 text [59.270333155754656, 312.22816433457206] > 11 text [24.512975807271744, 240.05376811213659] > 12 text [24.512975807271744, 159.94623188786343] > 13 text [59.270333155754628, 87.771835665428] > 14 text [121.90092695883949, 37.825603777564567] > Center coords: (278.1,37.8) and (375.5, 159.9) > Objects near (278.1,37.8) (2,) > start_id: 2 > Bounding box near (278.1,37.8): (269.0,32.0) x (288.0,45.0) > Objects near (375.5,159.9) (4,) > end_id: 4 > Bounding box near (375.5,159.9): (362.0,154.0) x (388.0,167.0) > Press to continue... > [/output] > > [output="with offending text object"] > >>> p.display() > The canvas contains > ------------------ > Item_ID Type coords > 1 text [30.0, 10.0] > 2 text [200.0, 20.0] > 3 text [278.09907304116047, 37.825603777564567] > 4 text [340.72966684424534, 87.771835665427943] > 5 text [375.48702419272826, 159.94623188786341] > 6 text [375.48702419272826, 240.05376811213657] > 7 text [340.72966684424534, 312.22816433457206] > 8 text [278.09907304116047, 362.17439622243546] > 9 text [200.00000000000003, 380.0] > 10 text [121.90092695883955, 362.17439622243546] > 11 text [59.270333155754656, 312.22816433457206] > 12 text [24.512975807271744, 240.05376811213659] > 13 text [24.512975807271744, 159.94623188786343] > 14 text [59.270333155754628, 87.771835665428] > 15 text [121.90092695883949, 37.825603777564567] > Center coords: (278.1,37.8) and (375.5, 159.9) > Objects near (278.1,37.8) (1,) > start_id: 1 > Bounding box near (278.1,37.8): (29.0,4.0) x (31.0,17.0) > Objects near (375.5,159.9) (1,) > end_id: 1 > Bounding box near (375.5,159.9): (29.0,4.0) x (31.0,17.0) > Press to continue... > [/output] > > Thanks for any insights, > Jeff Cagle > > > > > > > ------------------------------ > > Message: 2 > Date: Thu, 18 Jan 2007 12:36:18 -0800 > From: Russell E Owen > Subject: Re: [Tkinter-discuss] Find_closest, bbox, and weirdness > To: tkinter-discuss at python.org > Message-ID: > > In article <45AF2253.2080903 at juno.com>, Jeff Cagle > wrote: > > > So I was trying to pretty up a GUI. It took 20 minutes to write > code to > > place names in a circle and draw arrows to the names that are > related > > (actually, the names are filenames, and the arrows represent > 'import' or > > 'from ... import' statements). > > > > It's taken a couple of hours to try to clean it up so that the > arrows go > > up to the bounding box of the text, but not inside. > > > > Here was the plan: Compute the line that connects the centers of > the > > text objects. Figure out where that line intersects the bounding > boxes > > of the texts, and draw the lines to the intersection points > instead of > > center-to-center. > > > > It all works ... except that I don't get the right bounding boxes. > > Here's the code: > > it sounds like object with ID 1 may be overlapping all the other > objects. Tk's find_closest is primitive in how it handles overlap. > > Unless you can guarantee that your text objects will never overlap I > suggest you find the closest one yourself. Keep a list of object > coords > and scan through them. If the objects can be moved around then use a > callback to update the position. > > -- Russell > > > > ------------------------------ > > Message: 3 > Date: Thu, 18 Jan 2007 16:16:23 -0500 > From: Jeff Cagle > Subject: [Tkinter-discuss] more find_closest followup > To: tkinter-discuss at python.org > Message-ID: <45AFE3A7.3060905 at juno.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > In the end, find_closest was giving odd results even when the > offending > mouse_text object was not created. > > So I fired it and replaced it with a 'find_closest_label()' that > searches only the text labels for the closest match. Problem > solved ... > errr ... worked around. > > Jeff > > > > > ------------------------------ > > Message: 4 > Date: Thu, 18 Jan 2007 21:21:49 +0000 > From: Cameron Laird > Subject: Re: [Tkinter-discuss] Find_closest, bbox, and weirdness > To: Russell E Owen > Cc: tkinter-discuss at python.org > Message-ID: <20070118212149.GB24852 at lairds.us> > Content-Type: text/plain; charset=us-ascii > > On Thu, Jan 18, 2007 at 12:36:18PM -0800, Russell E Owen wrote: > . > . > . > > > Here was the plan: Compute the line that connects the centers > of the > > > text objects. Figure out where that line intersects the > bounding boxes > > > of the texts, and draw the lines to the intersection points > instead of > > > center-to-center. > > > > > > It all works ... except that I don't get the right bounding > boxes. > > > Here's the code: > > > > it sounds like object with ID 1 may be overlapping all the other > > objects. Tk's find_closest is primitive in how it handles overlap. > > > > Unless you can guarantee that your text objects will never > overlap I > > suggest you find the closest one yourself. Keep a list of object > coords > > and scan through them. If the objects can be moved around then > use a > > callback to update the position. > . > . > . > ? I've had *great* results with "closest". While I agree > that your approach should be kept in mind, it's not the > first one I try when I'm in the situation I understand from > the original description. Do you have any details on how > "closest" has failed for you? > > > ------------------------------ > > Message: 5 > Date: Fri, 19 Jan 2007 10:14:43 +0100 > From: "Vasilis Vlachoudis" > Subject: [Tkinter-discuss] Resetting to default background color > To: > Message-ID: > <2AACD4EB2F123248A064A23843B3A173020BDE at cernxchg47.cern.ch> > Keywords: CERN SpamKiller Note: -50 Charset: west-latin > Content-Type: text/plain; charset="us-ascii" > > Dear All, > > > > How can I reset the background color of widget to the default one? > > > > Imagine that I create an entry widget with a specific background color > i.e. white > > e=Entry(root, background="white") > > e.pack() > > ... > > and at a later state I want to configure the color to the default > system > one (equivalent like when I create it: e=Entry(root)) > > I've tried > > e["background"] = "" # didn't work > > e["background"] = None # nothing > > del e["background"] # neither > > > > Cheers > > Vasilis > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/tkinter-discuss/attachments/20070119/8b722144/attachment.html > > > ------------------------------ > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > > End of Tkinter-discuss Digest, Vol 35, Issue 15 > *********************************************** > > > ------------------------------------------------------------------------ > Food fight? > > Enjoy some healthy debate > in the Yahoo! Answers Food & Drink Q&A. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > -------------- next part -------------- A non-text attachment was scrubbed... Name: Vasilis.Vlachoudis.vcf Type: text/x-vcard Size: 312 bytes Desc: not available Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20070123/4afab079/attachment.vcf From bialix at ukr.net Wed Jan 24 12:12:38 2007 From: bialix at ukr.net (Alexander Belchenko) Date: Wed, 24 Jan 2007 13:12:38 +0200 Subject: [Tkinter-discuss] Tk Happy Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm not sure I saw announce in this mailing list so please excuse me if this is double. I just saw this announce in another place: ANN: tk_happy, a framework for creating python Tk apps The main idea behind tk_happy is to allow a fully "wired" Tkinter application to be quickly created . The users main responsibility is to add logic to the Tkinter framework created by tk_happy. http://tk-happy.sourceforge.net/ Alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFtz8lzYr338mxwCURAll2AJ9xFyAq/x7bgzbhKxrD7xUfl0EoRwCfZFMU zmc+pap3XW9z+tv6Mc+utJU= =w9h+ -----END PGP SIGNATURE----- From vvinuv at gmail.com Wed Jan 24 12:47:39 2007 From: vvinuv at gmail.com (Vinu Vikram) Date: Wed, 24 Jan 2007 17:17:39 +0530 Subject: [Tkinter-discuss] Problem when installing python with tkinter module Message-ID: <637563b70701240347h14120df1q9793d9dbf9cb6fbb@mail.gmail.com> Dear Sir I am facing problem when I tried to install python with tkinter module enabled in redhat linux machine. I installed tcl/tk v 8.4.14 properly. Then I have edited the Setup file and it looks like the below. # The _tkinter module. # # The command for _tkinter is long and site specific. Please # uncomment and/or edit those parts as indicated. If you don't have a # specific extension (e.g. Tix or BLT), leave the corresponding line # commented out. (Leave the trailing backslashes in! If you # experience strange errors, you may want to join all uncommented # lines and remove the backslashes -- the backslash interpretation is # done by the shell's "read" command and it may not be implemented on # every system. # *** Always uncomment this (leave the leading underscore in!): _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: -L/usr/local/lib \ # *** Uncomment and edit to reflect where your Tcl/Tk headers are: -I/usr/local/include \ # *** Uncomment and edit to reflect where your X11 header files are: -I/usr/X11R6/include \ # *** Or uncomment this for Solaris: # -I/usr/openwin/include \ # *** Uncomment and edit for Tix extension only: # -DWITH_TIX -ltix8.1.8.2 \ # *** Uncomment and edit for BLT extension only: # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ # *** Uncomment and edit for PIL (TkImaging) extension only: # (See http://www.pythonware.com/products/pil/ for more info) # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ # *** Uncomment and edit for TOGL extension only: # -DWITH_TOGL togl.c \ # *** Uncomment and edit to reflect your Tcl/Tk versions: -ltk8.4 -ltcl8.4 \ # *** Uncomment and edit to reflect where your X11 libraries are: -L/usr/X11R6/lib \ # *** Or uncomment this for Solaris: # -L/usr/openwin/lib \ # *** Uncomment these for TOGL extension only: # -lGL -lGLU -lXext -lXmu \ # *** Uncomment for AIX: # -lld \ # *** Always uncomment this; X11 libraries to link with: -lX11 But whenever I make python-2.4.3 it shows the error ./python: error while loading shared libraries: libtk8.4.so: cannot open shared object file: No such file or directory make: *** [sharedmods] Error 127 I request you to help me to solve the problem. Thanking You -- VINU VIKRAM http://iucaa.ernet.in/~vvinuv/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070124/2c0278f7/attachment.htm From klappnase at web.de Wed Jan 24 18:28:23 2007 From: klappnase at web.de (Michael Lange) Date: Wed, 24 Jan 2007 18:28:23 +0100 Subject: [Tkinter-discuss] Problem when installing python with tkinter module In-Reply-To: <637563b70701240347h14120df1q9793d9dbf9cb6fbb@mail.gmail.com> References: <637563b70701240347h14120df1q9793d9dbf9cb6fbb@mail.gmail.com> Message-ID: <20070124182823.77155d8e.klappnase@web.de> Hi, I know it is not exactly what you have been asking, but aren't there any precompiled rpm packages for your redhat system available? And, if not, why do you edit the setup file? For me always a simple ./configure && make && make install worked fine. Have you already tried this, and if yes, what went wrong? Michael On Wed, 24 Jan 2007 17:17:39 +0530 "Vinu Vikram" wrote: > Dear Sir > I am facing problem when I tried to install python with tkinter module > enabled in redhat linux machine. I installed tcl/tk v 8.4.14 properly. Then > I have edited the Setup file and it looks like the below. > > # The _tkinter module. > # > # The command for _tkinter is long and site specific. Please > # uncomment and/or edit those parts as indicated. If you don't have a > # specific extension (e.g. Tix or BLT), leave the corresponding line > # commented out. (Leave the trailing backslashes in! If you > # experience strange errors, you may want to join all uncommented > # lines and remove the backslashes -- the backslash interpretation is > # done by the shell's "read" command and it may not be implemented on > # every system. > > # *** Always uncomment this (leave the leading underscore in!): > _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ > # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: > -L/usr/local/lib \ > # *** Uncomment and edit to reflect where your Tcl/Tk headers are: > -I/usr/local/include \ > # *** Uncomment and edit to reflect where your X11 header files are: > -I/usr/X11R6/include \ > # *** Or uncomment this for Solaris: > # -I/usr/openwin/include \ > # *** Uncomment and edit for Tix extension only: > # -DWITH_TIX -ltix8.1.8.2 \ > # *** Uncomment and edit for BLT extension only: > # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ > # *** Uncomment and edit for PIL (TkImaging) extension only: > # (See http://www.pythonware.com/products/pil/ for more info) > # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ > # *** Uncomment and edit for TOGL extension only: > # -DWITH_TOGL togl.c \ > # *** Uncomment and edit to reflect your Tcl/Tk versions: > -ltk8.4 -ltcl8.4 \ > # *** Uncomment and edit to reflect where your X11 libraries are: > -L/usr/X11R6/lib \ > # *** Or uncomment this for Solaris: > # -L/usr/openwin/lib \ > # *** Uncomment these for TOGL extension only: > # -lGL -lGLU -lXext -lXmu \ > # *** Uncomment for AIX: > # -lld \ > # *** Always uncomment this; X11 libraries to link with: > -lX11 > > > But whenever I make python-2.4.3 it shows the error > > ./python: error while loading shared libraries: libtk8.4.so: cannot open > shared object file: No such file or directory > make: *** [sharedmods] Error 127 > > I request you to help me to solve the problem. > Thanking You > -- > VINU VIKRAM > http://iucaa.ernet.in/~vvinuv/ > From vvinuv at gmail.com Thu Jan 25 19:14:02 2007 From: vvinuv at gmail.com (Vinu Vikram) Date: Thu, 25 Jan 2007 23:44:02 +0530 Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 35, Issue 20 In-Reply-To: References: Message-ID: <637563b70701251014w1b85c412l6b346ca191cfed70@mail.gmail.com> Thanks Michael! But I have already tried ./configure make make install without editing the Setup file. But then I could not import Tkinter module from python. regards Vinu V. On 1/25/07, tkinter-discuss-request at python.org < 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. Tk Happy (Alexander Belchenko) > 2. Problem when installing python with tkinter module (Vinu Vikram) > 3. Re: Problem when installing python with tkinter module > (Michael Lange) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 24 Jan 2007 13:12:38 +0200 > From: Alexander Belchenko > Subject: [Tkinter-discuss] Tk Happy > To: tkinter-discuss at python.org > Message-ID: > Content-Type: text/plain; charset=KOI8-R > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm not sure I saw announce in this mailing list > so please excuse me if this is double. > I just saw this announce in another place: > > ANN: tk_happy, a framework for creating python Tk apps > > The main idea behind tk_happy is to allow a fully "wired" Tkinter > application to be quickly created . The users main responsibility is to > add logic to the Tkinter framework created by > tk_happy. > > http://tk-happy.sourceforge.net/ > > > Alexander > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.5 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFtz8lzYr338mxwCURAll2AJ9xFyAq/x7bgzbhKxrD7xUfl0EoRwCfZFMU > zmc+pap3XW9z+tv6Mc+utJU= > =w9h+ > -----END PGP SIGNATURE----- > > > > ------------------------------ > > Message: 2 > Date: Wed, 24 Jan 2007 17:17:39 +0530 > From: "Vinu Vikram" > Subject: [Tkinter-discuss] Problem when installing python with tkinter > module > To: tkinter-discuss at python.org > Message-ID: > <637563b70701240347h14120df1q9793d9dbf9cb6fbb at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear Sir > I am facing problem when I tried to install python with tkinter module > enabled in redhat linux machine. I installed tcl/tk v 8.4.14 properly. > Then > I have edited the Setup file and it looks like the below. > > # The _tkinter module. > # > # The command for _tkinter is long and site specific. Please > # uncomment and/or edit those parts as indicated. If you don't have a > # specific extension (e.g. Tix or BLT), leave the corresponding line > # commented out. (Leave the trailing backslashes in! If you > # experience strange errors, you may want to join all uncommented > # lines and remove the backslashes -- the backslash interpretation is > # done by the shell's "read" command and it may not be implemented on > # every system. > > # *** Always uncomment this (leave the leading underscore in!): > _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ > # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: > -L/usr/local/lib \ > # *** Uncomment and edit to reflect where your Tcl/Tk headers are: > -I/usr/local/include \ > # *** Uncomment and edit to reflect where your X11 header files are: > -I/usr/X11R6/include \ > # *** Or uncomment this for Solaris: > # -I/usr/openwin/include \ > # *** Uncomment and edit for Tix extension only: > # -DWITH_TIX -ltix8.1.8.2 \ > # *** Uncomment and edit for BLT extension only: > # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ > # *** Uncomment and edit for PIL (TkImaging) extension only: > # (See http://www.pythonware.com/products/pil/ for more info) > # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ > # *** Uncomment and edit for TOGL extension only: > # -DWITH_TOGL togl.c \ > # *** Uncomment and edit to reflect your Tcl/Tk versions: > -ltk8.4 -ltcl8.4 \ > # *** Uncomment and edit to reflect where your X11 libraries are: > -L/usr/X11R6/lib \ > # *** Or uncomment this for Solaris: > # -L/usr/openwin/lib \ > # *** Uncomment these for TOGL extension only: > # -lGL -lGLU -lXext -lXmu \ > # *** Uncomment for AIX: > # -lld \ > # *** Always uncomment this; X11 libraries to link with: > -lX11 > > > But whenever I make python-2.4.3 it shows the error > > ./python: error while loading shared libraries: libtk8.4.so: cannot open > shared object file: No such file or directory > make: *** [sharedmods] Error 127 > > I request you to help me to solve the problem. > Thanking You > -- > VINU VIKRAM > http://iucaa.ernet.in/~vvinuv/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/tkinter-discuss/attachments/20070124/2c0278f7/attachment.html > > ------------------------------ > > Message: 3 > Date: Wed, 24 Jan 2007 18:28:23 +0100 > From: Michael Lange > Subject: Re: [Tkinter-discuss] Problem when installing python with > tkinter module > To: tkinter-discuss at python.org > Message-ID: <20070124182823.77155d8e.klappnase at web.de> > Content-Type: text/plain; charset=US-ASCII > > Hi, > > I know it is not exactly what you have been asking, but aren't there any > precompiled rpm packages for your redhat system available? > And, if not, why do you edit the setup file? For me always a simple > ./configure && make && make install worked fine. Have you already tried > this, > and if yes, what went wrong? > > Michael > > On Wed, 24 Jan 2007 17:17:39 +0530 > "Vinu Vikram" wrote: > > > Dear Sir > > I am facing problem when I tried to install python with tkinter module > > enabled in redhat linux machine. I installed tcl/tk v 8.4.14 properly. > Then > > I have edited the Setup file and it looks like the below. > > > > # The _tkinter module. > > # > > # The command for _tkinter is long and site specific. Please > > # uncomment and/or edit those parts as indicated. If you don't have a > > # specific extension (e.g. Tix or BLT), leave the corresponding line > > # commented out. (Leave the trailing backslashes in! If you > > # experience strange errors, you may want to join all uncommented > > # lines and remove the backslashes -- the backslash interpretation is > > # done by the shell's "read" command and it may not be implemented on > > # every system. > > > > # *** Always uncomment this (leave the leading underscore in!): > > _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ > > # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: > > -L/usr/local/lib \ > > # *** Uncomment and edit to reflect where your Tcl/Tk headers are: > > -I/usr/local/include \ > > # *** Uncomment and edit to reflect where your X11 header files are: > > -I/usr/X11R6/include \ > > # *** Or uncomment this for Solaris: > > # -I/usr/openwin/include \ > > # *** Uncomment and edit for Tix extension only: > > # -DWITH_TIX -ltix8.1.8.2 \ > > # *** Uncomment and edit for BLT extension only: > > # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ > > # *** Uncomment and edit for PIL (TkImaging) extension only: > > # (See http://www.pythonware.com/products/pil/ for more info) > > # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ > > # *** Uncomment and edit for TOGL extension only: > > # -DWITH_TOGL togl.c \ > > # *** Uncomment and edit to reflect your Tcl/Tk versions: > > -ltk8.4 -ltcl8.4 \ > > # *** Uncomment and edit to reflect where your X11 libraries are: > > -L/usr/X11R6/lib \ > > # *** Or uncomment this for Solaris: > > # -L/usr/openwin/lib \ > > # *** Uncomment these for TOGL extension only: > > # -lGL -lGLU -lXext -lXmu \ > > # *** Uncomment for AIX: > > # -lld \ > > # *** Always uncomment this; X11 libraries to link with: > > -lX11 > > > > > > But whenever I make python-2.4.3 it shows the error > > > > ./python: error while loading shared libraries: libtk8.4.so: cannot open > > shared object file: No such file or directory > > make: *** [sharedmods] Error 127 > > > > I request you to help me to solve the problem. > > Thanking You > > -- > > VINU VIKRAM > > http://iucaa.ernet.in/~vvinuv/ > > > > > ------------------------------ > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > > End of Tkinter-discuss Digest, Vol 35, Issue 20 > *********************************************** > -- VINU VIKRAM http://iucaa.ernet.in/~vvinuv/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070125/8eabc9a8/attachment.htm From jrcagle at juno.com Fri Jan 26 03:33:26 2007 From: jrcagle at juno.com (Jeff Cagle) Date: Thu, 25 Jan 2007 21:33:26 -0500 Subject: [Tkinter-discuss] Public properties in Tkinter superclasses? In-Reply-To: References: Message-ID: <45B96876.6020609@juno.com> Hi all, I wrote a small "can you match the color?" program. The user is confronted with a 4-bit/chan. color code such as '#3F6' and must click the button out of six whose color matches the code. Feedback in the form of 'that color is #8D2' is given. There is also a Reset button so that the user can try a different panel of six colors when he desires. Anyways, because I needed each button to display different feedback, I ended up inheriting from the Button base class. The original intent was to create a color public property that could be set and gotten: ---- class MyButton(Button): HEX = "0123456789ABCDEF" def __init__(self, master): self.color = self.rand_color() Button.__init__(self, master, \ fg=self.color,\ bitmap="gray75",\ width=50,\ command = self.report) def get_color(self): return self['fg'] def set_color(self, color): self['fg'] = color color = property(get_color, set_color) def rand_color(self): return '#' + ''.join([random.choice(self.HEX) for x in range(3)]) def report(self): Answer.set("That color is %s" % self.color) ---- Oddly, though, the get_color and set_color methods did not work properly on Reset. For the first run, the colors are set and gotten correctly. But if the reset code is called, ---- def restart(self): for x in self.buttons: x.color = x.rand_color() s = random.choice(self.buttons).color self.update() self.set_display(s) ---- the new colors are not set. Further, if new colors are assigned manually, the call to get_color() returns the originally assigned color. BUT, if I comment out the set_ and get_ methods and the 'color = property()' line, and allow color to be a normal private property, then this works to assign new colors: ---- def restart(self): for x in self.buttons: x.color = x.rand_color() x['fg'] = x.color s = random.choice(self.buttons).color self.update() self.set_display(s) ---- The only difference appears to be that I'm manually calling x['fg'] instead of relying on set_color() to do so for me. I can't fathom why that would make a difference. Do Tkinter classes not allow for property() s? Thanks, Jeff From dblank at brynmawr.edu Fri Jan 26 03:47:17 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Thu, 25 Jan 2007 21:47:17 -0500 Subject: [Tkinter-discuss] Public properties in Tkinter superclasses? In-Reply-To: <45B96876.6020609@juno.com> References: <45B96876.6020609@juno.com> Message-ID: <45B96BB5.2010805@brynmawr.edu> I'm not a Tkinter expert, but I have run into a similar problem that was caused by the class not being based on the new style "object". You might try: class MyButton(Button, object): to see if you get properties to work. But maybe I'm completely off the mark, and a tkinter expert will give you better information. -Doug Jeff Cagle wrote: > Hi all, > > I wrote a small "can you match the color?" program. The user is > confronted with a 4-bit/chan. color code such as '#3F6' and must click > the button out of six whose color matches the code. Feedback in the > form of 'that color is #8D2' is given. There is also a Reset button so > that the user can try a different panel of six colors when he desires. > > Anyways, because I needed each button to display different feedback, I > ended up inheriting from the Button base class. The original intent was > to create a color public property that could be set and gotten: > > ---- > class MyButton(Button): > > HEX = "0123456789ABCDEF" > > def __init__(self, master): > self.color = self.rand_color() > Button.__init__(self, master, \ > fg=self.color,\ > bitmap="gray75",\ > width=50,\ > command = self.report) > def get_color(self): > return self['fg'] > > def set_color(self, color): > self['fg'] = color > > color = property(get_color, set_color) > > def rand_color(self): > return '#' + ''.join([random.choice(self.HEX) for x in range(3)]) > > def report(self): > Answer.set("That color is %s" % self.color) > ---- > > Oddly, though, the get_color and set_color methods did not work properly > on Reset. For the first run, the colors are set and gotten correctly. > But if the reset code is called, > > ---- > def restart(self): > for x in self.buttons: > x.color = x.rand_color() > s = random.choice(self.buttons).color > self.update() > self.set_display(s) > ---- > > the new colors are not set. Further, if new colors are assigned > manually, the call to get_color() returns the originally assigned > color. BUT, if I comment out the set_ and get_ methods and the 'color = > property()' line, and allow color to be a normal private property, then > this works to assign new colors: > > ---- > def restart(self): > for x in self.buttons: > x.color = x.rand_color() > x['fg'] = x.color > s = random.choice(self.buttons).color > self.update() > self.set_display(s) > ---- > > The only difference appears to be that I'm manually calling x['fg'] > instead of relying on set_color() to do so for me. I can't fathom why > that would make a difference. > > Do Tkinter classes not allow for property() s? > > Thanks, > Jeff > > > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > From klappnase at freenet.de Fri Jan 26 09:30:12 2007 From: klappnase at freenet.de (Michael Lange) Date: Fri, 26 Jan 2007 09:30:12 +0100 Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 35, Issue 20 In-Reply-To: <637563b70701251014w1b85c412l6b346ca191cfed70@mail.gmail.com> References: <637563b70701251014w1b85c412l6b346ca191cfed70@mail.gmail.com> Message-ID: <20070126093012.7ae55e57.klappnase@freenet.de> On Thu, 25 Jan 2007 23:44:02 +0530 "Vinu Vikram" wrote: > Thanks Michael! > But I have already tried > ./configure > make > make install > without editing the Setup file. But then I could not import Tkinter module > from python. > regards > Vinu V. > Hi Vinu, are you sure that the tcl and tk development packages are installed and that python can find them when running ./configure ? And which python sources are you using? Sometimes it is better to not use the distribution's source packages but those from python.org . I ask because I think it really should not be necessary to edit any files when compiling python. Michael From jrcagle at juno.com Sun Jan 28 20:17:03 2007 From: jrcagle at juno.com (Jeff Cagle) Date: Sun, 28 Jan 2007 14:17:03 -0500 Subject: [Tkinter-discuss] Public properties In-Reply-To: References: Message-ID: <45BCF6AF.30500@juno.com> Multiply inheriting from 'Button' and 'object' seems to work. Thanks! Jeff From howard at eegsoftware.com Tue Jan 30 00:41:03 2007 From: howard at eegsoftware.com (Howard Lightstone) Date: Mon, 29 Jan 2007 23:41:03 +0000 (UTC) Subject: [Tkinter-discuss] radiobutton initial selection Message-ID: I am trying to get a radiobutton without an indicator to show selection state. Calling .invoke() in the widget causes all the callback things to happen but ... The button does NOT show the 'selected' state like it does if I click on the button with the mouse. .select() and .invoke() do not seem to change this display issue. Is there another way to get the select highlighting (sunken button) to happen? I am using 2.2.3 (with Tk 8.3) but it works the same way with 2.5 (and tk 8.4.14). Is this a tk bug? It looks like _tkinter just passes on arguments to tk with minimal processing. From klappnase at web.de Tue Jan 30 11:49:50 2007 From: klappnase at web.de (Michael Lange) Date: Tue, 30 Jan 2007 11:49:50 +0100 Subject: [Tkinter-discuss] radiobutton initial selection In-Reply-To: References: Message-ID: <20070130114950.55655fb6.klappnase@web.de> On Mon, 29 Jan 2007 23:41:03 +0000 (UTC) Howard Lightstone wrote: > I am trying to get a radiobutton without an indicator to show selection > state. Calling .invoke() in the widget causes all the callback things to > happen but ... > > The button does NOT show the 'selected' state like it does if I click on > the button with the mouse. > > .select() and .invoke() do not seem to change this display issue. > > Is there another way to get the select highlighting (sunken button) to > happen? > > I am using 2.2.3 (with Tk 8.3) but it works the same way with 2.5 (and tk > 8.4.14). > > Is this a tk bug? It looks like _tkinter just passes on arguments to tk > with minimal processing. > Hi Howard, It works well for me, can you show us some of your code that does not work? The code snippet that worked for me: >>> from Tkinter import * >>> r=Tk() >>> s=StringVar() >>> s.set('1') >>> r1=Radiobutton(r, text='1', value='1', variable=s) >>> r1.pack() >>> r2=Radiobutton(r, text='2', value='2', variable=s) >>> r2.pack() >>> r2.select() >>> r1.select() Michael From gerardo at computo-industrial.com.mx Wed Jan 31 16:34:15 2007 From: gerardo at computo-industrial.com.mx (Gerardo Juarez) Date: Wed, 31 Jan 2007 10:34:15 -0500 (EST) Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 35, Issue 20 In-Reply-To: <637563b70701251014w1b85c412l6b346ca191cfed70@mail.gmail.com> Message-ID: Hi, Have you verified that the shared library that can't be found is in fact somewhere in the file system? If this is so, its directory should be listed in /etc/ld.so.conf and I think you have to run ldconfig as root to re-read this file. Then I would try to rerun the installation without modifying the setup file. Saludos, Gerardo On Thu, 25 Jan 2007, Vinu Vikram wrote: > Thanks Michael! > But I have already tried > ./configure > make > make install > without editing the Setup file. But then I could not import Tkinter module > from python. > regards > Vinu V. > > > > Message: 1 > > Date: Wed, 24 Jan 2007 13:12:38 +0200 > > From: Alexander Belchenko > > Subject: [Tkinter-discuss] Tk Happy > > To: tkinter-discuss at python.org > > Message-ID: > > Content-Type: text/plain; charset=KOI8-R > > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > I'm not sure I saw announce in this mailing list > > so please excuse me if this is double. > > I just saw this announce in another place: > > > > ANN: tk_happy, a framework for creating python Tk apps > > > > The main idea behind tk_happy is to allow a fully "wired" Tkinter > > application to be quickly created . The users main responsibility is to > > add logic to the Tkinter framework created by > > tk_happy. > > > > http://tk-happy.sourceforge.net/ > > > > > > Alexander > > > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.5 (MingW32) > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > > > iD8DBQFFtz8lzYr338mxwCURAll2AJ9xFyAq/x7bgzbhKxrD7xUfl0EoRwCfZFMU > > zmc+pap3XW9z+tv6Mc+utJU= > > =w9h+ > > -----END PGP SIGNATURE----- > > > > > > > > ------------------------------ > > > > Message: 2 > > Date: Wed, 24 Jan 2007 17:17:39 +0530 > > From: "Vinu Vikram" > > Subject: [Tkinter-discuss] Problem when installing python with tkinter > > module > > To: tkinter-discuss at python.org > > Message-ID: > > <637563b70701240347h14120df1q9793d9dbf9cb6fbb at mail.gmail.com> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Dear Sir > > I am facing problem when I tried to install python with tkinter module > > enabled in redhat linux machine. I installed tcl/tk v 8.4.14 properly. > > Then > > I have edited the Setup file and it looks like the below. > > > > # The _tkinter module. > > # > > # The command for _tkinter is long and site specific. Please > > # uncomment and/or edit those parts as indicated. If you don't have a > > # specific extension (e.g. Tix or BLT), leave the corresponding line > > # commented out. (Leave the trailing backslashes in! If you > > # experience strange errors, you may want to join all uncommented > > # lines and remove the backslashes -- the backslash interpretation is > > # done by the shell's "read" command and it may not be implemented on > > # every system. > > > > # *** Always uncomment this (leave the leading underscore in!): > > _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ > > # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: > > -L/usr/local/lib \ > > # *** Uncomment and edit to reflect where your Tcl/Tk headers are: > > -I/usr/local/include \ > > # *** Uncomment and edit to reflect where your X11 header files are: > > -I/usr/X11R6/include \ > > # *** Or uncomment this for Solaris: > > # -I/usr/openwin/include \ > > # *** Uncomment and edit for Tix extension only: > > # -DWITH_TIX -ltix8.1.8.2 \ > > # *** Uncomment and edit for BLT extension only: > > # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ > > # *** Uncomment and edit for PIL (TkImaging) extension only: > > # (See http://www.pythonware.com/products/pil/ for more info) > > # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ > > # *** Uncomment and edit for TOGL extension only: > > # -DWITH_TOGL togl.c \ > > # *** Uncomment and edit to reflect your Tcl/Tk versions: > > -ltk8.4 -ltcl8.4 \ > > # *** Uncomment and edit to reflect where your X11 libraries are: > > -L/usr/X11R6/lib \ > > # *** Or uncomment this for Solaris: > > # -L/usr/openwin/lib \ > > # *** Uncomment these for TOGL extension only: > > # -lGL -lGLU -lXext -lXmu \ > > # *** Uncomment for AIX: > > # -lld \ > > # *** Always uncomment this; X11 libraries to link with: > > -lX11 > > > > > > But whenever I make python-2.4.3 it shows the error > > > > ./python: error while loading shared libraries: libtk8.4.so: cannot open > > shared object file: No such file or directory > > make: *** [sharedmods] Error 127 > > > > I request you to help me to solve the problem. > > Thanking You > > -- > > VINU VIKRAM > > http://iucaa.ernet.in/~vvinuv/ > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > http://mail.python.org/pipermail/tkinter-discuss/attachments/20070124/2c0278f7/attachment.html > > > > ------------------------------ > > > > Message: 3 > > Date: Wed, 24 Jan 2007 18:28:23 +0100 > > From: Michael Lange > > Subject: Re: [Tkinter-discuss] Problem when installing python with > > tkinter module > > To: tkinter-discuss at python.org > > Message-ID: <20070124182823.77155d8e.klappnase at web.de> > > Content-Type: text/plain; charset=US-ASCII > > > > Hi, > > > > I know it is not exactly what you have been asking, but aren't there any > > precompiled rpm packages for your redhat system available? > > And, if not, why do you edit the setup file? For me always a simple > > ./configure && make && make install worked fine. Have you already tried > > this, > > and if yes, what went wrong? > > > > Michael > > > > On Wed, 24 Jan 2007 17:17:39 +0530 > > "Vinu Vikram" wrote: > > > > > Dear Sir > > > I am facing problem when I tried to install python with tkinter module > > > enabled in redhat linux machine. I installed tcl/tk v 8.4.14 properly. > > Then > > > I have edited the Setup file and it looks like the below. > > > > > > # The _tkinter module. > > > # > > > # The command for _tkinter is long and site specific. Please > > > # uncomment and/or edit those parts as indicated. If you don't have a > > > # specific extension (e.g. Tix or BLT), leave the corresponding line > > > # commented out. (Leave the trailing backslashes in! If you > > > # experience strange errors, you may want to join all uncommented > > > # lines and remove the backslashes -- the backslash interpretation is > > > # done by the shell's "read" command and it may not be implemented on > > > # every system. > > > > > > # *** Always uncomment this (leave the leading underscore in!): > > > _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ > > > # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: > > > -L/usr/local/lib \ > > > # *** Uncomment and edit to reflect where your Tcl/Tk headers are: > > > -I/usr/local/include \ > > > # *** Uncomment and edit to reflect where your X11 header files are: > > > -I/usr/X11R6/include \ > > > # *** Or uncomment this for Solaris: > > > # -I/usr/openwin/include \ > > > # *** Uncomment and edit for Tix extension only: > > > # -DWITH_TIX -ltix8.1.8.2 \ > > > # *** Uncomment and edit for BLT extension only: > > > # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ > > > # *** Uncomment and edit for PIL (TkImaging) extension only: > > > # (See http://www.pythonware.com/products/pil/ for more info) > > > # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ > > > # *** Uncomment and edit for TOGL extension only: > > > # -DWITH_TOGL togl.c \ > > > # *** Uncomment and edit to reflect your Tcl/Tk versions: > > > -ltk8.4 -ltcl8.4 \ > > > # *** Uncomment and edit to reflect where your X11 libraries are: > > > -L/usr/X11R6/lib \ > > > # *** Or uncomment this for Solaris: > > > # -L/usr/openwin/lib \ > > > # *** Uncomment these for TOGL extension only: > > > # -lGL -lGLU -lXext -lXmu \ > > > # *** Uncomment for AIX: > > > # -lld \ > > > # *** Always uncomment this; X11 libraries to link with: > > > -lX11 > > > > > > > > > But whenever I make python-2.4.3 it shows the error > > > > > > ./python: error while loading shared libraries: libtk8.4.so: cannot open > > > shared object file: No such file or directory > > > make: *** [sharedmods] Error 127 > > > > > > I request you to help me to solve the problem. > > > Thanking You > > > -- > > > VINU VIKRAM > > > http://iucaa.ernet.in/~vvinuv/ > > > > > > > > > ------------------------------ > > > > _______________________________________________ > > Tkinter-discuss mailing list > > Tkinter-discuss at python.org > > http://mail.python.org/mailman/listinfo/tkinter-discuss > > > > > > End of Tkinter-discuss Digest, Vol 35, Issue 20 > > *********************************************** > > > > > >