From stewart.midwinter at gmail.com Sat Dec 11 21:19:28 2004 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Sat Dec 11 21:19:31 2004 Subject: [Tkinter-discuss] TkTable problem Message-ID: Anyone have any success getting the sample table.py script, a demo for TkTable, to run properly? I am able to install TkTable, and run the script, but as soon as I select, i.e. click on, a cell, the thing throws an exception. Apparently the selection process selects an entire row instead of a cell, so a routine expecting a string,e.g. '2,1' instead gets a tuple, e.g ('2,0', '2,1', '2,2). I just can't quite figure out where the error is occurring. As an alternative, does anyone have a small sample showing use of a table widget, including editing cell contents and capturing the changes? thanks, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From mfranklin1 at gatwick.westerngeco.slb.com Mon Dec 13 12:33:50 2004 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Mon Dec 13 12:38:07 2004 Subject: [Tkinter-discuss] Re: TkTable problem References: Message-ID: On Sat, 11 Dec 2004 13:19:28 -0700, Stewart Midwinter wrote: > Anyone have any success getting the sample table.py script, a demo for > TkTable, to run properly? I am able to install TkTable, and run the > script, but as soon as I select, i.e. click on, a cell, the thing > throws an exception. Apparently the selection process selects an > entire row instead of a cell, so a routine expecting a string,e.g. > '2,1' instead gets a tuple, e.g ('2,0', '2,1', '2,2). I just can't > quite figure out where the error is occurring. > > As an alternative, does anyone have a small sample showing use of a > table widget, including editing cell contents and capturing the > changes? > > thanks, Stewart, Bit more information from you... platform, versions etc. I have used TkTable - I put it up in the Wiki. but not 'in production' perhaps a small example + exception would also help. Cheers Martin From mfranklin1 at gatwick.westerngeco.slb.com Mon Dec 13 17:37:48 2004 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Mon Dec 13 17:38:08 2004 Subject: [Tkinter-discuss] Re: TkTable problem References: Message-ID: On Mon, 13 Dec 2004 11:33:50 -0000, Martin Franklin wrote: > On Sat, 11 Dec 2004 13:19:28 -0700, Stewart Midwinter > wrote: > >> Anyone have any success getting the sample table.py script, a demo for >> TkTable, to run properly? I am able to install TkTable, and run the >> script, but as soon as I select, i.e. click on, a cell, the thing >> throws an exception. Apparently the selection process selects an >> entire row instead of a cell, so a routine expecting a string,e.g. >> '2,1' instead gets a tuple, e.g ('2,0', '2,1', '2,2). I just can't >> quite figure out where the error is occurring. >> >> As an alternative, does anyone have a small sample showing use of a >> table widget, including editing cell contents and capturing the >> changes? >> >> thanks, > > > Stewart, > > Bit more information from you... platform, versions etc. > I have used TkTable - I put it up in the Wiki. but not 'in production' > perhaps a small example + exception would also help. > > > Cheers > Martin Scrath that I just ran the tktable.py file in the demos directory in the 'fresh' Tktable 2.9 downloaded from SF and It crashes just like you say... however when I use a different TkTable.py wrapper (one I've had laying around for a while) it doesn't I can no longer find the original of the wrapper I have (I googled for 20 minutes at least!) but I could send you a copy for comparison with the 'standard' if you wish. Cheers, Martin. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ From asu at dyaptive.com Mon Dec 13 19:25:12 2004 From: asu at dyaptive.com (Albert Su) Date: Mon Dec 13 19:25:16 2004 Subject: [Tkinter-discuss] Screen Resolution for tkinter Message-ID: <41BDDE88.5020508@dyaptive.com> hi everyone, I am currently writing a GUI that is meant to run on different window managers with different resolutions. How can I scale down the size of my app when running on lower resolutions? I managed to find out the resolution of the screen I'm running on through winfo calls, but I can't specify the width/height of any frames/root frames/top levels I create. Any winfo_width() or winfo_height() calls to any frame gives me a 1, 1. Also, can I specify button sizes and the font size used for it? I am currently using grid() as the way of adding widgets into a frame. Thanks for any help, Albert From jepler at unpythonic.net Tue Dec 14 05:51:24 2004 From: jepler at unpythonic.net (jepler@unpythonic.net) Date: Tue Dec 14 05:50:51 2004 Subject: [Tkinter-discuss] Screen Resolution for tkinter In-Reply-To: <41BDDE88.5020508@dyaptive.com> References: <41BDDE88.5020508@dyaptive.com> Message-ID: <20041214045122.GA32165@unpythonic.net> winfo_reqwidth and winfo_reqheight methods return the space *requested* by a widget. For widgets that contain widgets, a call to update_idletasks is required for all widgets to decide their requested size. wm_minsize, wm_maxsize, and wm_geometry control the range of sizes the user may select, and query/set the actual size of the window. These sizes all exclude the height of the menubar (if any) and window decorations. Many screen distances can be given in mm, which is combined with the OS-reported DPI values. Likewise, fonts may be requested in points which are related to the OS-reported screen resolution, not to pixel sizes. Many widgets have width= and height= configuration parameters. When widgets contain text, these are in units of average character widths and vertical line spaces. When they contain images, the units are pixels. The best way to consistently set font sizes is to do nothing in your application. Tk is intended to find the system defaults and follow them. On Windows, these settings come from the "display properties" dialog, and on Unix these settings come from the X resources database. The second best is to use the "option" command (not sure of the Tkinter method name) to add entries to the option database before creating any widgets. There must be documents somewhere that describe this, I would get the details wrong if I tried to do it here. The worst way is to specify font= on each individual widget. This is all documented in the Tk manpages, and even if it's painful to wade through the Tcl syntax it's a valuable source of information. For a few widgets the information in the Tk manpages have been transcribed to the wiki. Links to online versions of the Tk manpages are also on the wiki. Be sure to take a look. 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/20041213/0218f473/attachment.pgp From stewart.midwinter at gmail.com Tue Dec 14 16:01:04 2004 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Tue Dec 14 16:01:07 2004 Subject: [Tkinter-discuss] getting data out of a Bwidget Password Dialog Message-ID: I've been looking through the Bwiddgets, and adding some documentation to the Tkinter wiki. I'm struggling with the password dialog. I can draw one, but I can't get the data out of it. I've looked into the .tcl for clues, and it appears that the class may return a list containing the login and password, but I can't figure out how to get that data! Any clues? Here's what I have so far: from Tkinter import * from bwidget import * t = Tk() t.title('password') global p def printMe(s): print s print p.get() p.destroy() b = Button(t, relief=LINK, text="Quit", command=t.destroy) b.pack() p = PasswordDialog(t, type="okcancel", labelwidth=10, command=lambda s='have pwd': printMe(s)) t.mainloop() thanks, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From stewart.midwinter at gmail.com Fri Dec 17 19:00:32 2004 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Fri Dec 17 19:00:35 2004 Subject: [Tkinter-discuss] Tile themeing engine Message-ID: Has anyone got the Tile themeing engine (from http://tktable.sf.net) working with Tkinter? If so, how'd you do it? Instructions on the site don't give much clue for Python users. thanks, -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From klappnase at web.de Fri Dec 17 19:41:24 2004 From: klappnase at web.de (Michael Lange) Date: Fri Dec 17 19:40:25 2004 Subject: [Tkinter-discuss] Tile themeing engine In-Reply-To: References: Message-ID: <20041217194124.1b748cf1.klappnase@web.de> On Fri, 17 Dec 2004 11:00:32 -0700 Stewart Midwinter wrote: > Has anyone got the Tile themeing engine (from http://tktable.sf.net) > working with Tkinter? If so, how'd you do it? Instructions on the > site don't give much clue for Python users. > > thanks, > -- Hi Stewart, have a look at the UsingTile page of the wiki (http://tkinter.unpythonic.net/wiki/UsingTile); the example posted there worked perfectly (at least for me): from Tkinter import * root = Tk() root.tk.call('package', 'require', 'tile') root.tk.call('namespace', 'import', '-force', 'ttk::*') root.tk.call('tile::setTheme', 'alt') v = IntVar() Radiobutton(root, text="Hello", variable=v, value=1).pack() Radiobutton(root, text="There", variable=v, value=2).pack() root.mainloop() Regards Michael From arthurc at rogers.com Tue Dec 21 22:57:07 2004 From: arthurc at rogers.com (Arthur C) Date: Tue Dec 21 22:57:10 2004 Subject: [Tkinter-discuss] pybwidget newbie questions re: Tree Message-ID: <20041221215707.9550.qmail@web88211.mail.re2.yahoo.com> I've been slowly getting up to speed on the BWidget package and since I'm using Python, the pybwidget wrapper. So far so good with some nuances encountered: - the .xpm files in the images directory don't get auto installed. There was one demo that gack'd without them. I just copied them in but modifying the setup.py file to include them is likely sane no? - I've gotten used to Tkinter's definition of constants such as NORMAL (which is merely a string 'normal') for certain argument values. When adding nodes off the root to a Tree, the Tcl code uses the name root. I was expecting to do something like: t = Tree( ... ) t.insert( END, ROOT, text = 'Something' ) Okay, so not ROOT constant exists. So, what do I use? I'm guess 'root'. Changed the code to: t.insert( END, 'root', text = 'Something' ) Now, I want to delete all the nodes in the tree. So I want to do something like: t.delete( t.nodes( 'root' ) ) However, doing so gives the following error: TclError: wrong # args: should be "Tree::nodes path node ?first? ?last?" Any idea what the issue is? FYI, I'm using pybwidget-0.1.1_1.7.0 Thanks for any clues offered. Regards, Arthur From stewart.midwinter at gmail.com Wed Dec 22 16:04:37 2004 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Wed Dec 22 16:04:40 2004 Subject: [Tkinter-discuss] pybwidget newbie questions re: Tree In-Reply-To: <20041221215707.9550.qmail@web88211.mail.re2.yahoo.com> References: <20041221215707.9550.qmail@web88211.mail.re2.yahoo.com> Message-ID: Arthur: you can't extend the idea of NORMAL to ROOT. NORMAL is a variable with content 'normal', but root is an object. I'm guessing that your tree node deletion fails because you have root in quotes - it's not a string. But I haven't worked with that module yet. The other thing might be to look in pybwidget.py, since there are some clues in there. And lastly, since bwidget are TCL widgets, you may want to look into the tcl code. I know, it's kind of strange if you are used to python... After you get it all working, please consider visiting the wiki at http://tkinter.unpy.net/wiki/ and add some text and a screen print for the bwidget tree widget. thanks S On Tue, 21 Dec 2004 16:57:07 -0500 (EST), Arthur C wrote: > - I've gotten used to Tkinter's definition of > constants such as NORMAL (which is merely a string > 'normal') for certain argument values. When adding > nodes off the root to a Tree, the Tcl code uses the > name root. I was expecting to do something like: > > t = Tree( ... ) > t.insert( END, ROOT, text = 'Something' ) > > Okay, so not ROOT constant exists. So, what do I use? > I'm guess 'root'. Changed the code to: > > t.insert( END, 'root', text = 'Something' ) > > Now, I want to delete all the nodes in the tree. So I > want to do something like: > > t.delete( t.nodes( 'root' ) ) > > However, doing so gives the following error: > > TclError: wrong # args: should be "Tree::nodes path > node ?first? ?last?" > > Any idea what the issue is? FYI, I'm using > pybwidget-0.1.1_1.7.0 > > Thanks for any clues offered. > > Regards, > Arthur > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss@python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com From arthurc at rogers.com Wed Dec 22 16:33:00 2004 From: arthurc at rogers.com (Arthur C) Date: Wed Dec 22 16:33:03 2004 Subject: [Tkinter-discuss] pybwidget newbie questions re: Tree In-Reply-To: Message-ID: <20041222153300.42792.qmail@web88208.mail.re2.yahoo.com> Figured out my problem. There is a bug in the pybwidget Tree::nodes() member. The correct code should be: def nodes(self, node, *args): return self.tk.call(self._w, "nodes", node, *args) The "node" argument was not being passed into the call function. BTW, I did define a constant ROOT ROOT='root' and it works as expected. I don't follow your comment that is different than NORMAL. In Tcl, you'd do: Tree .tree .tree insert end root bob -text "Bob" .tree nodes root In Python, I'm doing: ROOT='root' tree = Tree( ... ) tree.insert( END, ROOT, 'bob', text = 'Bob' ) tree.nodes( ROOT ) Looks like I'll modify the pybwidget package to fit my needs. I'll submit any changes to the author for consideration. A --- Stewart Midwinter wrote: > Arthur: > > you can't extend the idea of NORMAL to ROOT. NORMAL > is a variable > with content 'normal', but root is an object. I'm > guessing that your > tree node deletion fails because you have root in > quotes - it's not a > string. But I haven't worked with that module yet. > > The other thing might be to look in pybwidget.py, > since there are some > clues in there. And lastly, since bwidget are TCL > widgets, you may > want to look into the tcl code. I know, it's kind > of strange if you > are used to python... > > After you get it all working, please consider > visiting the wiki at > http://tkinter.unpy.net/wiki/ and add some text and > a screen print for > the bwidget tree widget. > > thanks > S > > > On Tue, 21 Dec 2004 16:57:07 -0500 (EST), Arthur C > wrote: > > - I've gotten used to Tkinter's definition of > > constants such as NORMAL (which is merely a string > > 'normal') for certain argument values. When > adding > > nodes off the root to a Tree, the Tcl code uses > the > > name root. I was expecting to do something like: > > > > t = Tree( ... ) > > t.insert( END, ROOT, text = 'Something' ) > > > > Okay, so not ROOT constant exists. So, what do I > use? > > I'm guess 'root'. Changed the code to: > > > > t.insert( END, 'root', text = 'Something' ) > > > > Now, I want to delete all the nodes in the tree. > So I > > want to do something like: > > > > t.delete( t.nodes( 'root' ) ) > > > > However, doing so gives the following error: > > > > TclError: wrong # args: should be "Tree::nodes > path > > node ?first? ?last?" > > > > Any idea what the issue is? FYI, I'm using > > pybwidget-0.1.1_1.7.0 > > > > Thanks for any clues offered. > > > > Regards, > > Arthur > > _______________________________________________ > > Tkinter-discuss mailing list > > Tkinter-discuss@python.org > > > http://mail.python.org/mailman/listinfo/tkinter-discuss > > > > > -- > Stewart Midwinter > stewart@midwinter.ca > stewart.midwinter@gmail.com > From jepler at unpythonic.net Fri Dec 24 17:39:14 2004 From: jepler at unpythonic.net (Jeff Epler) Date: Fri Dec 24 17:39:17 2004 Subject: [Tkinter-discuss] [arthurc@rogers.com: pybwidget 0.1.1_1.7.0 fixes] Message-ID: <20041224163914.GC17166@unpythonic.net> Skipped content of type multipart/mixed-------------- 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/20041224/e0ebfb88/attachment.pgp From Mark.English at liffe.com Thu Dec 30 13:06:02 2004 From: Mark.English at liffe.com (Mark English) Date: Thu Dec 30 13:06:07 2004 Subject: [Tkinter-discuss] (no subject) Message-ID: <40E605146701DE428FAF21286A97D3091744FF@wphexa02.corp.lh.int> I had this problem and hacked together what looked like fixes as a patch. https://sourceforge.net/tracker/?func=detail&aid=1088468&group_id=11464& atid=311464 The two changes I threw into tktable.py were to do with the call to tk.call returning a tuple of strings rather than the expected string delimited by spaces in curselection: Changed line 144 From return self._getCells(self.tk.call(self._w, 'curselection')) To return self._getCells(' '.join(self.tk.call(self._w, 'curselection'))) and to handle getting index returning an int: Changed line 173 From return self._getCells(self.tk.call(self._w, 'index', index, rc))[0][0] To return self.tk.call(self._w, 'index', index, rc) Don't know if these changes are correct in all situations but they got the demo working without errors. Cheers, Mark ----------------------------------------------------------------------- The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary companies. ----------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20041230/7bf5bf64/attachment.html From stewart.midwinter at gmail.com Thu Dec 30 22:50:10 2004 From: stewart.midwinter at gmail.com (Stewart Midwinter) Date: Thu Dec 30 22:50:20 2004 Subject: [Tkinter-discuss] re: tktable In-Reply-To: References: <40E605146701DE428FAF21286A97D3091744FF@wphexa02.corp.lh.int> Message-ID: thanks Mark, I've patched up my tktable.py. Now I'm trying to get it running under Windows without success. Are you by any chance running it under Windows yourself? cheers S On Thu, 30 Dec 2004 12:06:02 -0000, Mark English wrote: > > I had this problem and hacked together what looked like fixes as a patch. -- Stewart Midwinter stewart@midwinter.ca stewart.midwinter@gmail.com