From bill at billbarksdale.com Mon Sep 12 04:08:04 2005 From: bill at billbarksdale.com (Bill Barksdale) Date: Sun, 11 Sep 2005 22:08:04 -0400 Subject: [Tkinter-discuss] (0,0) off the visible area of a Canvas Message-ID: <7f23c0053bfc8ad5d780e9a80b43be06@billbarksdale.com> I am sure this must be a common question but I couldn't find anything about it. When I run the following on my system, the first line appears cut off and the second line doesn't appear at all. I believe this is because (0,0) is not part of the visible area of a canvas, and that it starts instead at (3,3) or thereabouts. How can I fix this? import Tkinter as TK root = TK.Tk() canv = TK.Canvas(root,width=100,height=100,bg='red') canv.pack() canv.create_line(0,100,100,0) canv.create_line(0,0,0,100) Thanks, --Bill Barksdale From klappnase at web.de Mon Sep 12 12:24:21 2005 From: klappnase at web.de (Michael Lange) Date: Mon, 12 Sep 2005 12:24:21 +0200 Subject: [Tkinter-discuss] (0,0) off the visible area of a Canvas In-Reply-To: <7f23c0053bfc8ad5d780e9a80b43be06@billbarksdale.com> References: <7f23c0053bfc8ad5d780e9a80b43be06@billbarksdale.com> Message-ID: <20050912122421.1ae2f6fd@rappelkiste> On Sun, 11 Sep 2005 22:08:04 -0400 Bill Barksdale wrote: > I am sure this must be a common question but I couldn't find anything > about it. > > When I run the following on my system, the first line appears cut off > and the second line doesn't appear at all. I believe this is because > (0,0) is not part of the visible area of a canvas, and that it starts > instead at (3,3) or thereabouts. How can I fix this? > > import Tkinter as TK > root = TK.Tk() > canv = TK.Canvas(root,width=100,height=100,bg='red') > canv.pack() > canv.create_line(0,100,100,0) > canv.create_line(0,0,0,100) > Hi Bill, I think the line is being hidden under the Canvases border, so you can try: canv.configure(bd=0, highlightthickness=0) and if you need a decorative border pack the canvas into another Frame. I hope this helps Michael From fredrik at pythonware.com Mon Sep 12 14:40:37 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 12 Sep 2005 14:40:37 +0200 Subject: [Tkinter-discuss] (0,0) off the visible area of a Canvas References: <7f23c0053bfc8ad5d780e9a80b43be06@billbarksdale.com> Message-ID: Bill Barksdale wrote: > I am sure this must be a common question but I couldn't find anything > about it. > > When I run the following on my system, the first line appears cut off > and the second line doesn't appear at all. I believe this is because > (0,0) is not part of the visible area of a canvas, and that it starts > instead at (3,3) or thereabouts. How can I fix this? > > import Tkinter as TK > root = TK.Tk() > canv = TK.Canvas(root,width=100,height=100,bg='red') > canv.pack() > canv.create_line(0,100,100,0) > canv.create_line(0,0,0,100) stock answer: by default, the coordinate system is aligned with the widget's upper left corner, which means that things you draw will be covered by the inner border. to fix this, you can either set the border width to zero, add scrollbars to the widget (this fixes the coordinate system), or explicitly reset the coordinate system: w.xview_moveto(0) w.yview_moveto(0) From klappnase at web.de Mon Sep 12 19:03:05 2005 From: klappnase at web.de (Michael Lange) Date: Mon, 12 Sep 2005 19:03:05 +0200 Subject: [Tkinter-discuss] debian tkinter broken or tk problem (or what)? Message-ID: <20050912190305.014b1be8.klappnase@web.de> Hello, I noticed that for some reason some Tkinter apps I wrote and successfully used for a while seem to be broken when run on my newly installed debian system (python-2.3.5 / tk-8.4.9). The problem I noticed arises when I run a subprocess with popen2.Popen4() and catch the output with tk.createfilehandler() ; sometimes this works without problems, but sometimes after a while the gui freezes and in the process list I can see the subprocess as "zombie". Normally I would suspect my code to be buggy, but like I said, the same scripts run fine on mandrake (python-2.3.3 / tk-8.4.5). I just wondered if anyone has a clue, may the reason be the debian build or the tk version ? Best regards Michael From gilcneth at earthlink.net Mon Sep 12 19:42:33 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Mon, 12 Sep 2005 13:42:33 -0400 Subject: [Tkinter-discuss] Trouble installing PyBWidgets Message-ID: <410-22005911217423346@earthlink.net> Hello All: I am having trouble getting the PyBWidgets plugged in correctly in a Windows XP environment. It appears to be path-related, since the BWidget package can't be found. The installation 'Read Me' indicates that I should 'package require'--what does this mean and how would I do this? Thanking you in advance, Chris Nethery gilcneth at earthlink.net (new email address) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050912/5e48ef86/attachment.htm From klappnase at web.de Mon Sep 12 21:04:12 2005 From: klappnase at web.de (Michael Lange) Date: Mon, 12 Sep 2005 21:04:12 +0200 Subject: [Tkinter-discuss] Trouble installing PyBWidgets In-Reply-To: <410-22005911217423346@earthlink.net> References: <410-22005911217423346@earthlink.net> Message-ID: <20050912210412.791e21d6@rappelkiste> On Mon, 12 Sep 2005 13:42:33 -0400 "gilcneth at earthlink.net" wrote: > Hello All: > > I am having trouble getting the PyBWidgets plugged in correctly in a Windows XP environment. It appears to be path-related, since the BWidget package can't be found. The installation 'Read Me' indicates that I should 'package require'--what does this mean and how would I do this? > > Hi Chris, "package require .." is something like the tcl equivalent to python's "import ...". However, you shouldn't have to bother with this, it's something the python module should do for you. Did you run the setup.py, and if yes, where did it install the BWidgets ? On my linux box they're in /usr/share/pybwidget , I'm not sure about windows, but I think somewhere in your Tcl folder should work. Regards Michael From fredrik at pythonware.com Mon Sep 12 23:52:12 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 12 Sep 2005 23:52:12 +0200 Subject: [Tkinter-discuss] ANN: WCK for Tkinter 1.1 alpha 2 (september 12, 2004) Message-ID: The Widget Construction Kit (WCK) is an extension API that allows you to implement custom widgets in pure Python. The WCK can be (and is being) used for everything from light-weight display widgets to full-blown editor frameworks. The Tkinter3000 implementation of the WCK supports all recent versions of Python and Tk/Tkinter. The 1.1 alpha 2 release adds improved controller support, resource caching for pens, brushes, and fonts, and support for creating image objects from data in strings. Introduction: http://www.effbot.org/zone/wck-1.htm Downloads: http://www.effbot.org/downloads#tkinter3000 Documentation: http://www.effbot.org/zone/wck.htm http://www.effbot.org/zone/wck-api.htm enjoy /F From gilcneth at earthlink.net Tue Sep 13 09:40:03 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Tue, 13 Sep 2005 03:40:03 -0400 Subject: [Tkinter-discuss] Trouble installing PyBWidgets Message-ID: <410-2200592137403343@earthlink.net> Thank you, Michael, for your reply. I have tried running setup.py and receive the following error: >python setup.py usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: no commands supplied I guess I need to provide some additional commands, but I am not sure which commands I should provide. -- Chris gilcneth at earthlink.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050913/91c01142/attachment.html From fredrik at pythonware.com Tue Sep 13 11:48:30 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 13 Sep 2005 11:48:30 +0200 Subject: [Tkinter-discuss] Trouble installing PyBWidgets References: <410-2200592137403343@earthlink.net> Message-ID: gilcneth at earthlink.net wrote: > I have tried running setup.py and receive the following error: > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] > or: setup.py --help [cmd1 cmd2 ...] > or: setup.py --help-commands > or: setup.py cmd --help > > error: no commands supplied > I guess I need to provide some additional commands, > but I am not sure which commands I should provide. hint: python setup.py --help-commands Standard commands: build build everything needed to install build_py "build" pure Python modules (copy to build directory) build_ext build C/C++ extensions (compile/link to build directory) build_clib build C/C++ libraries used by Python extensions build_scripts "build" scripts (copy and fixup #! line) clean clean up output of 'build' command install install everything from build directory install_lib install all Python modules (extensions and pure Python) install_headers install C/C++ header files install_scripts install scripts (Python or otherwise) install_data install data files sdist create a source distribution (tarball, zip file, etc.) register register the distribution with the Python package index bdist create a built (binary) distribution bdist_dumb create a "dumb" built distribution bdist_rpm create an RPM distribution bdist_wininst create an executable installer for MS Windows given your subject line, "install" might be what you want. reading the generic installation guide can also be a good idea: http://docs.python.org/inst/inst.html From klappnase at web.de Tue Sep 13 13:22:41 2005 From: klappnase at web.de (Michael Lange) Date: Tue, 13 Sep 2005 13:22:41 +0200 Subject: [Tkinter-discuss] debian tkinter broken or tk problem (or what)? In-Reply-To: <20050912190305.014b1be8.klappnase@web.de> References: <20050912190305.014b1be8.klappnase@web.de> Message-ID: <20050913132241.02d7a47c@rappelkiste> On Mon, 12 Sep 2005 19:03:05 +0200 Michael Lange wrote: > I noticed that for some reason some Tkinter apps I wrote and successfully > used for a while seem to be broken when run on my newly installed debian > system (python-2.3.5 / tk-8.4.9). > The problem I noticed arises when I run a subprocess with popen2.Popen4() > and catch the output with tk.createfilehandler() ; sometimes this works without > problems, but sometimes after a while the gui freezes and in the process list > I can see the subprocess as "zombie". > Normally I would suspect my code to be buggy, but like I said, the same scripts > run fine on mandrake (python-2.3.3 / tk-8.4.5). > > I just wondered if anyone has a clue, may the reason be the debian build or the > tk version ? > Hello again, another thing I noticed, on debian (unlike mandrake) tcl is build with thread support; does anyone know if it is likely that my Tkinter trouble is caused by this? Regards Michael From gilcneth at earthlink.net Tue Sep 13 20:28:46 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Tue, 13 Sep 2005 14:28:46 -0400 Subject: [Tkinter-discuss] Trouble installing PyBWidgets Message-ID: <410-220059213182846296@earthlink.net> I see what was happening here. I was running 'setup.py --help-commands' and my text editor was just opening up the file. I wasn't assuming the obvious, which was that I should have been entering 'python setup.py --help-commands'. I have gone down the 'python setup.py install' route and everything is working great. Thank you for your help! -- Chris gilcneth at earthlink.net wrote: > I have tried running setup.py and receive the following error: > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] > or: setup.py --help [cmd1 cmd2 ...] > or: setup.py --help-commands > or: setup.py cmd --help > > error: no commands supplied > I guess I need to provide some additional commands, > but I am not sure which commands I should provide. hint: python setup.py --help-commands Standard commands: build build everything needed to install build_py "build" pure Python modules (copy to build directory) build_ext build C/C++ extensions (compile/link to build directory) build_clib build C/C++ libraries used by Python extensions build_scripts "build" scripts (copy and fixup #! line) clean clean up output of 'build' command install install everything from build directory install_lib install all Python modules (extensions and pure Python) install_headers install C/C++ header files install_scripts install scripts (Python or otherwise) install_data install data files sdist create a source distribution (tarball, zip file, etc.) register register the distribution with the Python package index bdist create a built (binary) distribution bdist_dumb create a "dumb" built distribution bdist_rpm create an RPM distribution bdist_wininst create an executable installer for MS Windows given your subject line, "install" might be what you want. reading the generic installation guide can also be a good idea: http://docs.python.org/inst/inst.html _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050913/9557e882/attachment.html From gilcneth at earthlink.net Tue Sep 13 20:31:42 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Tue, 13 Sep 2005 14:31:42 -0400 Subject: [Tkinter-discuss] FW: Re: Trouble installing PyBWidgets Message-ID: <410-220059213183142671@earthlink.net> By the way, have I mentioned that I am the 'Poster Boy' for adults with ADD? Best Regards, Chris Nethery gilcneth at earthlink.net ----- Original Message ----- From: gilcneth at earthlink.net To: tkinter-discuss Sent: 9/13/2005 2:28:45 PM Subject: Re: [Tkinter-discuss] Trouble installing PyBWidgets I see what was happening here. I was running 'setup.py --help-commands' and my text editor was just opening up the file. I wasn't assuming the obvious, which was that I should have been entering 'python setup.py --help-commands'. I have gone down the 'python setup.py install' route and everything is working great. Thank you for your help! -- Chris gilcneth at earthlink.net wrote: > I have tried running setup.py and receive the following error: > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] > or: setup.py --help [cmd1 cmd2 ...] > or: setup.py --help-commands > or: setup.py cmd --help > > error: no commands supplied > I guess I need to provide some additional commands, > but I am not sure which commands I should provide. hint: python setup.py --help-commands Standard commands: build build everything needed to install build_py "build" pure Python modules (copy to build directory) build_ext build C/C++ extensions (compile/link to build directory) build_clib build C/C++ libraries used by Python extensions build_scripts "build" scripts (copy and fixup #! line) clean clean up output of 'build' command install install everything from build directory install_lib install all Python modules (extensions and pure Python) install_headers install C/C++ header files install_scripts install scripts (Python or otherwise) install_data install data files sdist create a source distribution (tarball, zip file, etc.) register register the distribution with the Python package index bdist create a built (binary) distribution bdist_dumb create a "dumb" built distribution bdist_rpm create an RPM distribution bdist_wininst create an executable installer for MS Windows given your subject line, "install" might be what you want. reading the generic installation guide can also be a good idea: http://docs.python.org/inst/inst.html _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050913/7b01e7be/attachment.htm From monuindia at gmail.com Wed Sep 14 06:20:17 2005 From: monuindia at gmail.com (Monu Agrawal) Date: Wed, 14 Sep 2005 09:50:17 +0530 Subject: [Tkinter-discuss] to read from label Message-ID: Hi, I have a tkinter label written some text I have forgotten. Now I want to know that what is written in the label. How can I get text of the label? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050914/27c83087/attachment.html From stewart.midwinter at gmail.com Wed Sep 14 06:23:53 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Tue, 13 Sep 2005 23:23:53 -0500 Subject: [Tkinter-discuss] to read from label Message-ID: <4327a6a8.17ec18f5.49b1.ffffb4c6@mx.gmail.com> Well I for one don't quite understand what you are asking. Can you explain again, maybe in more detail? How can you forget a label text? Cheers S -----Original Message----- From: "Monu Agrawal" Sent: 05-09-13 23:20:17 To: "tkinter-discuss at python.org" Subject: [Tkinter-discuss] to read from label Hi, I have a tkinter label written some text I have forgotten. Now I want to know that what is written in the label. How can I get text of the label? From fredrik at pythonware.com Wed Sep 14 08:17:47 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 14 Sep 2005 08:17:47 +0200 Subject: [Tkinter-discuss] to read from label References: Message-ID: Monu Agrawal wrote: > Hi, I have a tkinter label written some text I have forgotten. Now I want to > know that what is written in the label. > How can I get text of the label? w = Label(text="forgotten text") text = w.cget("text") print text From gilcneth at earthlink.net Mon Sep 12 09:55:09 2005 From: gilcneth at earthlink.net (lisa c nethery) Date: Mon, 12 Sep 2005 03:55:09 -0400 Subject: [Tkinter-discuss] Trouble installing BWidgets Message-ID: <000801c5b76f$56775080$0202a8c0@CNETHERY> Hello all. I am trying to install PyBWidgets on Windows XP, but have not yet been successful. I suspect that a path must be specified, but am not entirely sure. I note that the 'Read Me' file indicates I must perform a 'package require'. What is a package require and how would I perform one? Thanking you in advance, Chris Nethery -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050912/88b2110f/attachment.htm From camfarnell at cogeco.ca Thu Sep 15 01:43:06 2005 From: camfarnell at cogeco.ca (Cam) Date: Wed, 14 Sep 2005 19:43:06 -0400 Subject: [Tkinter-discuss] Menus Message-ID: <4328B58A.8020502@cogeco.ca> It's easy enough, using Menubutton and Menu, to make a menu pop up in response to the user clicking a button. I want to make a menu pop up when the user right-clicks on a canvas. This seems like a kind of common thing to want to do but nothing in Tkinter or PMW is popping off the page at me as a way to do this. Am I just being really dense or is there no simple way to accomplish this? Thanks Cam Farnell From jepler at unpythonic.net Thu Sep 15 04:18:03 2005 From: jepler at unpythonic.net (jepler@unpythonic.net) Date: Wed, 14 Sep 2005 21:18:03 -0500 Subject: [Tkinter-discuss] Menus In-Reply-To: <4328B58A.8020502@cogeco.ca> References: <4328B58A.8020502@cogeco.ca> Message-ID: <20050915021800.GA12328@unpythonic.net> I think you're looking for the tk_popup() method. def tk_popup(self, x, y, entry=""): """Post the menu at position X,Y with entry ENTRY.""" self.tk.call('tk_popup', self._w, x, y, entry) Here's an example of its use: from Tkinter import * t = Tk() t.option_add("*Menu.tearOff", "0") m = Menu(t) m.insert_command(END, label="A ...") m.insert_command(END, label="B ...") m.insert_command(END, label="C ...") m.insert_command(END, label="D ...") c = Canvas(t) c.bind("", lambda e: m.tk_popup(e.x_root, e.y_root)) c.pack() t.mainloop() -------------- 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/20050914/7eaef3fc/attachment.pgp From gilcneth at earthlink.net Thu Sep 15 05:46:57 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Wed, 14 Sep 2005 23:46:57 -0400 Subject: [Tkinter-discuss] Difficulty getting started with a BWidget Tree Message-ID: <410-22005941534657750@earthlink.net> Hello All: I am trying to create a Tree, using PyBWidgets, but am unsure about how to actually create the initial parent and/or child nodes. The documentation leads me to believe that I should use the' insert' command, but how? The documentation indicates the following: pathName insert index parent node ?option value...? So, given my example below, if I want to add a node to my Tree, wouldn't I use the command TopTree.insert? And, if so, I assume I start at index '0'? OK, but now who's the parent? I know this has to be simple, but I am just not figuring this one out. Please share your thoughts. Thank you! -- Chris Nethery from Tkinter import * from bwidget import * t = Tk() TopTree = Tree(t, relief=GROOVE) TopTree.pack() t.mainloop() gilcneth at earthlink.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050914/6a1b15f2/attachment.html From klappnase at web.de Thu Sep 15 12:44:09 2005 From: klappnase at web.de (Michael Lange) Date: Thu, 15 Sep 2005 12:44:09 +0200 Subject: [Tkinter-discuss] Difficulty getting started with a BWidget Tree In-Reply-To: <410-22005941534657750@earthlink.net> References: <410-22005941534657750@earthlink.net> Message-ID: <20050915124409.372a4ac4@rappelkiste> On Wed, 14 Sep 2005 23:46:57 -0400 "gilcneth at earthlink.net" wrote: > Hello All: > > I am trying to create a Tree, using PyBWidgets, but am unsure about how to actually create the initial parent and/or child nodes. The documentation leads me to believe that I should use the' insert' command, but how? The documentation indicates the following: > > pathName insert index parent node ?option value...? > > So, given my example below, if I want to add a node to my Tree, wouldn't I use the command TopTree.insert? And, if so, I assume I start at index '0'? OK, but now who's the parent? I know this has to be simple, but I am just not figuring this one out. Please share your thoughts. > Hi Chris, I wrote a directory Tree widget a while ago, rather a test than a usable widget, but maybe good enough to get started. I had some problems with my release of pybwidget, because some icons were missing, I believe the "plus" and "minus" icons for the Tree, but I don't remember exactly. So, here's the code: ############ file DirTree.py ############################## import Tkinter as tk import bwidget as bw import os class DirTree(tk.Frame): def __init__(self, master, *args, **kw): tk.Frame.__init__(self, master) self.tree = tree = bw.Tree(self, opencmd=self.open_folder, closecmd=self.close_folder, *args, **kw) tree.pack(fill='both', expand=1) self.folder_icon = tk.PhotoImage(file='/usr/share/pybwidget/images/folder.gif') self.openfolder_icon = tk.PhotoImage(file='/usr/share/pybwidget/images/openfold.gif') self.file_icon = tk.PhotoImage(file='/usr/share/pybwidget/images/file.gif') node = self.tree.insert('end', 'root', text='/', image=self.folder_icon, drawcross='allways', data='/') self.tree.opentree(node, recurse=0) def close_folder(self, node): self.tree.itemconfigure(node, image=self.folder_icon) def open_folder(self, node): path = self.tree.itemcget(node, 'data') children = os.listdir(path) files, dirs = [], [] for item in children: if os.path.isdir(os.path.join(path, item)): dirs.append(item) #else: # files.append(item) dirs.sort() #files.sort() for item in dirs: newpath = os.path.join(path, item) self.tree.insert('end', node, text=item, image=self.folder_icon, drawcross='allways', data=newpath) #for item in files: # newpath = os.path.join(path, item) # self.tree.insert('end', node, text=item, image=self.file_icon, drawcross='never', data=newpath) self.tree.itemconfigure(node, image=self.openfolder_icon) def test(): r = tk.Tk() t = DirTree(r, bg='white', selectbackground='blue4', selectforeground='white', deltax=18, deltay=18) t.pack(fill='both', expand=1) r.mainloop() if __name__== '__main__': test() ############################################################## I hope this helps Michael From jepler at unpythonic.net Thu Sep 15 15:22:30 2005 From: jepler at unpythonic.net (jepler@unpythonic.net) Date: Thu, 15 Sep 2005 08:22:30 -0500 Subject: [Tkinter-discuss] pybwidget release 0.1.2 Message-ID: <20050915132226.GA2861@unpythonic.net> pybwidget is a Python wrapper around the 'bwidget' family of widgets for Tkinter. It includes these classes: Entry Label Button ArrowButton ProgressBar ScrollView Separator MainFrame LabelFrame TitleFrame PanelFrame ScrolledWindow ScrollableFrame PanedWindow ButtonBox PagesManager NoteBook Dialog StatusBar LabelEntry ComboBox SpinBox Tree ListBox MessageDialog ProgressDialog PasswordDialog SelectFont SelectColor I know it's been a long time, but I've finally gotten around to making a new release of pybwidget, called 0.1.2_1.7.0. It has all the fixes I could find that have been mentioned in the tkinter-discuss mailing list archives. Compared to 0.1.1, here's a summary of changes: * add ROOT as a module-level constant, as requested * bindtabs, bind_image, bind_text all handle the 'func' parameter properly * several instances of 'self.tl' corrected to 'self.tk' * the 'nodes' function of the Tree widget now passes all arguments to Tk * The xbm-format images are installed by setup.py * how to run setup.py is mentioned in README.html This release is available at http://tkinter.unpythonic.net/bwidget Please report your experiences, good or bad, on the Tkinter mailing list tkinter-discuss at python.org Jeff Epler jepler at unpythonic.net -------------- 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/20050915/8754d88d/attachment.pgp From shussai2 at yahoo.com Thu Sep 15 15:58:29 2005 From: shussai2 at yahoo.com (Sajjad Hussain) Date: Thu, 15 Sep 2005 06:58:29 -0700 (PDT) Subject: [Tkinter-discuss] Non-Rectangular Windows Help Message-ID: <20050915135829.10697.qmail@web30311.mail.mud.yahoo.com> Hi, I am repeating this question again. I was told that there is a library available that allows you to create non-rectangular windows in Python-Tkinter (like the Windows Media Player). Can anyone please tell me if there is any other library available or how to install this. I am trying to install tkdnd and its tkinter wrapper available from these sites http://sourceforge.net/projects/tkdnd http://www.8ung.at/klappnase/TkinterDnD/TkinterDnD.html I have placed the TkinterDnD.py in the lib-Tk folder of Python. I have also unzipped and placed the tkdnd-1.0a2 (contains the demo, lib, doc folders) folder in Tcl\lib folder. There are two dlls available. They are: libtkdnd.dll and libtkdnd10.dll. I am not to sure where to place them. Now when I type the following commands, I get the error shown below: >>> from Tkinter import * >>> import TkinterDnD >>> root = TkinterDnD.Tk() Traceback (most recent call last): File "", line 1, in ? File "c:\Python23\lib\TkinterDnD.py", line 104, in __init__ self.tk.eval('package require tkdnd') TclError: can't find package tkdnd Can anyone please tell me what I am doing wrong. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From gilcneth at earthlink.net Thu Sep 15 16:00:37 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Thu, 15 Sep 2005 10:00:37 -0400 Subject: [Tkinter-discuss] Difficulty getting started with a BWidget Tree Message-ID: <410-2200594151403746@earthlink.net> That does indeed help! Thank you! -- Chris > [Original Message] > From: Michael Lange > To: > Date: 9/15/2005 10:43:27 AM > Subject: Re: [Tkinter-discuss] Difficulty getting started with a BWidget Tree > > On Wed, 14 Sep 2005 23:46:57 -0400 > "gilcneth at earthlink.net" wrote: > > > Hello All: > > > > I am trying to create a Tree, using PyBWidgets, but am unsure about how to actually create the initial parent and/or child nodes. The documentation leads me to believe that I should use the' insert' command, but how? The documentation indicates the following: > > > > pathName insert index parent node ?option value...? > > > > So, given my example below, if I want to add a node to my Tree, wouldn't I use the command TopTree.insert? And, if so, I assume I start at index '0'? OK, but now who's the parent? I know this has to be simple, but I am just not figuring this one out. Please share your thoughts. > > > Hi Chris, > > I wrote a directory Tree widget a while ago, rather a test than a usable widget, but maybe good > enough to get started. I had some problems with my release of pybwidget, because some icons were missing, > I believe the "plus" and "minus" icons for the Tree, but I don't remember exactly. > So, here's the code: > > ############ file DirTree.py ############################## > import Tkinter as tk > import bwidget as bw > import os > > class DirTree(tk.Frame): > def __init__(self, master, *args, **kw): > tk.Frame.__init__(self, master) > self.tree = tree = bw.Tree(self, opencmd=self.open_folder, closecmd=self.close_folder, *args, **kw) > tree.pack(fill='both', expand=1) > > self.folder_icon = tk.PhotoImage(file='/usr/share/pybwidget/images/folder.gif') > self.openfolder_icon = tk.PhotoImage(file='/usr/share/pybwidget/images/openfold.gif') > self.file_icon = tk.PhotoImage(file='/usr/share/pybwidget/images/file.gif') > > node = self.tree.insert('end', 'root', text='/', image=self.folder_icon, drawcross='allways', data='/') > self.tree.opentree(node, recurse=0) > > def close_folder(self, node): > self.tree.itemconfigure(node, image=self.folder_icon) > > def open_folder(self, node): > path = self.tree.itemcget(node, 'data') > children = os.listdir(path) > files, dirs = [], [] > for item in children: > if os.path.isdir(os.path.join(path, item)): > dirs.append(item) > #else: > # files.append(item) > dirs.sort() > #files.sort() > for item in dirs: > newpath = os.path.join(path, item) > self.tree.insert('end', node, text=item, image=self.folder_icon, drawcross='allways', data=newpath) > #for item in files: > # newpath = os.path.join(path, item) > # self.tree.insert('end', node, text=item, image=self.file_icon, drawcross='never', data=newpath) > self.tree.itemconfigure(node, image=self.openfolder_icon) > > > def test(): > r = tk.Tk() > t = DirTree(r, bg='white', selectbackground='blue4', selectforeground='white', deltax=18, deltay=18) > t.pack(fill='both', expand=1) > r.mainloop() > > if __name__== '__main__': > test() > ############################################################## > > I hope this helps > > Michael > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss From gilcneth at earthlink.net Thu Sep 15 17:44:41 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Thu, 15 Sep 2005 11:44:41 -0400 Subject: [Tkinter-discuss] pybwidget release 0.1.2 Message-ID: <410-220059415154441125@earthlink.net> Thank you Jeff! I am updating my 0.1.1 installation with 0.1.2. Best Regards, Chris Nethery > [Original Message] > From: > To: ; > Date: 9/15/2005 1:22:33 PM > Subject: [Tkinter-discuss] pybwidget release 0.1.2 > > pybwidget is a Python wrapper around the 'bwidget' family of widgets for > Tkinter. It includes these classes: > Entry Label Button ArrowButton ProgressBar ScrollView Separator > MainFrame LabelFrame TitleFrame PanelFrame ScrolledWindow > ScrollableFrame PanedWindow ButtonBox PagesManager NoteBook Dialog > StatusBar LabelEntry ComboBox SpinBox Tree ListBox MessageDialog > ProgressDialog PasswordDialog SelectFont SelectColor > > I know it's been a long time, but I've finally gotten around to making a > new release of pybwidget, called 0.1.2_1.7.0. > > It has all the fixes I could find that have been mentioned in the > tkinter-discuss mailing list archives. Compared to 0.1.1, here's a > summary of changes: > * add ROOT as a module-level constant, as requested > * bindtabs, bind_image, bind_text all handle the 'func' parameter > properly > * several instances of 'self.tl' corrected to 'self.tk' > * the 'nodes' function of the Tree widget now passes all arguments > to Tk > * The xbm-format images are installed by setup.py > * how to run setup.py is mentioned in README.html > > This release is available at > http://tkinter.unpythonic.net/bwidget > > Please report your experiences, good or bad, on the Tkinter mailing list > tkinter-discuss at python.org > > Jeff Epler > jepler at unpythonic.net From klappnase at web.de Thu Sep 15 22:07:01 2005 From: klappnase at web.de (Michael Lange) Date: Thu, 15 Sep 2005 22:07:01 +0200 Subject: [Tkinter-discuss] Non-Rectangular Windows Help In-Reply-To: <20050915135829.10697.qmail@web30311.mail.mud.yahoo.com> References: <20050915135829.10697.qmail@web30311.mail.mud.yahoo.com> Message-ID: <20050915220701.7225b64b@rappelkiste> On Thu, 15 Sep 2005 06:58:29 -0700 (PDT) Sajjad Hussain wrote: > Hi, > > I am repeating this question again. I was told that > there is a library available that allows you to create > non-rectangular windows in Python-Tkinter (like the > Windows Media Player). Can anyone please tell me if > there is any other library available or how to install > this. > > I am trying to install tkdnd and its tkinter wrapper > available from these sites > > http://sourceforge.net/projects/tkdnd > > http://www.8ung.at/klappnase/TkinterDnD/TkinterDnD.html > > I have placed the TkinterDnD.py in the lib-Tk folder > of Python. I have also unzipped and placed the > tkdnd-1.0a2 (contains the demo, lib, doc folders) > folder in Tcl\lib folder. There are two dlls > available. They are: libtkdnd.dll and libtkdnd10.dll. > I am not to sure where to place them. > > Now when I type the following commands, I get the > error shown below: > > >>> from Tkinter import * > >>> import TkinterDnD > >>> root = TkinterDnD.Tk() > > Traceback (most recent call last): > File "", line 1, in ? > File "c:\Python23\lib\TkinterDnD.py", line 104, in > __init__ > self.tk.eval('package require tkdnd') > TclError: can't find package tkdnd > > Can anyone please tell me what I am doing wrong. Hi Sajjad, the problem is here that Tk cannot find the tkdnd-dll's; I don't have a windows box at hand, so `im not sure about the directory structure on windows. On my linux box it looks like this: The main tcl / tk libraries are in /usr/lib: /usr/lib/libtk8.4.so.0 etc. In the same directory there's a folder /usr/lib/tk8.4/ which contains Tk's .tcl files. I put the tkdnd folder at the same level into /usr/lib/tkdnd1.0/ so the tkdnd library sits at : /usr/lib/tkdnd1.0/libtkdnd1.0.so Maybe your problem is that you just copied the whole package to your Tcl\lib folder and now it looks like: ...Tcl\lib\tkdnd\lib\tkdnd\tkdnd.dll If this is the case, try something like: ...Tcl\lib\tkdnd\tkdnd.dll or ...Tcl\lib\tkdnd.dll I'm sorry I cannot give you some better advice, but I hope this helps anyway. Regards Michael From gilcneth at earthlink.net Fri Sep 16 09:11:07 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Fri, 16 Sep 2005 03:11:07 -0400 Subject: [Tkinter-discuss] BWidgets Tree Message-ID: <410-2200595167117656@earthlink.net> Hello Everyone. I am working with the BWidgets tree, but am having difficulty understanding how Parent/Child node relationships are actually handled. More specifically, I think that most people use Trees to REPRESENT hierarchies?...I would like to use the widget to CREATE them. Having said this, the BWidget Tree looks like it is probably the best tree widget for this purpose. But, like os.listdir is doing in Michael Lange's program, I need to generate and cache lists reflecting the contents of each parent node. Anyway, if you run the program I have included (you'll have to use other icons), I am (so far) able to generate Child-nodes. Now, I want to be able to create 'GrandChildren' from whichever node has focus (need to add highlighting later). I also want to keep track of each node's level in the hierarchy because the level of the node will determine which icons will be used, not its 'state' (ie. open or closed). I think I should be able to do this just fine, once I can gain access to the Parent nodes' names and the Child index positions. However, when I try to grab index positions, parent-names, etc., I am receiving errors because I am trying to grab data from the widget instances, rather than the widgets themselves. If I seem excessively confused, I hope you'll forgive me. It takes me a few nudges in the right direction before I start to catch on to things like this. import Tkinter as tk import bwidget as bw class DirTree(tk.Frame): def __init__(self, master, *args, **kw): tk.Frame.__init__(self, master) treeFrame = tk.Frame(master, height=200, width=200) treeFrame.pack(side=tk.TOP) self.tree = bw.Tree(treeFrame, opencmd=self.open_folder, closecmd=self.close_folder, *args, **kw) self.tree.pack(fill='both', expand=1) self.data_element_icon = tk.PhotoImage(file='C:\Documents and Settings\John Doe\Desktop\Test_Icon.gif') self.node = self.tree.insert('end', 'root', text='/', image=self.data_element_icon, drawcross='allways', data='/') self.tree.opentree(self.node, recurse=0) buttonFrame = tk.Frame(master, height=200, width=200) buttonFrame.pack(side=tk.BOTTOM) self.button = tk.Button(buttonFrame, text='Create child node', command=self.create_node, relief=tk.GROOVE) self.button.pack() def close_folder(self, node): self.tree.itemconfigure(node, image=self.data_element_icon) def open_folder(self, node): path = self.tree.opentree(node, recurse=1) def create_node(self): if self.button: self.tree.insert('end', self.node, text='Hello There', image=self.data_element_icon, drawcross='allways') def test(): r = tk.Tk() t = DirTree(r, bg='white', selectbackground='blue4', selectforeground='white', deltax=18, deltay=18) t.pack(fill='both', expand=1) r.mainloop() if __name__== '__main__': test() Thank you and Best Regards, Chris Nethery gilcneth at earthlink.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050916/b97527c1/attachment-0001.htm From gilcneth at earthlink.net Mon Sep 19 18:03:15 2005 From: gilcneth at earthlink.net (gilcneth@earthlink.net) Date: Mon, 19 Sep 2005 12:03:15 -0400 Subject: [Tkinter-discuss] Some progress, some troubles with BWidget tree Message-ID: <410-22005911916315500@earthlink.net> Hello All: I finally figured out what was wrong with my code before, with regard to creating new nodes (please see code below). My difficulty now is understanding how to work with focus. I am able to generate nodes and I am able to identify them by their position. Now, I am trying to identify nodes that have focus. But, perhaps my thinking is wrong? Essentially, I am trying to identify the node(s) that the user has selected, so that only certain events can occur when those nodes are highlighted/selected/have focus - ?. For example, if a parent is 'selected' or 'has focus', the end-user can create other parents AND/OR additional children, but if a child is 'selected' or 'has focus', only additional children can be created. I have tried the 'focus' function in varying combinations, but I'm always returning 'None' or an instance-error. Any suggestions here are quite welcome. I am beginning to understand things a bit better now, but 'global'-? BWidget functions are not one of these things. Thank you and Best Regards, Chris Nethery ############ file tree_example.py ############################## import Tkinter as tk import bwidget as bw import string class DirTree(tk.Frame): def __init__(self, master, *args, **kw): tk.Frame.__init__(self, master) treeFrame = tk.Frame(master) treeFrame.pack(side=tk.TOP) self.tree_Instance = tree_Instance = bw.Tree(treeFrame, padx=60, opencmd=self.open_node, closecmd=self.close_node, *args, **kw) tree_Instance.pack(fill='both', expand=1) self.tree_icon = tk.PhotoImage(file=tree_icon.gif') self.parent_icon = tk.PhotoImage(file='parent_icon.gif') self.child_icon = tk.PhotoImage(file='child_icon.gif') self.node = tree_Instance.insert('end', 'root', text='Sample Tree', image=self.tree_icon, drawcross='allways', data='/') tree_Instance.opentree(self.node, recurse=0) buttonFrame = tk.Frame(master) buttonFrame.pack(side=tk.BOTTOM) self.creat_Nodes_Button = tk.Button(buttonFrame, text='Create Nodes', command=self.create_nodes, relief=tk.GROOVE) self.creat_Nodes_Button.pack() def close_node(self, node): self.tree_Instance.itemconfigure(node) def open_node(self, node): path = self.tree_Instance.opentree(node, recurse=1) def create_nodes(self): parent_0 = self.tree_Instance.insert(0, 0, text='1st Parent', image=self.parent_icon, drawcross='allways') child_0_0 = self.tree_Instance.insert(0, parent_0, text='1st Child', image=self.child_icon, drawcross='allways') child_0_1 = self.tree_Instance.insert(1, parent_0, text='2nd Child', image=self.child_icon, drawcross='allways') child_0_2 = self.tree_Instance.insert(2, parent_0, text='3rd Child', image=self.child_icon, drawcross='allways') parent_1 = self.tree_Instance.insert(1, 0, text='2nd Parent', image=self.parent_icon, drawcross='allways') child_1_0 = self.tree_Instance.insert(0, parent_1, text='1st Child', image=self.child_icon, drawcross='allways') child_1_1 = self.tree_Instance.insert(2, parent_1, text='2nd Child', image=self.child_icon, drawcross='allways') child_1_2 = self.tree_Instance.insert(3, parent_1, text='3rd Child', image=self.child_icon, drawcross='allways') widget_List = [ parent_0, child_0_0, child_0_1, child_0_2, parent_1, child_1_0, child_1_1, child_1_2, ] for w in widget_List: print self.tree_Instance.index(w) print 'But I cannot seem to "find" focus. : ) Focus = ' + str(self.tree_Instance.focus()) def test(): r = tk.Tk() t = DirTree(r, bg='white', selectbackground='blue4', selectforeground='white', deltax=60, deltay=45, width=50) t.pack(fill='both', expand=1) r.mainloop() if __name__== '__main__': test() ############################################################## gilcneth at earthlink.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050919/3a2a82a2/attachment.htm From monuindia at gmail.com Tue Sep 20 06:41:19 2005 From: monuindia at gmail.com (Monu Agrawal) Date: Tue, 20 Sep 2005 10:11:19 +0530 Subject: [Tkinter-discuss] pop up menu down Message-ID: Hi, I have a pop up menu used to pop at right click, but the problem is it doesn't go away until I click on one of it's button. I want it to be disappeared or destroyed when I click anywhere else. Can anyone tell me what I am missing? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050920/a198153a/attachment.htm From stewart.midwinter at gmail.com Tue Sep 20 07:33:15 2005 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Mon, 19 Sep 2005 23:33:15 -0600 Subject: [Tkinter-discuss] pop up menu down In-Reply-To: References: Message-ID: this might not be what you want, but you could include a menu-item "Close Menu" in your pop-up menu, which would destroy (close) the pop- up menu... S On Sep 19, 2005, at 22:41, Monu Agrawal wrote: > Hi, > I have a pop up menu used to pop at right click, but the problem is > it doesn't go away until I click on one of it's button. I want it > to be disappeared or destroyed when I click anywhere else. Can > anyone tell me what I am missing? > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > From mfranklin1 at gatwick.westerngeco.slb.com Tue Sep 20 09:58:03 2005 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Tue, 20 Sep 2005 08:58:03 +0100 Subject: [Tkinter-discuss] pop up menu down In-Reply-To: References: Message-ID: Stewart Midwinter wrote: > this might not be what you want, but you could include a menu-item > "Close Menu" in your pop-up menu, which would destroy (close) the pop- > up menu... > > S > > > > On Sep 19, 2005, at 22:41, Monu Agrawal wrote: > > >>Hi, >>I have a pop up menu used to pop at right click, but the problem is >>it doesn't go away until I click on one of it's button. I want it >>to be disappeared or destroyed when I click anywhere else. Can >>anyone tell me what I am missing? >>_______________________________________________ >>Tkinter-discuss mailing list >>Tkinter-discuss at python.org >>http://mail.python.org/mailman/listinfo/tkinter-discuss >> Strange on my box (fedora core 4) is doesn't stay poped up so if I release mouse button 3 it disappears. Perhaps it is a platorm issue? my popup code is below:- class PopupMenu: def __init__(self, parent): self.parent = parent self.menu=Menu(None,tearoff=0) def __call__(self, event): self.menu.tk_popup(event.x_root ,event.y_root) def add_separator(self): self.menu.add_separator() def add(self, text, command): self.menu.add_command(label=text, command=command) add_command = add and when I use it :- fileMenu = PopupMenu(self) fileMenu.add_command("Create New File", command=self.createFile) self.fileList.body_bind("<3>", fileMenu) HTH Martin From fadeev.climber at hotmail.com Fri Sep 30 23:34:16 2005 From: fadeev.climber at hotmail.com (evgeny fadeev) Date: Fri, 30 Sep 2005 14:34:16 -0700 Subject: [Tkinter-discuss] winfo_width problem Message-ID: Hi, i am trying to use winfo_width to determine widget's size and it always returns me 1 regardless of wheter widget is packed/gridded or not. in native Tcl/Tk winfo width .widget works fine, i.e. returns actual width in pixels direct tk call from python tk.call('winfo','width',widget._w) still returns 1 i guess it points to some bug in tkinter ...... what do you think? Thanks. Evgeny. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From gustavo-listas at overstep.com.br Fri Sep 30 23:42:06 2005 From: gustavo-listas at overstep.com.br (Gustavo Henrique Cervi) Date: Fri, 30 Sep 2005 18:42:06 -0300 Subject: [Tkinter-discuss] winfo_width problem In-Reply-To: References: Message-ID: <433DB12E.8030307@overstep.com.br> Try using "winfo_reqheight(), winfo_reqwidth()" ... winfo_reqheight(), winfo_reqwidth(). Return the "natural" height (width) for self. The natural size is the minimal size needed to display the widget's contents, including padding, borders, etc. This size is calculated by the widget itself, based on the given options. The actual widget size is then determined by the widget's geometry manager, based on this value, the size of the widget's master, and the options given to the geometry manager. []'s -Gustavo evgeny fadeev wrote: >Hi, >i am trying to use winfo_width to determine widget's size >and it always returns me 1 regardless of wheter widget is packed/gridded or >not. > >in native Tcl/Tk >winfo width .widget >works fine, i.e. returns actual width in pixels > >direct tk call from python tk.call('winfo','width',widget._w) still returns >1 > >i guess it points to some bug in tkinter ...... what do you think? > >Thanks. >Evgeny. > >_________________________________________________________________ >Express yourself instantly with MSN Messenger! Download today - it's FREE! >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > >_______________________________________________ >Tkinter-discuss mailing list >Tkinter-discuss at python.org >http://mail.python.org/mailman/listinfo/tkinter-discuss > > >