From Parimala.Ramdas at Zoran.com Thu Jul 8 19:15:19 2004 From: Parimala.Ramdas at Zoran.com (Parimala Ramdas) Date: Fri Jul 9 18:55:37 2004 Subject: [Tkinter-discuss] Problem trying to use Tkinter in non-gui script Message-ID: Hello all! I have a piece of gui code using Tkinter that I put in a file viewcvs.py of ViewCVS software. What I'm trying to do is, display a dialog box when user clicks on a link "Download" The purpose is to ask for a username before allowing user to download files. As soon as username is entered in dialog box, it will verify the name. The code works stand-alone but gives me error in viewcvs.py file. Anyone has any idea why? Thanks in advance. Parimala Code: sys.path.append('/usr/lib/python1.5/lib-tk/') import Tkinter root = Tkinter.Tk() Tkinter.Label(text="Welcome") root.mainloop() Python Exception Occured Traceback (innermost last): File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2741, in run_cgi main() File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2722, in main download_tarball(request) File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2624, in download_tarball root = Tkinter.Tk() File "/usr/lib/python1.5/site-packages/lib-tk/Tkinter.py", line 886, in __init__ self.tk = _tkinter.create(screenName, baseName, className) TclError: no display name and no $DISPLAY environment variable Even if I copy lib-tk in site-packages dir, it gives me the same error. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20040708/9be97d5f/attachment.htm From jepler at unpythonic.net Fri Jul 9 19:15:35 2004 From: jepler at unpythonic.net (Jeff Epler) Date: Fri Jul 9 19:15:39 2004 Subject: [Tkinter-discuss] Problem trying to use Tkinter in non-gui script In-Reply-To: References: Message-ID: <20040709171535.GC13394@unpythonic.net> Tkinter works on the local machine (windows, macintosh) or using the X11 networking protocol. You can't run Tkinter code on the server side of a web application. Jeff -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20040709/220d7744/attachment.pgp From Parimala.Ramdas at Zoran.com Fri Jul 9 19:38:09 2004 From: Parimala.Ramdas at Zoran.com (Parimala Ramdas) Date: Fri Jul 9 19:38:13 2004 Subject: [Tkinter-discuss] Problem trying to use Tkinter in non-gui script Message-ID: Thank you! I'll try javascript instead....... Parimala -----Original Message----- From: Jeff Epler [mailto:jepler@unpythonic.net] Sent: Friday, July 09, 2004 1:16 PM To: Parimala Ramdas Cc: tkinter-discuss@python.org Subject: Re: [Tkinter-discuss] Problem trying to use Tkinter in non-gui script Tkinter works on the local machine (windows, macintosh) or using the X11 networking protocol. You can't run Tkinter code on the server side of a web application. Jeff From Cameron at Phaseit.net Fri Jul 9 22:10:51 2004 From: Cameron at Phaseit.net (Cameron Laird) Date: Fri Jul 9 22:11:19 2004 Subject: [Tkinter-discuss] Problem trying to use Tkinter in non-gui script In-Reply-To: <20040709171535.GC13394@unpythonic.net> References: <20040709171535.GC13394@unpythonic.net> Message-ID: <20040709201051.GA5297@lairds.us> On Fri, Jul 09, 2004 at 12:15:35PM -0500, Jeff Epler wrote: . . . > Tkinter works on the local machine (windows, macintosh) or using the > X11 networking protocol. You can't run Tkinter code on the server side > of a web application. . . . Right; I believe Mr. Ramdas has already moved on to JavaScript. For completeness I'll note that the Tk die- hards have at least a couple of ways to use Tk itself on the client side ( and . It's almost certain, though, that JavaScript is far closer to what Mr. Ramdas has in mind. From Parimala.Ramdas at Zoran.com Mon Jul 12 17:24:58 2004 From: Parimala.Ramdas at Zoran.com (Parimala Ramdas) Date: Mon Jul 12 17:25:03 2004 Subject: [Tkinter-discuss] Problem trying to use Tkinter in non-gui script Message-ID: >> Tkinter works on the local machine (windows, macintosh) or using the >> X11 networking protocol. You can't run Tkinter code on the server side >> of a web application. . . . > Right; I believe Mr. Ramdas has already moved on to > JavaScript. For completeness I'll note that the Tk die- > hards have at least a couple of ways to use Tk itself on > the client side ( and > . It's almost certain, > though, that JavaScript is far closer to what Mr. Ramdas > has in mind. Thank you both for the feedback. I will try Tk and javascript to see which one suits the requirement better. As Laird pointed out, it might be the latter. And its not Mr. but a Ms. Parimala From Parimala.Ramdas at Zoran.com Mon Jul 12 17:25:48 2004 From: Parimala.Ramdas at Zoran.com (Parimala Ramdas) Date: Mon Jul 12 17:25:50 2004 Subject: [Tkinter-discuss] Problem trying to use Tkinter in non-gui script Message-ID: >> Tkinter works on the local machine (windows, macintosh) or using the >> X11 networking protocol. You can't run Tkinter code on the server >> side of a web application. . . . > Right; I believe Mr. Ramdas has already moved on to JavaScript. For > completeness I'll note that the Tk die- hards have at least a couple > of ways to use Tk itself on the client side ( http://wiki.tcl.tk/swank > and > http://wiki.tcl.tk.plugin >. It's almost certain, though, that > JavaScript is far closer to what Mr. Ramdas has in mind. Thank you both for the feedback. I will try Tk and javascript to see which one suits the requirement better. As Laird pointed out, it might be the latter. And its not Mr. but a Ms. Parimala -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20040712/c06e2069/attachment.html From STEVEN.M.FAULCONER at saic.com Mon Jul 19 16:17:44 2004 From: STEVEN.M.FAULCONER at saic.com (Faulconer, Steven M.) Date: Mon Jul 19 16:24:19 2004 Subject: [Tkinter-discuss] Tkinter Class / Data passing Message-ID: <207DA77D2384D411A48B0008C7095D81C1DE5C@us-melbourne.mail.saic.com> Hello everyone, I have a program I've written that essentially acts as a graphical front-end to several in-house written command-line programs. The script is using Tkinter/Pmw as the interface language. The software works like this: A user runs the script and is presented with an interface where they select a 'project' and a 'database'. The user clicks a button to accept those selections, which starts a new window. In this window is a number of Pmw group widgets containing a set of widgets for each command-line program (we call them 'checkers'). Each checker widget group has a button to run the checker software (command-line). This is redirected to a NEW Toplevel window. My question is, what is the best method for getting data out of this new Toplevel window? Meaning, this new Toplevel window has a set of buttons that allow the user to accept the software run, based on the output, or cancel the run (not accepting the run). The issue is, how do I tell the parent the outcome? I've tried creating a variable in the parent and setting it in various places in the child, but that doesn't seem to work. The value never changes. I've even tried using a global variable, but that still doesn't work. I debated attaching the code, but I think it will help with my issue. MainApp is the primary window that runs first. It starts a new CheckerApp window, which lists all the checkers, and starts a CheckerWindow when the user actually clicks the 'run checker' button in the checkerapp. How can I tell the CheckerApp, from within CheckerWindow, what button the user selected (accept/deny). I'm sure its obvious by my code, but I'm a new programmer, and the script is still unfinished. Constructive criticism is greatly appreciated. And please let me know if I did not explain the issue well enough. Thanks. Steven -------------- next part -------------- A non-text attachment was scrubbed... Name: main.py Type: application/octet-stream Size: 22188 bytes Desc: not available Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20040719/243d59b5/main.obj From Netherdog at cs.com Tue Jul 20 06:56:42 2004 From: Netherdog at cs.com (Netherdog@cs.com) Date: Tue Jul 20 16:42:55 2004 Subject: [Tkinter-discuss] Changing the fonts on my Pmw.NoteBook tabs Message-ID: Hello everyone. It has been awhile since I have requested the sound advice of my esteemed Tkinter colleagues, but once again I am stumped. Regarding the use of the Pmw.NoteBook widget, I am trying to set/change the fonts for my notebook tabs, but cannot seem to figure out how to do it. Since Pmw.NoteBook has only one component, 'Hull', and no 'entry' component, for example, I am truly at a loss as to how this can be accomplished. Any ideas on this one? Thanking you in advance, Chris Nethery -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20040720/e4e73d94/attachment.html From PeterM at resmed.com.au Tue Jul 20 23:04:58 2004 From: PeterM at resmed.com.au (Peter Milliken) Date: Tue Jul 20 23:05:24 2004 Subject: [Tkinter-discuss] Changing the fonts on my Pmw.NoteBook tabs Message-ID: <274A369893F5FB4099345F006439D98701387AA5@bella.corp.resmed.org> The following is under the "Dynamic Components" section of the reference page for Pmw.NoteBook: "Page and tab components are created dynamically by the add() and insert() methods. By default, the pages are of type Tkinter.Frame and are created with a component group of Page and the tabs are of type Tkinter.Button and are created with a component group of Tab." Using this information as a "clue" :-), you can use calls to get the components of the NoteBook i.e. assuming your notebook instance was called "DisplayPages" and it had tabbed pages called "Entry", "Results" then you would have the following print self.component("DisplayPages").components() ['Entry', 'Entry-tab', 'Results', 'Results-tab', 'hull'] So the Frame component for the Entry tabbed page is called 'Entry' and the Button that contains the name (and font you want to manipulate) is called 'Entry-tab'. So to change the font is something like this: self.component('DisplayPages').component('Entry-tab').configure(font = ('Helvetica', 10, 'bold italic')) This is probably more detail than you were asking for but hey, what the hell! :-) Regards Peter -----Original Message----- From: Netherdog@cs.com [mailto:Netherdog@cs.com] Sent: Tuesday, July 20, 2004 2:57 PM To: tkinter-discuss@python.org Cc: clnethery@juno.com Subject: [Tkinter-discuss] Changing the fonts on my Pmw.NoteBook tabs Hello everyone. It has been awhile since I have requested the sound advice of my esteemed Tkinter colleagues, but once again I am stumped. Regarding the use of the Pmw.NoteBook widget, I am trying to set/change the fonts for my notebook tabs, but cannot seem to figure out how to do it. Since Pmw.NoteBook has only one component, 'Hull', and no 'entry' component, for example, I am truly at a loss as to how this can be accomplished. Any ideas on this one? Thanking you in advance, Chris Nethery Warning: Copyright ResMed. Where the contents of this email and/or attachment includes materials prepared by ResMed, the use of those materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient. This communication is confidential and may contain legally privileged information. By the use of email over the Internet or other communication systems, ResMed is not waiving either confidentiality of, or legal privilege in,the content of the email and of any attachments. If the recipient of this message is not the intended addressee, please call ResMed immediately on +61 2 9886 5000 Sydney, Australia. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20040721/85c1c015/attachment.html From klappnase at freenet.de Wed Jul 21 00:45:35 2004 From: klappnase at freenet.de (Michael Lange) Date: Wed Jul 21 00:48:28 2004 Subject: [Tkinter-discuss] Changing the fonts on my Pmw.NoteBook tabs In-Reply-To: <274A369893F5FB4099345F006439D98701387AA5@bella.corp.resmed.org> References: <274A369893F5FB4099345F006439D98701387AA5@bella.corp.resmed.org> Message-ID: <20040721004535.3f88509c.klappnase@freenet.de> On Wed, 21 Jul 2004 07:04:58 +1000 Peter Milliken wrote: > The following is under the "Dynamic Components" section of the reference > page for Pmw.NoteBook: > > "Page and tab components are created dynamically by the add() and insert() > methods. By default, the pages are of type Tkinter.Frame and are created > with a component group of Page and the tabs are of type Tkinter.Button and > are created with a component group of Tab." > > Using this information as a "clue" :-), you can use calls to get the > components of the NoteBook i.e. assuming your notebook instance was called > "DisplayPages" and it had tabbed pages called "Entry", "Results" then you > would have the following > > print self.component("DisplayPages").components() > > ['Entry', 'Entry-tab', 'Results', 'Results-tab', 'hull'] > > So the Frame component for the Entry tabbed page is called 'Entry' and the > Button that contains the name (and font you want to manipulate) is called > 'Entry-tab'. So to change the font is something like this: > > self.component('DisplayPages').component('Entry-tab').configure(font = > ('Helvetica', 10, 'bold italic')) > > This is probably more detail than you were asking for but hey, what the > hell! :-) > > Regards > Peter Why not just use this one (Pmw library reference): tab(pageIndex) Return the tab component widget of the page pageIndex, where pageIndex may have any of the forms accepted by the index() method. If tabpos is None, return None. So I think tab(pageName).configure(font=xyz) should do the job Michael From Cameron at Phaseit.net Fri Jul 23 18:55:44 2004 From: Cameron at Phaseit.net (Cameron Laird) Date: Fri Jul 23 18:52:56 2004 Subject: [Tkinter-discuss] Tkinter Class / Data passing In-Reply-To: <207DA77D2384D411A48B0008C7095D81C1DE5C@us-melbourne.mail.saic.com> References: <207DA77D2384D411A48B0008C7095D81C1DE5C@us-melbourne.mail.saic.com> Message-ID: <20040723165544.GA11262@lairds.us> On Mon, Jul 19, 2004 at 07:17:44AM -0700, Faulconer, Steven M. wrote: . . . > I have a program I've written that essentially acts as a graphical front-end > to several in-house written command-line programs. The script is using > Tkinter/Pmw as the interface language. The software works like this: > > A user runs the script and is presented with an interface where they select > a 'project' and a 'database'. The user clicks a button to accept those > selections, which starts a new window. In this window is a number of Pmw > group widgets containing a set of widgets for each command-line program (we > call them 'checkers'). Each checker widget group has a button to run the > checker software (command-line). This is redirected to a NEW Toplevel > window. > > My question is, what is the best method for getting data out of this new > Toplevel window? Meaning, this new Toplevel window has a set of buttons that > allow the user to accept the software run, based on the output, or cancel > the run (not accepting the run). The issue is, how do I tell the parent the > outcome? I've tried creating a variable in the parent and setting it in > various places in the child, but that doesn't seem to work. The value never > changes. I've even tried using a global variable, but that still doesn't > work. > I debated attaching the code, but I think it will help with my issue. > MainApp is the primary window that runs first. It starts a new CheckerApp > window, which lists all the checkers, and starts a CheckerWindow when the > user actually clicks the 'run checker' button in the checkerapp. How can I > tell the CheckerApp, from within CheckerWindow, what button the user > selected (accept/deny). > > I'm sure its obvious by my code, but I'm a new programmer, and the script is > still unfinished. Constructive criticism is greatly appreciated. And please > let me know if I did not explain the issue well enough. Thanks. . . . Has no one answered Mr. Faulconer's question? My impression is that it's MUCH easier than he's making it, but I'm not in a po- sition to address it any time soon. I sure don't want him thinking that we're unresponsive or that Tkinter is difficult, both of which I know to be false, with occasional exceptions. 'Anyone comfortable with PMW have time for this? From STEVEN.M.FAULCONER at saic.com Fri Jul 23 19:26:55 2004 From: STEVEN.M.FAULCONER at saic.com (Faulconer, Steven M.) Date: Fri Jul 23 19:33:44 2004 Subject: [Tkinter-discuss] Tkinter Class / Data passing Message-ID: <207DA77D2384D411A48B0008C7095D81C1DE7B@us-melbourne.mail.saic.com> The question actually got answered on the tutor list. Please accept my apologies for not updating this list. Thank you for the concern. The end result was the error I received is correct. What I eventually did was pass the instance of my parent class (self) in addition to the parent root instance. This allowed me to make a function calls on my parent class instance. I'll post my final code for comments when it is completed. Thanks for the concern. Steven -----Original Message----- From: Cameron Laird [mailto:Cameron@Phaseit.net] Sent: Friday, July 23, 2004 12:56 PM To: Faulconer, Steven M. Cc: 'tkinter-discuss@python.org' Subject: Re: [Tkinter-discuss] Tkinter Class / Data passing On Mon, Jul 19, 2004 at 07:17:44AM -0700, Faulconer, Steven M. wrote: . . . > I have a program I've written that essentially acts as a graphical front-end > to several in-house written command-line programs. The script is using > Tkinter/Pmw as the interface language. The software works like this: > > A user runs the script and is presented with an interface where they select > a 'project' and a 'database'. The user clicks a button to accept those > selections, which starts a new window. In this window is a number of Pmw > group widgets containing a set of widgets for each command-line program (we > call them 'checkers'). Each checker widget group has a button to run the > checker software (command-line). This is redirected to a NEW Toplevel > window. > > My question is, what is the best method for getting data out of this new > Toplevel window? Meaning, this new Toplevel window has a set of buttons that > allow the user to accept the software run, based on the output, or cancel > the run (not accepting the run). The issue is, how do I tell the parent the > outcome? I've tried creating a variable in the parent and setting it in > various places in the child, but that doesn't seem to work. The value never > changes. I've even tried using a global variable, but that still doesn't > work. > I debated attaching the code, but I think it will help with my issue. > MainApp is the primary window that runs first. It starts a new CheckerApp > window, which lists all the checkers, and starts a CheckerWindow when the > user actually clicks the 'run checker' button in the checkerapp. How can I > tell the CheckerApp, from within CheckerWindow, what button the user > selected (accept/deny). > > I'm sure its obvious by my code, but I'm a new programmer, and the script is > still unfinished. Constructive criticism is greatly appreciated. And please > let me know if I did not explain the issue well enough. Thanks. . . . Has no one answered Mr. Faulconer's question? My impression is that it's MUCH easier than he's making it, but I'm not in a po- sition to address it any time soon. I sure don't want him thinking that we're unresponsive or that Tkinter is difficult, both of which I know to be false, with occasional exceptions. 'Anyone comfortable with PMW have time for this? From STEVEN.M.FAULCONER at saic.com Tue Jul 27 15:57:59 2004 From: STEVEN.M.FAULCONER at saic.com (Faulconer, Steven M.) Date: Tue Jul 27 16:04:40 2004 Subject: [Tkinter-discuss] Printer Dialog Message-ID: <207DA77D2384D411A48B0008C7095D81C1DE8D@us-melbourne.mail.saic.com> Hello everyone. I've been searching the net for a printer dialog, preferably written in Tkinter. Haven't been able to find anything as yet, so I thought I'd ask if anyone has seen something like that? I'm looking for something simple that would provide a list of available printers, then print to the one that is selected. Target OS is Windows, though Solaris support would be nice. If anyone has seen something like that, please let me know. Thanks.