From jrcagle at juno.com Fri Mar 2 15:06:05 2007 From: jrcagle at juno.com (jrcagle at juno.com) Date: Fri, 2 Mar 2007 14:06:05 GMT Subject: [Tkinter-discuss] KeyPress/KeyRelease binding: PCs v. MacOS Message-ID: <20070302.060628.3453.2051868@webmail32.nyc.untd.com> An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070302/6388b34d/attachment.asc From sxn02 at yahoo.com Sun Mar 11 21:58:02 2007 From: sxn02 at yahoo.com (Sorin Schwimmer) Date: Sun, 11 Mar 2007 13:58:02 -0700 (PDT) Subject: [Tkinter-discuss] Fancy Toplevels Message-ID: <746857.40081.qm@web56008.mail.re3.yahoo.com> Hi All, I am trying to accomplish two things: 1. Set window's border colour 2. Set a coloured miniicon I am running on Linux. Can I do these? How? Thanks for your advice Sorin ____________________________________________________________________________________ Don't get soaked. Take a quick peek at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather From Vasilis.Vlachoudis at cern.ch Tue Mar 20 08:18:38 2007 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Tue, 20 Mar 2007 08:18:38 +0100 Subject: [Tkinter-discuss] Unicode characters in canvas postscript Message-ID: <2AACD4EB2F123248A064A23843B3A173158910@cernxchg47.cern.ch> Dear All, I want to add "print to postscript" functionality on my program. I have used the "postscript" method of Canvas, and it works nicely apart from all no-latin (Unicode) characters. On the screen appear Ok but on the postscript are replaced by question marks ?. Is it possible to print non-latin characters on the postscript generated from the Canvas, or it is only limited to latin (ASCII) characters? Thanks in advance Vasilis -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070320/7152f139/attachment.htm From mkieverpy at tlink.de Tue Mar 20 12:12:32 2007 From: mkieverpy at tlink.de (mkieverpy at tlink.de) Date: Tue, 20 Mar 2007 11:12:32 -0000 Subject: [Tkinter-discuss] Unicode characters in canvas postscript Message-ID: <20070320101155.E3000B954@mail.terralink.de> Hello Vasilis, >I want to add "print to postscript" functionality on my program. I have >used the "postscript" method of Canvas, and it works nicely apart from >all no-latin (Unicode) characters. On the screen appear Ok but on the >postscript are replaced by question marks ?. Do you mean question marks in the Postscript file or the printout? If the Postscript file looks ok, it's your printing system. At least on Mac OS X there were several issues regarding unicode and Tk. So your Tk should be quite recent. I could give it a try on a Linux system, if you're interested. Regards, Matthias Kievernagel (mkiever/at/web/dot/de) From klappnase at web.de Tue Mar 20 12:47:35 2007 From: klappnase at web.de (Michael Lange) Date: Tue, 20 Mar 2007 12:47:35 +0100 Subject: [Tkinter-discuss] Unicode characters in canvas postscript In-Reply-To: <20070320101155.E3000B954@mail.terralink.de> References: <20070320101155.E3000B954@mail.terralink.de> Message-ID: <20070320124735.166c3d32.klappnase@web.de> On Tue, 20 Mar 2007 11:12:32 -0000 mkieverpy at tlink.de wrote: > > Hello Vasilis, > > >I want to add "print to postscript" functionality on my program. I have > >used the "postscript" method of Canvas, and it works nicely apart from > >all no-latin (Unicode) characters. On the screen appear Ok but on the > >postscript are replaced by question marks ?. > > Do you mean question marks in the Postscript file or the printout? > If the Postscript file looks ok, it's your printing system. > At least on Mac OS X there were several issues regarding unicode and Tk. > So your Tk should be quite recent. > I could give it a try on a Linux system, if you're interested. > On my linux box latin-1 non-ascii characters print ok, but on asian characters I get question marks in the postscript file, and it happens with Tk-8.5, so I don't think it's my Tk which is too old. I don't think it is a Tk-and-unicode issue at all, because the characters seem to display correctly in the canvas; maybe it's rather a limitation of postscript? I found this quote on : Does PostScript support unicode for CJK fonts? PostScript does not specifically support Unicode. It includes general support (from level 2) for multi-byte (2, 3 or 4 byte) fonts. Unicode is just a special case of multi-byte encoding. There is no Unicode font as such, but you can use multi-byte CID fonts that provide support for ranges of Unicode. There are no freely redistributable Unicode CMaps. They can be derived from MS Windows code pages and corresponding Adobe CMaps. Developers often look for a "simple" way to just include Unicode strings with no checking for ranges, language etc. but this is a pipe dream. Not sure if this explains it all, though. Regards Michael From Vasilis.Vlachoudis at cern.ch Tue Mar 20 15:01:10 2007 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Tue, 20 Mar 2007 15:01:10 +0100 Subject: [Tkinter-discuss] Unicode characters in canvas postscript In-Reply-To: <20070320101155.E3000B954@mail.terralink.de> References: <20070320101155.E3000B954@mail.terralink.de> Message-ID: <2AACD4EB2F123248A064A23843B3A173020C71@cernxchg47.cern.ch> Hi Matthias, thank you for your reply. Indeed the question marks are inside the postscript. I was checking the postscript code generated and for the Unicode characters it looks like this: gsave /Helvetica findfont 6 scalefont ISOEncode setfont 0.000 0.392 0.000 setrgbcolor AdjustColor 413 1250 [ [( ? )] ] 14 -0 0 0 false DrawText grestore Strings in postscript are enclosed in parenthesis ( ) I have tried it only on Linux (FC5). I went through the documentation of tcl/tk it they claim that the canvas postscript is working with Unicode characters. Best Regards Vasilis -----Original Message----- From: tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org [mailto:tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] On Behalf Of mkieverpy at tlink.de Sent: Tuesday, 20 March 2007 12:13 To: tkinter-discuss at python.org Subject: Re: [Tkinter-discuss] Unicode characters in canvas postscript Hello Vasilis, >I want to add "print to postscript" functionality on my program. I have >used the "postscript" method of Canvas, and it works nicely apart from >all no-latin (Unicode) characters. On the screen appear Ok but on the >postscript are replaced by question marks ?. Do you mean question marks in the Postscript file or the printout? If the Postscript file looks ok, it's your printing system. At least on Mac OS X there were several issues regarding unicode and Tk. So your Tk should be quite recent. I could give it a try on a Linux system, if you're interested. Regards, Matthias Kievernagel (mkiever/at/web/dot/de) _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss From godsknight07 at gmail.com Tue Mar 27 06:49:56 2007 From: godsknight07 at gmail.com (Sang Park) Date: Mon, 26 Mar 2007 23:49:56 -0500 Subject: [Tkinter-discuss] help needed with radiobutton Message-ID: how do I select radionbutton by default? for my school project, I need to have 10 radio buttons and have half of them selected I have for i in range(10): x = IntVar() if i < 5: rb = Radiobutton(buttonFrame, variable=x, value=1,state=DISABLED) else: rb = Radiobutton(buttonFrame, variable=x, value=0,state=DISABLED) I tried x.set(1) or x.set(0) before or after but the all seem to be deselected when displayed on the screen I also tried calling rb.select/deselect() but that doesn't seem to work either... can anyone help me? Sang Park lordofthefobs at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070326/eabc0177/attachment.htm From mikael at isy.liu.se Tue Mar 27 16:51:42 2007 From: mikael at isy.liu.se (Mikael Olofsson) Date: Tue, 27 Mar 2007 16:51:42 +0200 Subject: [Tkinter-discuss] help needed with radiobutton In-Reply-To: References: Message-ID: <46092F7E.1040803@isy.liu.se> Sang Park wrote: > how do I select radionbutton by default? > for my school project, I need to have 10 radio buttons and have half > of them selected > I have > for i in range(10): > x = IntVar() > if i < 5: > rb = Radiobutton(buttonFrame, variable=x, value=1,state=DISABLED) > else: > rb = Radiobutton(buttonFrame, variable=x, value=0,state=DISABLED) > Your problem is that you throw away your IntVar-s after each round in the loop. Instead keep references to them around as in this example, which is a simple rewrite of your example. >>> from Tkinter import * >>> root=Tk() >>> x=[] >>> for i in range(10): x.append(IntVar()) if i < 5: rb = Radiobutton(root, variable=x[-1], value=1, state=DISABLED) else: rb = Radiobutton(root, variable=x[-1], value=0, state=DISABLED) rb.pack() >>> root.mainloop() By the way, are you sure you really want state=DISABLED? That makes the radiobuttons disabled... /MiO From vvinuv at gmail.com Fri Mar 30 19:35:39 2007 From: vvinuv at gmail.com (Vinu Vikram) Date: Fri, 30 Mar 2007 23:05:39 +0530 Subject: [Tkinter-discuss] Make GUI Message-ID: <637563b70703301035n2bfdbb25h2f057a4d2022245d@mail.gmail.com> Dear All I wrote a python script which will take values from a configuration file and perform some operation and give an answer. I would like to make a gui for the script using Tkinter. Could anybody help me to do that? Suppose my script use a variable 'x' to calculate x^2. I would like to give the value x=2 through a GUI and get the output in the same window. Please help me to find the solution. Thanking You Vinu V. -- VINU VIKRAM http://iucaa.ernet.in/~vvinuv/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070330/c593176d/attachment.html From bob at passcal.nmt.edu Fri Mar 30 20:15:29 2007 From: bob at passcal.nmt.edu (Bob Greschke) Date: Fri, 30 Mar 2007 12:15:29 -0600 Subject: [Tkinter-discuss] Make GUI In-Reply-To: <637563b70703301035n2bfdbb25h2f057a4d2022245d@mail.gmail.com> References: <637563b70703301035n2bfdbb25h2f057a4d2022245d@mail.gmail.com> Message-ID: <2D24079C-77EE-4016-AED4-5220E88F8194@passcal.nmt.edu> #! /bin/env python2.3 from Tkinter import * from sys import exit Root = Tk() InputVar = StringVar() OutputVar = StringVar() ###################### # BEGIN: class Command # Pass arguments to functions from button presses and menu selections! Nice! # In your declaration: ...command = Command(func, args,...) # Also use in bind() statements # x.bind("<****>", Command(func, args...)) class Command: def __init__(self, func, *args, **kw): self.func = func self.args = args self.kw = kw def __call__(self, *args, **kw): args = self.args+args kw.update(self.kw) apply(self.func, args, kw) # END: class Command ############################### # BEGIN: XSqCalc(InVar, OutVar) def XSqCalc(InVar, OutVar): Value = InVar.get().strip() if Value == "": OutVar.set("error") return Value = float(Value) Value = Value*Value OutVar.set(str(Value)) return # END: def XSqCalc Label(Root, text = "Enter a value in the field\non the left, click the \n\"X^2\" button and see the\nanswer in the field on the right.").pack(side = TOP) Sub = Frame(Root) Entry(Sub, width = 10, textvariable = InputVar, bg = "white", \ fg = "black").pack(side = LEFT) Label(Sub, text = " ").pack(side = LEFT) Button(Sub, text = "X^2", command = Command(XSqCalc, InputVar, \ OutputVar)).pack(side = LEFT) Label(Sub, text = " ").pack(side = LEFT) Entry(Sub, width = 10, textvariable = OutputVar, bg = "white", \ fg = "black").pack(side = LEFT) Sub.pack(side = TOP, padx = 5, pady = 5) Button(Root, text = "Quit", command = exit).pack(side = TOP) Root.mainloop() That python2.3 line at the beginning may need to be changed for your system. The text of that first Label() should all be on the same line. Bob On Mar 30, 2007, at 11:35, Vinu Vikram wrote: > Dear All > I wrote a python script which will take values from a > configuration file and perform some operation and give an answer. I > would like to make a gui for the script using Tkinter. Could > anybody help me to do that? Suppose my script use a variable 'x' to > calculate x^2. I would like to give the value x=2 through a GUI and > get the output in the same window. Please help me to find the > solution. > Thanking You > Vinu V. > -- > VINU VIKRAM > http://iucaa.ernet.in/~vvinuv/ > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss From vvinuv at gmail.com Fri Mar 30 22:35:59 2007 From: vvinuv at gmail.com (Vinu Vikram) Date: Sat, 31 Mar 2007 02:05:59 +0530 Subject: [Tkinter-discuss] Make GUI In-Reply-To: <2D24079C-77EE-4016-AED4-5220E88F8194@passcal.nmt.edu> References: <637563b70703301035n2bfdbb25h2f057a4d2022245d@mail.gmail.com> <2D24079C-77EE-4016-AED4-5220E88F8194@passcal.nmt.edu> Message-ID: <637563b70703301335j24c01500p9c2cd19cd8b0dda1@mail.gmail.com> Dear Bob Thank you very much for your detailed script. I could do my script using this. Thank you once again Vinu V. On 3/30/07, Bob Greschke wrote: > > #! /bin/env python2.3 > > from Tkinter import * > from sys import exit > > Root = Tk() > > InputVar = StringVar() > OutputVar = StringVar() > > > ###################### > # BEGIN: class Command > # Pass arguments to functions from button presses and menu > selections! Nice! > # In your declaration: ...command = Command(func, args,...) > # Also use in bind() statements > # x.bind("<****>", Command(func, args...)) > class Command: > def __init__(self, func, *args, **kw): > self.func = func > self.args = args > self.kw = kw > def __call__(self, *args, **kw): > args = self.args+args > kw.update(self.kw) > apply(self.func, args, kw) > # END: class Command > > > > > ############################### > # BEGIN: XSqCalc(InVar, OutVar) > def XSqCalc(InVar, OutVar): > Value = InVar.get().strip() > if Value == "": > OutVar.set("error") > return > Value = float(Value) > Value = Value*Value > OutVar.set(str(Value)) > return > # END: def XSqCalc > > > > > Label(Root, text = "Enter a value in the field\non the left, click the > \n\"X^2\" > button and see the\nanswer in the field on the right.").pack(side = TOP) > Sub = Frame(Root) > Entry(Sub, width = 10, textvariable = InputVar, bg = "white", \ > fg = "black").pack(side = LEFT) > Label(Sub, text = " ").pack(side = LEFT) > Button(Sub, text = "X^2", command = Command(XSqCalc, InputVar, \ > OutputVar)).pack(side = LEFT) > Label(Sub, text = " ").pack(side = LEFT) > Entry(Sub, width = 10, textvariable = OutputVar, bg = "white", \ > fg = "black").pack(side = LEFT) > Sub.pack(side = TOP, padx = 5, pady = 5) > Button(Root, text = "Quit", command = exit).pack(side = TOP) > > Root.mainloop() > > > That python2.3 line at the beginning may need to be changed for your > system. > The text of that first Label() should all be on the same line. > > Bob > > On Mar 30, 2007, at 11:35, Vinu Vikram wrote: > > > Dear All > > I wrote a python script which will take values from a > > configuration file and perform some operation and give an answer. I > > would like to make a gui for the script using Tkinter. Could > > anybody help me to do that? Suppose my script use a variable 'x' to > > calculate x^2. I would like to give the value x=2 through a GUI and > > get the output in the same window. Please help me to find the > > solution. > > Thanking You > > Vinu V. > > -- > > VINU VIKRAM > > http://iucaa.ernet.in/~vvinuv/ > > _______________________________________________ > > Tkinter-discuss mailing list > > Tkinter-discuss at python.org > > http://mail.python.org/mailman/listinfo/tkinter-discuss > > -- VINU VIKRAM http://iucaa.ernet.in/~vvinuv/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070331/a75bd96f/attachment.html