From bialix at ukr.net Fri Feb 3 12:55:51 2006 From: bialix at ukr.net (Alexander Belchenko) Date: Fri, 03 Feb 2006 13:55:51 +0200 Subject: [Tkinter-discuss] How to bind to wheel mouse event? Message-ID: Is there exist method to bind callback function to mouse wheel event? Is this event exists at all on win32 Tkinter? In Python Cookbook there is simple example that calims that on Linux wheel mouse events mapped to and , but on Windows this receipe does not work. I use Python 2.4. -- Alexander From jepler at unpythonic.net Sat Feb 4 14:45:48 2006 From: jepler at unpythonic.net (jepler at unpythonic.net) Date: Sat, 4 Feb 2006 07:45:48 -0600 Subject: [Tkinter-discuss] How to bind to wheel mouse event? In-Reply-To: References: Message-ID: <20060204134547.GA2586@unpythonic.net> On Unix, the events are called and . On Windows, there is a single event called , and on its event object there is a 'delta' field which gives the direction. Here's a snippet from the Tk manpage for 'bind': MouseWheel Some mice on the Windows platform support a mouse wheel which is used for scrolling documents without using the scrollbars. By rolling the wheel, the system will generate MouseWheel events that the application can use to scroll. Like Key events the event is always routed to the window that currently has focus. When the event is received you can use the %D substitution to get the delta field for the event which is a integer value of motion that the mouse wheel has moved. The smallest value for which the system will report is defined by the OS. On Windows 95 & 98 machines this value is at least 120 before it is reported. How ever, higher resolution devices may be available in the future. The sign of the value determines which direction your widget should scroll. Positive values should scroll up and negative values should scroll down. Jeff From harlinseritt at yahoo.com Sat Feb 4 20:15:53 2006 From: harlinseritt at yahoo.com (Harlin Seritt) Date: Sat, 4 Feb 2006 11:15:53 -0800 (PST) Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 24, Issue 2 In-Reply-To: Message-ID: <20060204191554.71477.qmail@web52202.mail.yahoo.com> Has anyone *ever* been able to have the mouse wheel work on Win32 with a Tkinter app? For the text widget, the scrollbar works nicely but for some reason, if I attach a scrollbar to a list, it doesn't appear to work. Any reason for this? Thanks, Harlin Seritt www.seritt.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. How to bind to wheel mouse event? (Alexander Belchenko) ---------------------------------------------------------------------- Message: 1 Date: Fri, 03 Feb 2006 13:55:51 +0200 From: Alexander Belchenko Subject: [Tkinter-discuss] How to bind to wheel mouse event? To: tkinter-discuss at python.org Message-ID: Content-Type: text/plain; charset=KOI8-R; format=flowed Is there exist method to bind callback function to mouse wheel event? Is this event exists at all on win32 Tkinter? In Python Cookbook there is simple example that calims that on Linux wheel mouse events mapped to and , but on Windows this receipe does not work. I use Python 2.4. -- Alexander ------------------------------ _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss End of Tkinter-discuss Digest, Vol 24, Issue 2 ********************************************** --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20060204/4c047661/attachment.htm From Avery.Andrews at anu.edu.au Tue Feb 7 10:28:36 2006 From: Avery.Andrews at anu.edu.au (Avery Andrews) Date: Tue, 7 Feb 2006 20:28:36 +1100 Subject: [Tkinter-discuss] Put items on the iconized menu? Message-ID: <6F1ACEF0DED903428D0EC96EFEB1DF8832A711@foa.artsfleet.anu.edu.au> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20060207/16edd4d2/attachment.htm From jepler at unpythonic.net Tue Feb 7 15:54:51 2006 From: jepler at unpythonic.net (jepler at unpythonic.net) Date: Tue, 7 Feb 2006 08:54:51 -0600 Subject: [Tkinter-discuss] Put items on the iconized menu? In-Reply-To: <6F1ACEF0DED903428D0EC96EFEB1DF8832A711@foa.artsfleet.anu.edu.au> References: <6F1ACEF0DED903428D0EC96EFEB1DF8832A711@foa.artsfleet.anu.edu.au> Message-ID: <20060207145450.GA27984@unpythonic.net> Read the section "SPECIAL MENUS IN MENUBARS" from the tk "menu" manpage: On Windows, access to the Windows System menu in each window is provided. [...] So for a menubar named .menubar, on the Macintosh, the special menus would be .menubar.apple and .menubar.help; on Windows, the special menu would be .menubar.system [...] A bit of experimentation shows that this does work (the item appears both when you click the icon in the upper left and when you right-click the task bar entry for the application), but that you'll also want to specifically turn off the "tearoff" property of the "system" menubar. I tested this in 'wish', not Tkinter. Creating a widget with a particular name seems to be done in Tkinter by using the name= parameter when constructing the widget: menubar = Tkinter.Menu(root); root.configure(menu=menubar) system_menu = Tkinter.Menu(menubar, name="system", tearoff=0, ...) menubar.add_cascade(menu=system_menu, ...) (untested) Jeff From Martin.Weisel at gmx.de Sat Feb 11 01:48:20 2006 From: Martin.Weisel at gmx.de (Martin Weisel) Date: Sat, 11 Feb 2006 01:48:20 +0100 Subject: [Tkinter-discuss] Radiobutton Message-ID: Hi everybody. I'm currently trying to create a popup-GUI for PyMOL with Tkinter. It's supposed to be of the form: ############################################################################ ############ from Tkinter import * root = Tk() def radio1(): global tmp tmp = IntVar() Yes = Radiobutton(root, text = 'yes', value = 1 , variable = tmp) Yes.pack(side = LEFT) Yes.select() #set Yes initially No = Radiobutton(root, text = 'no', value = 2 , variable = tmp).pack(side = LEFT) radio1() root.mainloop() ############################################################################ ############ My problem is, that I cannot read out the actual value of tmp with tmp.get() --> it is always returning 0. Although displaying the actual value of tmp as a dynamic label on the GUI works very well: Label(root, textvariable = tmp).pack(side = LEFT) Any help would be appreciated. Regards, Martin -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 10.02.2006 From dblank at brynmawr.edu Sat Feb 11 02:04:04 2006 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri, 10 Feb 2006 20:04:04 -0500 Subject: [Tkinter-discuss] Radiobutton In-Reply-To: References: Message-ID: <1139619844.19480.96.camel@mightymouse.brynmawr.edu> Martin, Your example works for me. I'm on Linux, Python 2.4.1, FC4. I don't usually use globals; maybe you have another global somewhere colliding with the one that you are using? -Doug On Sat, 2006-02-11 at 01:48 +0100, Martin Weisel wrote: > from Tkinter import * > root = Tk() > > def radio1(): > global tmp > tmp = IntVar() > Yes = Radiobutton(root, text = 'yes', value = 1 , variable = > tmp) > Yes.pack(side = LEFT) > Yes.select() #set Yes initially > No = Radiobutton(root, text = 'no', value = 2 , variable = > tmp).pack(side = > LEFT) > > radio1() > root.mainloop() -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank From Avery.Andrews at anu.edu.au Sat Feb 11 04:17:22 2006 From: Avery.Andrews at anu.edu.au (Avery Andrews) Date: Sat, 11 Feb 2006 14:17:22 +1100 Subject: [Tkinter-discuss] balloons and float-on-top windows Message-ID: <6F1ACEF0DED903428D0EC96EFEB1DF8832A71F@foa.artsfleet.anu.edu.au> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20060211/365730ac/attachment.html From sw at wordtech-software.com Sat Feb 11 10:12:31 2006 From: sw at wordtech-software.com (Kevin Walzer) Date: Sat, 11 Feb 2006 04:12:31 -0500 Subject: [Tkinter-discuss] Missing wrappers for tile and tablelist Message-ID: <43EDAA7F.6030901@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I believe Martin Franklin wrote a Tile.py wrapper for the Tk/Tile extension, which adds theming to the core Tk widget set. It used to reside here: http://mfranklin.is-a-geek.org/docs/Tile/index.html That server seems to be down. Anyone know if the wrapper is available elsewhere? Or if someone else has written a Tile wrapper? There was also a wrapper for the tablelist Tk package at this site as well... - -- Kevin Walzer iReveal: File Search Tool http://www.wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD7ap+JmdQs+6YVcoRAh/yAJ4t5dIYqSyse6xjHjm2BpYZME6fzwCeLbSh tVLK85mkjQXdoPXO0u6NrpQ= =gxv3 -----END PGP SIGNATURE----- From sw at wordtech-software.com Sat Feb 11 15:40:47 2006 From: sw at wordtech-software.com (Kevin Walzer) Date: Sat, 11 Feb 2006 09:40:47 -0500 Subject: [Tkinter-discuss] Missing wrappers for tile and tablelist In-Reply-To: <43EDAA7F.6030901@wordtech-software.com> References: <43EDAA7F.6030901@wordtech-software.com> Message-ID: <43EDF76F.4030807@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kevin Walzer wrote: > I believe Martin Franklin wrote a Tile.py wrapper for the Tk/Tile > extension, which adds theming to the core Tk widget set. It used to > reside here: > > http://mfranklin.is-a-geek.org/docs/Tile/index.html > > That server seems to be down. Anyone know if the wrapper is available > elsewhere? Or if someone else has written a Tile wrapper? > > There was also a wrapper for the tablelist Tk package at this site as > well... > I've heard from Mr. Franklin, who says his site should be coming back online shortly. _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD7fduJmdQs+6YVcoRAuJUAJ9SbhyYdnsHtWInHKinM1D8g/rhygCfUQ+n 6cTKfdcgjEeAXjR2Qan/u54= =KqEs -----END PGP SIGNATURE----- From Martin.Weisel at gmx.de Mon Feb 13 10:43:43 2006 From: Martin.Weisel at gmx.de (Martin Weisel) Date: Mon, 13 Feb 2006 10:43:43 +0100 (MET) Subject: [Tkinter-discuss] Radiobutton Message-ID: <26290.1139823823@www053.gmx.net> Hi Doug, >Your example works for me. I'm on Linux, Python 2.4.1, FC4 This example works fine for python, but unfortunately it's not working in PyMOL. >I don't usually use globals; maybe you have another global somewhere >colliding with the one that you are using? There is definitely no colliding of variables - this prog does not work when used as the only code. >from Tkinter import * >root = Tk() > >def radio1(): > global tmp > tmp = IntVar() > Yes = Radiobutton(root, text = 'yes', value = 1 , variable = tmp) > Yes.pack(side = LEFT) > Yes.select() #set Yes initially > No = Radiobutton(root, text = 'no', value = 2 , variable = >tmp).pack(side = >LEFT) >radio1() >root.mainloop() I think it must be a PyMOL specific problem. For some reason the .get() method is unable to get the actual value of the Radiobutton. The strange thing is that the Label has no problems in displaying the actual value of tmp. I'm wondering if there's a way to read out 'textvariable' of the Label!? >Label(root, textvariable = tmp).pack(side = LEFT) Regards, Martin -- Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko! Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner From klappnase at web.de Mon Feb 13 12:43:00 2006 From: klappnase at web.de (Michael Lange) Date: Mon, 13 Feb 2006 12:43:00 +0100 Subject: [Tkinter-discuss] Radiobutton In-Reply-To: <26290.1139823823@www053.gmx.net> References: <26290.1139823823@www053.gmx.net> Message-ID: <20060213124300.6854ba0f.klappnase@web.de> On Mon, 13 Feb 2006 10:43:43 +0100 (MET) "Martin Weisel" wrote: > > I think it must be a PyMOL specific problem. For some reason the .get() > method is unable to get the actual value of the Radiobutton. The strange > thing is that the Label has no problems in displaying the actual value of > tmp. I'm wondering if there's a way to read out 'textvariable' of the > Label!? Maybe Label.cget('text') ? Michael From chris at niekel.net Tue Feb 14 13:06:07 2006 From: chris at niekel.net (Chris Niekel) Date: Tue, 14 Feb 2006 13:06:07 +0100 Subject: [Tkinter-discuss] My (small) program crashes on windows and linux. Why? Message-ID: <20060214120606.GP20447@kira.niekel.net> Hi, I was playing with tkinter, at the same time enjoying the olympics. I thought I'd try to create a program for keeping scores of the speed-skating. However, under windows I got into a crash, with the helpful "Send crash-report". I tried to change this into a smaller program that still crashes, but whatever I change, it stops crashing. Under linux it also coredumps, but then when you close the window. Since it's python, and crashes shouldn't happen, I thought I'd attach the whole program (it's 82 lines). The strange thing is, if the 'SkateWindow' is started with a distance < 10000, it runs allright. With 10km, the window is wider than my screen, but changing line 29 self.distances = range(start,distance+1, 400) into self.distances = range(start,distance+1, 800) reduces the number of columns, but not the crash. Any ideas? Regards, Chris Niekel -- I've been down so long, if I'd cheer up, I'd still be depressed. - Lisa Simpson, Moanin' Lisa Blues. -------------- next part -------------- A non-text attachment was scrubbed... Name: skate.py Type: text/x-python Size: 2321 bytes Desc: not available Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20060214/2743df1e/attachment.py From amanjit.gill at gmx.de Tue Feb 14 13:58:19 2006 From: amanjit.gill at gmx.de (Amanjit Gill) Date: Tue, 14 Feb 2006 13:58:19 +0100 Subject: [Tkinter-discuss] My (small) program crashes on windows and linux. Why? In-Reply-To: <20060214120606.GP20447@kira.niekel.net> References: <20060214120606.GP20447@kira.niekel.net> Message-ID: <43F1D3EB.9000003@gmx.de> Chris Niekel wrote: > for d in self.distances: > e = Tkinter.Entry(frame,width='8') > e.grid(row=rowcount, column=d) > > > I think the values for the column param are too high. Tkinter cannot handle them. You do this twice in your code. they are supposed to work as "weights". if you just use an numeric according to the index of the current entry in self.distances it works... cheers bye From chris at niekel.net Tue Feb 14 15:07:07 2006 From: chris at niekel.net (Chris Niekel) Date: Tue, 14 Feb 2006 15:07:07 +0100 Subject: [Tkinter-discuss] My (small) program crashes on windows and linux. Why? In-Reply-To: <43F1D3EB.9000003@gmx.de> References: <20060214120606.GP20447@kira.niekel.net> <43F1D3EB.9000003@gmx.de> Message-ID: <20060214140707.GQ20447@kira.niekel.net> On Tue, Feb 14, 2006 at 01:58:19PM +0100, Amanjit Gill wrote: > Chris Niekel wrote: > > > for d in self.distances: > > e = Tkinter.Entry(frame,width='8') > > e.grid(row=rowcount, column=d) > > > > > > > I think the values for the column param are too high. Tkinter cannot > handle them. You do this twice in your code. they are supposed to work > as "weights". if you just use an numeric according to the index of the > current entry in self.distances it works... Indeed, changing it to column=d/100 works as well. column and row should be < 9999, otherwise it crashes. Not a real problem ofcourse. I knew the numbers are weights, that's why I didn't bother to scale them and just used the numbers I already have available. Regards, Chris -- I've been down so long, if I'd cheer up, I'd still be depressed. - Lisa Simpson, Moanin' Lisa Blues. From amanjit.gill at gmx.de Tue Feb 14 22:44:22 2006 From: amanjit.gill at gmx.de (Amanjit Gill) Date: Tue, 14 Feb 2006 22:44:22 +0100 Subject: [Tkinter-discuss] My (small) program crashes on windows and linux. Why? In-Reply-To: <20060214140707.GQ20447@kira.niekel.net> References: <20060214120606.GP20447@kira.niekel.net> <43F1D3EB.9000003@gmx.de> <20060214140707.GQ20447@kira.niekel.net> Message-ID: <43F24F36.3080102@gmx.de> Chris Niekel wrote: > Indeed, changing it to column=d/100 works as well. column and row should > >be < 9999, otherwise it crashes. Not a real problem ofcourse. > >I knew the numbers are weights, that's why I didn't bother to scale them >and just used the numbers I already have available. > > Hi there, I took a look at the Tk sourcecode, its limited by default .. see http://cvs.sourceforge.net/viewcvs.py/tktoolkit/tk/generic/tkGrid.c?view=markup //* * Data structures are allocated dynamically to support arbitrary sized * tables. However, the space is proportional to the highest numbered slot * with some non-default property. This limit is used to head off mistakes and * denial of service attacks by limiting the amount of storage required. *// #*define* MAX_ELEMENT 10000 and .\tkGrid.c:2216: if (slot < 0 || slot >= MAX_ELEMENT) { return TCL_ERROR; } Cheers, Amanjit From chris at niekel.net Wed Feb 15 07:29:05 2006 From: chris at niekel.net (Chris Niekel) Date: Wed, 15 Feb 2006 07:29:05 +0100 Subject: [Tkinter-discuss] My (small) program crashes on windows and linux. Why? In-Reply-To: <43F24F36.3080102@gmx.de> References: <20060214120606.GP20447@kira.niekel.net> <43F1D3EB.9000003@gmx.de> <20060214140707.GQ20447@kira.niekel.net> <43F24F36.3080102@gmx.de> Message-ID: <20060215062903.GR20447@kira.niekel.net> On Tue, Feb 14, 2006 at 10:44:22PM +0100, Amanjit Gill wrote: > Chris Niekel wrote: > >Indeed, changing it to column=d/100 works as well. column and row should > > > >be < 9999, otherwise it crashes. Not a real problem ofcourse. > Hi there, I took a look at the Tk sourcecode, its limited by default .. see > > http://cvs.sourceforge.net/viewcvs.py/tktoolkit/tk/generic/tkGrid.c?view=markup > > //* * Data structures are allocated dynamically to support arbitrary > sized * tables. However, the space is proportional to the highest > numbered slot * with some non-default property. This limit is used to > head off mistakes and * denial of service attacks by limiting the amount > of storage required. *// > #*define* MAX_ELEMENT 10000 > > and > > .\tkGrid.c:2216: > if (slot < 0 || slot >= MAX_ELEMENT) { > return TCL_ERROR; > } Should I have discovered the TCL_ERROR somewhere then? Is that propagated through Tkinter? The grid-examples don't use it. Since Tcl/tk seems to set the limit, and return an error, I'd think it's a bug in Tkinter to crash for it. An exception raised at the right time would be nice. I I've submitted a bug-report for the crash (and fixed my code). > Cheers, > Amanjit Thanks for your help! Chris Niekel -- I've been down so long, if I'd cheer up, I'd still be depressed. - Lisa Simpson, Moanin' Lisa Blues. From jepler at unpythonic.net Wed Feb 15 14:25:37 2006 From: jepler at unpythonic.net (jepler at unpythonic.net) Date: Wed, 15 Feb 2006 07:25:37 -0600 Subject: [Tkinter-discuss] My (small) program crashes on windows and linux. Why? In-Reply-To: <20060215062903.GR20447@kira.niekel.net> References: <20060214120606.GP20447@kira.niekel.net> <43F1D3EB.9000003@gmx.de> <20060214140707.GQ20447@kira.niekel.net> <43F24F36.3080102@gmx.de> <20060215062903.GR20447@kira.niekel.net> Message-ID: <20060215132536.GA8664@unpythonic.net> If you file a bug anywhere, you should file it against the Tk library, not Python. This crash is reproduced by the following Tcl script: label .l grid .l -row 10 -column 10000 update after 1000 destroy . As far as I know, the proper place to report bugs in Tk is the "Bugs" tab of http://sourceforge.net/projects/tktoolkit Jeff From Cameron at Phaseit.net Wed Feb 15 16:31:10 2006 From: Cameron at Phaseit.net (Cameron Laird) Date: Wed, 15 Feb 2006 15:31:10 +0000 Subject: [Tkinter-discuss] My (small) program crashes on windows and linux. Why? In-Reply-To: <20060215132536.GA8664@unpythonic.net> References: <20060214120606.GP20447@kira.niekel.net> <43F1D3EB.9000003@gmx.de> <20060214140707.GQ20447@kira.niekel.net> <43F24F36.3080102@gmx.de> <20060215062903.GR20447@kira.niekel.net> <20060215132536.GA8664@unpythonic.net> Message-ID: <20060215153110.GA24693@lairds.us> On Wed, Feb 15, 2006 at 07:25:37AM -0600, jepler at unpythonic.net wrote: . . . > If you file a bug anywhere, you should file it against the Tk library, > not Python. This crash is reproduced by the following Tcl script: > label .l > grid .l -row 10 -column 10000 > update > after 1000 destroy . > > As far as I know, the proper place to report bugs in Tk is the "Bugs" > tab of http://sourceforge.net/projects/tktoolkit . . . Yes! Nice work. My Mac OS X 8.4.10 dies after the [update], without needing the [after 1000 destroy .]. Yes, is a good place to report the issue. The Tk folks promise it'll get prompt attention. For now, I leave it to you to file. Feel free to send me a copy when you do so. From y-e-d at seznam.cz Wed Feb 15 16:33:41 2006 From: y-e-d at seznam.cz (Jakub Sporek) Date: Wed, 15 Feb 2006 16:33:41 +0100 Subject: [Tkinter-discuss] Look of the Tk apps in Debian Linux Message-ID: <20060215153341.GA19289@randal> Hi, I'm on Debian Linux and I'd like to know where can I centrally change the font and maybe the whole look if it's possible of Tk applications. I run some applications that uses Tk (IDLE - The Python IDE for example) and they all looks the same, so I think that this should change centrally somewhere. Please give me some advices. Thanks in advance, Jakub Sporek ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Server. http://www.nod32.com From Cameron at Phaseit.net Thu Feb 16 02:08:07 2006 From: Cameron at Phaseit.net (Cameron Laird) Date: Thu, 16 Feb 2006 01:08:07 +0000 Subject: [Tkinter-discuss] Look of the Tk apps in Debian Linux In-Reply-To: <20060215153341.GA19289@randal> References: <20060215153341.GA19289@randal> Message-ID: <20060216010807.GA969@lairds.us> On Wed, Feb 15, 2006 at 04:33:41PM +0100, Jakub Sporek wrote: . . . > I'm on Debian Linux and I'd like to know where can I > centrally change the font and maybe the whole look if it's > possible of Tk applications. I run some applications that > uses Tk (IDLE - The Python IDE for example) and they all > looks the same, so I think that this should change centrally > somewhere. . . . There are a couple of aspects to this: A. Who can report on when Tkinter as a whole or IDLE in particular will be Tile-ified? B. You want to learn about "the option database" . For even more immediate encouragement, try import Tkinter root = Tkinter.Tk() root.option_add('*font', ('verdana', 30, 'bold')) Tkinter.Label(text = "This is some text.").pack() C. B. presents a per-application approach. As Tkinter is a well-behaved X11 toolkit, you can also read up on the X11 option database (start with `man xrdb`). Jeff and Fredrik are likely to expand these remarks. The subject deserves its own Wiki page ... From jepler at unpythonic.net Thu Feb 16 02:25:38 2006 From: jepler at unpythonic.net (jepler at unpythonic.net) Date: Wed, 15 Feb 2006 19:25:38 -0600 Subject: [Tkinter-discuss] Look of the Tk apps in Debian Linux In-Reply-To: <20060215153341.GA19289@randal> References: <20060215153341.GA19289@randal> Message-ID: <20060216012538.GC15198@unpythonic.net> You can use the X resource database to control the default appearance of Tk widgets. For example, try the following shell script before running a Tk or Tkinter app: for class in Label Entry Listbox Button Checkbutton Radiobutton Menu do echo "*$class.font: helvetica 12" done | xrdb -merge It will choose a nicer (non-bold) font for most widgets. These settings will persist until logout, or until modified by a subsequent 'xrdb' invocation. You can get the rest of what I know from reading the 'option' manpage, which is a Tk command that adds resources to the list for just one instance of Tk. I believe the resource syntax is able to specify application names, widget paths, and widget classes, though I don't know all the particulars. I generally use the *Class.databaseName format, and nothing else. Jeff From sw at wordtech-software.com Thu Feb 16 03:15:57 2006 From: sw at wordtech-software.com (Kevin Walzer) Date: Wed, 15 Feb 2006 21:15:57 -0500 Subject: [Tkinter-discuss] Look of the Tk apps in Debian Linux In-Reply-To: <20060216010807.GA969@lairds.us> References: <20060215153341.GA19289@randal> <20060216010807.GA969@lairds.us> Message-ID: <43F3E05D.8020003@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Cameron Laird wrote: > On Wed, Feb 15, 2006 at 04:33:41PM +0100, Jakub Sporek wrote: > . > . > . >> I'm on Debian Linux and I'd like to know where can I >> centrally change the font and maybe the whole look if it's >> possible of Tk applications. I run some applications that >> uses Tk (IDLE - The Python IDE for example) and they all >> looks the same, so I think that this should change centrally >> somewhere. > . > . > . > There are a couple of aspects to this: > A. Who can report on when Tkinter as a whole or IDLE > in particular will be Tile-ified? > B. You want to learn about "the option database" http://effbot.org/zone/tkinter-option-database.htm >. > For even more immediate encouragement, try > import Tkinter > root = Tkinter.Tk() > root.option_add('*font', ('verdana', 30, 'bold')) > Tkinter.Label(text = "This is some text.").pack() > C. B. presents a per-application approach. As Tkinter > is a well-behaved X11 toolkit, you can also read up > on the X11 option database (start with `man xrdb`). > > Jeff and Fredrik are likely to expand these remarks. The subject > deserves its own Wiki page ... > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > There's a Tkinter/Tile wrapper here: http://mfranklin.is-a-geek.org/docs/Tile/index.html I'm undertaking development of a Python application that will make use of this module, and will contribute documentation on using Tkinter/Tile (Tileinter?) at the appropriate time. I can't sepak for IDLE. Kevin - -- Kevin Walzer iReveal: File Search Tool http://www.wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD8+BcJmdQs+6YVcoRAjh2AJ0aHumLj4qHx9G0iRG40PLfJWMBvgCfdSJ2 wPLwUp9ITbm8f87ifUF5cSc= =OSzu -----END PGP SIGNATURE----- From chris at niekel.net Thu Feb 16 07:51:37 2006 From: chris at niekel.net (Chris Niekel) Date: Thu, 16 Feb 2006 07:51:37 +0100 Subject: [Tkinter-discuss] My (small) program crashes on windows and linux. Why? In-Reply-To: <20060215153110.GA24693@lairds.us> References: <20060214120606.GP20447@kira.niekel.net> <43F1D3EB.9000003@gmx.de> <20060214140707.GQ20447@kira.niekel.net> <43F24F36.3080102@gmx.de> <20060215062903.GR20447@kira.niekel.net> <20060215132536.GA8664@unpythonic.net> <20060215153110.GA24693@lairds.us> Message-ID: <20060216065136.GT20447@kira.niekel.net> On Wed, Feb 15, 2006 at 03:31:10PM +0000, Cameron Laird wrote: > On Wed, Feb 15, 2006 at 07:25:37AM -0600, jepler at unpythonic.net wrote: > > If you file a bug anywhere, you should file it against the Tk library, > > not Python. Too late. I've appended a note saying it's in tk. Didn't know if I was supposed to close it myself. > Nice work. My Mac OS X 8.4.10 dies after the [update], without needing > the [after 1000 destroy .]. My linux crashes before the update. > Yes, is a good place > to report the issue. The Tk folks promise it'll get prompt attention. > For now, I leave it to you to file. Feel free to send me a copy when > you do so. I've submitted it there as well, requestID 1432666, http://sourceforge.net/tracker/index.php?func=detail&aid=1432666&group_id=12997&atid=112997 Regards, Chris Niekel -- I've been down so long, if I'd cheer up, I'd still be depressed. - Lisa Simpson, Moanin' Lisa Blues. From y-e-d at seznam.cz Thu Feb 16 21:46:29 2006 From: y-e-d at seznam.cz (Jakub Sporek) Date: Thu, 16 Feb 2006 21:46:29 +0100 Subject: [Tkinter-discuss] Look of the Tk apps in Debian Linux In-Reply-To: <20060216012538.GC15198@unpythonic.net> References: <20060215153341.GA19289@randal> <20060216012538.GC15198@unpythonic.net> Message-ID: <20060216204629.GC19289@randal> Ok, thanks a lot... that script works fine. Is there a possibility to change the background color of the menus etc. the same way as the font-change? On 16.02.2006 (02:25), jepler at unpythonic.net wrote: > You can use the X resource database to control the default appearance of > Tk widgets. > > For example, try the following shell script before running a Tk or > Tkinter app: > for class in Label Entry Listbox Button Checkbutton Radiobutton Menu > do > echo "*$class.font: helvetica 12" > done | xrdb -merge > It will choose a nicer (non-bold) font for most widgets. These settings > will persist until logout, or until modified by a subsequent 'xrdb' > invocation. > > You can get the rest of what I know from reading the 'option' manpage, > which is a Tk command that adds resources to the list for just one > instance of Tk. I believe the resource syntax is able to specify > application names, widget paths, and widget classes, though I don't know > all the particulars. I generally use the *Class.databaseName format, > and nothing else. > > Jeff ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Server. http://www.nod32.com From Cameron at Phaseit.net Fri Feb 17 15:33:25 2006 From: Cameron at Phaseit.net (Cameron Laird) Date: Fri, 17 Feb 2006 14:33:25 +0000 Subject: [Tkinter-discuss] Look of the Tk apps in Debian Linux In-Reply-To: <20060216204629.GC19289@randal> References: <20060215153341.GA19289@randal> <20060216012538.GC15198@unpythonic.net> <20060216204629.GC19289@randal> Message-ID: <20060217143325.GA18602@lairds.us> On Thu, Feb 16, 2006 at 09:46:29PM +0100, Jakub Sporek wrote: . . . > Ok, thanks a lot... > that script works fine. Is there a possibility to change the > background color of the menus etc. the same way as the > font-change? . . . Does demonstr% python Python 2.3.5 (#1, Mar 20 2005, 20:38:20) [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Tkinter >>> m = Tkinter.Menu() >>> m.configure() {'bd': ('bd', '-borderwidth'), 'disabledforeground': ('disabledforeground', 'disabledForeground', 'DisabledForeground', , ), 'postcommand': ('postcommand', 'postCommand', 'Command', '', ''), 'bg': ('bg', '-background'), 'type': ('type', 'type', 'Type', , ), 'foreground': ('foreground', 'foreground', 'Foreground', , ), 'title': ('title', 'title', 'Title', '', ''), 'relief': ('relief', 'relief', 'Relief', , ), 'selectcolor': ('selectcolor', 'selectColor', 'Background', , ), 'cursor': ('cursor', 'cursor', 'Cursor', , ), 'takefocus': ('takefocus', 'takeFocus', 'TakeFocus', '0', '0'), 'activeborderwidth': ('activeborderwidth', 'activeBorderWidth', 'BorderWidth', , ), 'background': ('background', 'background', 'Background', , ), ... address your question meaningfully? I elaborate: just as "font" is a configuration variable for a Label, so is "background" for "menu", as Python is willing to inform you during an interactive session, if you know how to ask it. Does that make sense? From cwildsmith at argontechnology.com.au Wed Feb 22 04:12:07 2006 From: cwildsmith at argontechnology.com.au (Colin Wildsmith) Date: Wed, 22 Feb 2006 11:12:07 +0800 Subject: [Tkinter-discuss] Axis modification Message-ID: <66D610DE0C5EB640928D746F05F4BB1002633A@argon-server.argon.local> Hello all, I am trying to modify the Axis gui for EMC2 and am having trouble calling commands from within the 'axis.py' file. I have modified the history widget to a small text editor and have created some extra button widgets which I want to use to access the text editor. Here is a snippet of my code which is in 'axis.py', where I think the root of my problem lies, hopefully this snippet will outline the issue that im having beyond my explanation: class TclCommands(nf.TclCommands): .... def edit_file(event=None): root_window.command = pane_top + ".tabs raise mdi" def new_file(event=None): widgets.mdi_history.delete(1.0, END) root_window.command = pane_top + ".tabs raise mdi" I have a 2 button widgets defined in 'axis.tcl' which have command options calling the above functions, I also have short cut keys which call these functions: root_window.bind("", commands.edit_file) root_window.bind("", commands.new_file) When I press the button or use the shortcut key, the mdi tab does not raise and I do not get any error message in the terminal. Only text saying: emcTaskIssueCommand() I know I can use the command options to raise the tab directly and also use 'bind' to link the shortcut key to (pane_top + ".tabs raise mdi"), however this limits me to one command and as you can see in the new_file function that I would like to use two commands. Regards Colin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20060222/fd1bf719/attachment.htm From o0family.guy0o at gmail.com Wed Feb 22 04:24:38 2006 From: o0family.guy0o at gmail.com (this_is Not_my_name) Date: Tue, 21 Feb 2006 19:24:38 -0800 Subject: [Tkinter-discuss] Fixed color background Message-ID: How do I set the background color of a frame to black? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20060221/6d24ee72/attachment.html From Cameron at Phaseit.net Wed Feb 22 15:52:30 2006 From: Cameron at Phaseit.net (Cameron Laird) Date: Wed, 22 Feb 2006 14:52:30 +0000 Subject: [Tkinter-discuss] Fixed color background In-Reply-To: References: Message-ID: <20060222145230.GA21501@lairds.us> On Tue, Feb 21, 2006 at 07:24:38PM -0800, this_is Not_my_name wrote: . . . > How do I set the background color of a frame to black? . . . >>> import Tkinter >>> f = Tkinter.Frame(width = 50, height = 50, background = "black") >>> f.pack() is an example. From Cameron at Phaseit.net Wed Feb 22 22:26:40 2006 From: Cameron at Phaseit.net (Cameron Laird) Date: Wed, 22 Feb 2006 21:26:40 +0000 Subject: [Tkinter-discuss] Fixed color background In-Reply-To: References: <20060222145230.GA21501@lairds.us> <20060222205055.GA29068@lairds.us> Message-ID: <20060222212640.GA7400@lairds.us> On Wed, Feb 22, 2006 at 01:15:43PM -0800, this_is Not_my_name wrote: . . . > When I follow the suggestion, I get a type error... > > TypeError: __init__() got an unexpected keyword argument 'background' > > I haven't had this problem before, all of the programs I make that include a > GUI, i've used this method. Usually with a little perserverance I can get it > working. But this one has me stuck. Anybody else have any suggestions? > > On 2/22/06, Cameron Laird wrote: > > > > On Wed, Feb 22, 2006 at 12:37:25PM -0800, this_is Not_my_name wrote: > > . > > . > > . > > > from Tkinter import * > > > import tkMessageBox, smtplib, string, webbrowser > > > class Application(Frame): > > > def __init__(self, master): > > > Frame.__init__(self, master) > > > self.grid() > > > self.create_widgets() > > > > > > Above is the start of my program, I use a class to keep it clean and > > easier > > > for me to work with. Any way, I don't see anywhere where I can apply > > your > > > answer. > > > > > > On 2/22/06, Cameron Laird wrote: > > > > > > > > On Tue, Feb 21, 2006 at 07:24:38PM -0800, this_is Not_my_name wrote: > > > > . > > > > . > > > > . > > > > > How do I set the background color of a frame to black? > > > > . > > > > . > > > > . > > > > >>> import Tkinter > > > > >>> f = Tkinter.Frame(width = 50, height = 50, background = "black") > > > > >>> f.pack() > > > > > > > > is an example. > > > > > > > > It's hard for me, too, to apply my answer to the different question > > you haven't yet made explicit. Do you want to change the background > > color of all instances of Application to black? Only one? Pick a > > fight about whether your definition succeeds in "keep[ing] it clean > > and easier ..."? In any case, I invite you to replace > > Frame.__init__(self, master) > > with > > Frame.__init__(self, master, background = "black") > > to determine whether that brings you any closer to where you want to > > be. > > > > There's also a completely different approach to this sort of configu- > > ration through the "option database". I have no idea whether I should > > recommend you pursue that direction. > > > > I urge you to carry on this conversation in the mailing list; to do so > > gives others a chance to help. > > The messages arriving at me appear NOT to be passing through the mailing list. I've redirected follow-ups back there, on the as- sumption that's your intention. I don't know what more to say; when I run applications with Frame.__init__(self, master, background = "black") I see a black background, not a TypeError. Perhaps someone else recognizes what's going on. From klappnase at web.de Thu Feb 23 10:56:38 2006 From: klappnase at web.de (Michael Lange) Date: Thu, 23 Feb 2006 10:56:38 +0100 Subject: [Tkinter-discuss] Fixed color background In-Reply-To: <20060222212640.GA7400@lairds.us> References: <20060222145230.GA21501@lairds.us> <20060222205055.GA29068@lairds.us> <20060222212640.GA7400@lairds.us> Message-ID: <20060223105638.11c70282.klappnase@web.de> > On Wed, Feb 22, 2006 at 01:15:43PM -0800, this_is Not_my_name wrote: > . > . > . > > When I follow the suggestion, I get a type error... > > > > TypeError: __init__() got an unexpected keyword argument 'background' > > > > I haven't had this problem before, all of the programs I make that include a > > GUI, i've used this method. Usually with a little perserverance I can get it > > working. But this one has me stuck. Anybody else have any suggestions? > > > > On 2/22/06, Cameron Laird wrote: > > > > > > On Wed, Feb 22, 2006 at 12:37:25PM -0800, this_is Not_my_name wrote: > > > . > > > . > > > . > > > > from Tkinter import * > > > > import tkMessageBox, smtplib, string, webbrowser > > > > class Application(Frame): > > > > def __init__(self, master): > > > > Frame.__init__(self, master) > > > > self.grid() > > > > self.create_widgets() > > > > Just a guess: maybe somewhere in your code you did something like: app = Application(master, background='black') ? To avoid problems like this I usually set up the constructor of widget subclasses to pass any keyword to the parent class, like: class Application(Frame): def __init__(self, master, **kw): Frame.__init__(self, master, **kw) If this is not the problem, please show more of the code and a complete traceback. I hope this helps Michael