From timmortimer at d2.net.au Mon Feb 4 03:49:48 2008 From: timmortimer at d2.net.au (Tim Mortimer) Date: Mon, 04 Feb 2008 13:19:48 +1030 Subject: [Tkinter-discuss] getting started - canvas - "multislider" / function editor In-Reply-To: <47A67906.3010008@d2.net.au> References: <47A67906.3010008@d2.net.au> Message-ID: <47A67D4C.40705@d2.net.au> I guess the only thing to add is that i would like to recieve out an [index,value] for each slider, but assumedly this simply needs to be updated for the slider currently being adjusted eg [0,1.] => first slider, all the way up [0,0.] => first slider, all the way down go & tweak the third slider... [2,.5678] => etc etc.... & the value is simply written to the csound function table / "generic array" accordingly... when hosting python in csound only a fairly limited number of return values can be passed... so linking the display "by direct association" to the table data is probably not possible. & this shouldn't be a problem, as long as both the array & the display are initialsised to the same relative values.. (& keeping the value restricted to 0. <= val <= 1. should allow for a range of applications & rescaling of the output ...) Tim Mortimer wrote: > > Hello, > > I'm new to GUI programming, & self taught at Python which is the only > "real world" programming language i know - I picked it up last year to > try and work with Csound to make "algorithmically assisted" > compositions, & now hopefully through tkinter some basic interfacing > options. (Csound is accesible via python through an api, &/or vice > versa...) > > What i want to do is use the Canvas object (assumedly with a series of > rectangles on it, let's say 64 or 128 or 256 being the likely number > of candidates depending on the editing task..) so that i can > graphically edit the contents of function tables in csound. > > The rectangles on the canvas will simply be lenghtened or shortened in > the vertical direction, & all sit one next to the other (so it looks > like the interface from an EQ on a stereo, or a "skyline" type > appearance...maybe coloured rectangles will identify every 8 or 10 or > 12 index values or something... > > But i've got no experience of this, have run some very simple examples > illustrating some basic tkinter behaviour ("hello world" that type of > thing...) - but surely there is something around showing some simple > canvas operations so i can start hacking it & getting this started, & > learning something about tkinter in the process?? > > Does anyone know or have an implementation of this type of thing in > tkinter, or alternately some simple & pedagogically useful examples of > basic canvas & user interfacing types of operations? (resizing boxes > on a canvas with the mouse & reporting values being the general idea...) > > many thanks > > Tim > From timmortimer at d2.net.au Mon Feb 4 03:31:34 2008 From: timmortimer at d2.net.au (Tim Mortimer) Date: Mon, 04 Feb 2008 13:01:34 +1030 Subject: [Tkinter-discuss] getting started - canvas - "multislider" / function editor Message-ID: <47A67906.3010008@d2.net.au> Hello, I'm new to GUI programming, & self taught at Python which is the only "real world" programming language i know - I picked it up last year to try and work with Csound to make "algorithmically assisted" compositions, & now hopefully through tkinter some basic interfacing options. (Csound is accesible via python through an api, &/or vice versa...) What i want to do is use the Canvas object (assumedly with a series of rectangles on it, let's say 64 or 128 or 256 being the likely number of candidates depending on the editing task..) so that i can graphically edit the contents of function tables in csound. The rectangles on the canvas will simply be lenghtened or shortened in the vertical direction, & all sit one next to the other (so it looks like the interface from an EQ on a stereo, or a "skyline" type appearance...maybe coloured rectangles will identify every 8 or 10 or 12 index values or something... But i've got no experience of this, have run some very simple examples illustrating some basic tkinter behaviour ("hello world" that type of thing...) - but surely there is something around showing some simple canvas operations so i can start hacking it & getting this started, & learning something about tkinter in the process?? Does anyone know or have an implementation of this type of thing in tkinter, or alternately some simple & pedagogically useful examples of basic canvas & user interfacing types of operations? (resizing boxes on a canvas with the mouse & reporting values being the general idea...) many thanks Tim From Hunter0000 at gmail.com Fri Feb 8 16:28:42 2008 From: Hunter0000 at gmail.com (Hunter0000) Date: Fri, 8 Feb 2008 07:28:42 -0800 (PST) Subject: [Tkinter-discuss] tk_focusNext and tkfocusPrev Message-ID: <15356581.post@talk.nabble.com> Hello, Can anyone give an example of how to use these two methods? I've tried using them is various ways (the end goal being to replicate forward and reverse tabbing) but it always comes out saying either it doesn't exist or the object it returns in unsubscriptable. Any of the documentation I can find about most of the focus-related methods seems spotty at best, and in this case nonexistent, so an actual working example would be great to work from. Mike -- View this message in context: http://www.nabble.com/tk_focusNext-and-tkfocusPrev-tp15356581p15356581.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From bob at passcal.nmt.edu Fri Feb 8 20:30:10 2008 From: bob at passcal.nmt.edu (Bob Greschke) Date: Fri, 8 Feb 2008 12:30:10 -0700 Subject: [Tkinter-discuss] Color blindness Message-ID: <72246CFD-A756-4265-A633-BA7D6C741B3B@passcal.nmt.edu> I use colors quite a bit in my programs: The black indicator boxes across the top can be any of the colors of the colored buttons on the left side of the form: http://www.passcal.nmt.edu/~bob/unlinked/images/root.tiff If the text is colored it is always on a black background. If the text background is white then the foreground is always black: http://www.passcal.nmt.edu/~bob/unlinked/images/et.tiff http://www.passcal.nmt.edu/~bob/unlinked/images/text.tiff http://www.passcal.nmt.edu/~bob/unlinked/images/plot.tiff Probably wouldn't try to remap all of these colors (there's 20 possibilities): http://www.passcal.nmt.edu/~bob/unlinked/images/batt.tiff http://www.passcal.nmt.edu/~bob/unlinked/images/green.jpg I got to thinking about what should be done to make things better for color blind people. I poked around a bit online, but the range of info went from mathematical formulas to come up with the right colors to use to some guys that were color blind saying don't bother doing anything. For my stuff it would be pretty simple to, for example, change all red things to yellow, or all blue things to magenta, or whatever, but I can't find any info on exactly what would be good to do (I'm talking major, big picture, catch the greatest number of people stuff while knowing the level of color blindness is infinitely variable). I just have a 'Clr' dictionary at the beginning of each program with entries like "C":"cyan", "R":"red", etc. which could be remapped in a jiffy for each type of user-selectable color blindness (the 2 or 3 major ones). Anybody know of a good source of info, or does this not even make sense to worry about? Thanks! Bob From rowen at cesmail.net Mon Feb 11 20:22:44 2008 From: rowen at cesmail.net (Russell E. Owen) Date: Mon, 11 Feb 2008 11:22:44 -0800 Subject: [Tkinter-discuss] Color blindness References: <72246CFD-A756-4265-A633-BA7D6C741B3B@passcal.nmt.edu> Message-ID: In article <72246CFD-A756-4265-A633-BA7D6C741B3B at passcal.nmt.edu>, Bob Greschke wrote: > I use colors quite a bit in my programs: ...> I got to thinking about what should be done to make things better for > color blind people.... > > Anybody know of a good source of info, or does this not even make > sense to worry about? I write an application that uses a 4 or 5 different colors to indicate various important conditions. There are so many varieties of color blindness that I decided to make the colors user-settable. That way each user can set up a palette that he or she can easily differentiate (even if it's only different shades of gray). I use a few other colors as "eye candy" and chose to not make those user-settable. No complaints so far (except mild griping from a few folks who like to tweak everything). -- Russell From jek-gmane at kleckner.net Mon Feb 11 21:51:59 2008 From: jek-gmane at kleckner.net (Jim Kleckner) Date: Mon, 11 Feb 2008 12:51:59 -0800 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? Message-ID: Any pointers to what it takes to add/remove widgets from a running application? Thanks. From bialix at ukr.net Mon Feb 11 23:57:33 2008 From: bialix at ukr.net (Alexander Belchenko) Date: Tue, 12 Feb 2008 00:57:33 +0200 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: References: Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jim Kleckner ?????: | Any pointers to what it takes to add/remove widgets | from a running application? Something like this maybe? from Tkinter import * root = Tk() x = Label(root, text='Hello') x.pack() Button(root, text='Hide', command=x.pack_forget).pack() root.mainloop() -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHsNLdzYr338mxwCURAlBBAJ4tY5IvAhjnZyEDgdK/M2lEIAdAtACffoiO +6ofoqKvxsbrXpnd69wV018= =C4JW -----END PGP SIGNATURE----- From bob at passcal.nmt.edu Tue Feb 12 17:04:19 2008 From: bob at passcal.nmt.edu (Bob Greschke) Date: Tue, 12 Feb 2008 09:04:19 -0700 Subject: [Tkinter-discuss] Color blindness In-Reply-To: References: <72246CFD-A756-4265-A633-BA7D6C741B3B@passcal.nmt.edu> Message-ID: What!!?? Let the USER have freedom of choice!? You gotta be...hmmm...hey...that's not a bad idea! This could keep me busy for weeks. :) Thanks! Bob On Feb 11, 2008, at 12:22, Russell E. Owen wrote: > In article <72246CFD-A756-4265-A633-BA7D6C741B3B at passcal.nmt.edu>, > Bob Greschke wrote: > >> I use colors quite a bit in my programs: > ...> I got to thinking about what should be done to make things better > for >> color blind people.... >> >> Anybody know of a good source of info, or does this not even make >> sense to worry about? > > I write an application that uses a 4 or 5 different colors to indicate > various important conditions. There are so many varieties of color > blindness that I decided to make the colors user-settable. That way > each > user can set up a palette that he or she can easily differentiate > (even > if it's only different shades of gray). > > I use a few other colors as "eye candy" and chose to not make those > user-settable. No complaints so far (except mild griping from a few > folks who like to tweak everything). > > -- Russell > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > From rowen at cesmail.net Tue Feb 12 20:40:06 2008 From: rowen at cesmail.net (Russell E. Owen) Date: Tue, 12 Feb 2008 11:40:06 -0800 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? References: Message-ID: In article , Alexander Belchenko wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jim Kleckner ??????????: > | Any pointers to what it takes to add/remove widgets > | from a running application? > > Something like this maybe? > > from Tkinter import * > root = Tk() > x = Label(root, text='Hello') > x.pack() > Button(root, text='Hide', command=x.pack_forget).pack() > root.mainloop() Or if you use the gridder you can remove things temporary and restore them again easily: x.grid(row=0....) x.grid_remove() # to temporarily remove x.grid() # to restore using the original grid settings x.grid_forget() # to remove permanently (remove is not supported by the packer) -- Russell From peter.milliken at gmail.com Wed Feb 13 22:24:44 2008 From: peter.milliken at gmail.com (Peter Milliken) Date: Thu, 14 Feb 2008 08:24:44 +1100 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: References: Message-ID: <791153ba0802131324l1f47e579t224a4c4dc2246de2@mail.gmail.com> In applications that modify the interface on the fly, I keep track of all widgets (arrays etc) and create functions that recalculate and rebuild the layout completely - this way you can add and/or delete components on the fly and just call a def that reconstitutes the entire display. I use the grid layout manager exclusively, so traversing arrays of widgets and calculating row/column components just "fits" together. I use Pmw - once you get the hang of how it is structured and start creating your own (mega)widgets the paradigm of re-building the widget on the fly comes naturally. Peter On Feb 12, 2008 7:51 AM, Jim Kleckner wrote: > Any pointers to what it takes to add/remove widgets > from a running application? > > Thanks. > > _______________________________________________ > 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/20080214/3e41d538/attachment.htm From mfranklin1 at gatwick.westerngeco.slb.com Thu Feb 14 08:41:21 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Thu, 14 Feb 2008 07:41:21 +0000 Subject: [Tkinter-discuss] tk_focusNext and tkfocusPrev In-Reply-To: <15356581.post@talk.nabble.com> References: <15356581.post@talk.nabble.com> Message-ID: <47B3F0A1.5080206@gatwick.westerngeco.slb.com> Hunter0000 wrote: > Hello, > > Can anyone give an example of how to use these two methods? I've tried using > them is various ways (the end goal being to replicate forward and reverse > tabbing) but it always comes out saying either it doesn't exist or the > object it returns in unsubscriptable. Any of the documentation I can find > about most of the focus-related methods seems spotty at best, and in this > case nonexistent, so an actual working example would be great to work from. > > Mike No idea myself, but this seems a decent explanation:- http://docs.huihoo.com/tkinter/tkmanual/focusNext.html Found with the power of Google :) - its a copy of the Tk man page in fact.... Now as to the real problem... tk_focusNext deal in windows (whole windows not single widgets) so... I think you want to use focus_get and focus_set like so:- from Tkinter import * root = Tk() root.title("Focusing is HARD!!!") e1 = Entry(root) e1.focus_set() e1.pack() e2 = Entry(root) e2.pack() e3 = Entry(root) e3.pack() allE = [e1, e2, e3] activeE = 0 def move_focus(): global activeE activeE = activeE + 1 allE[activeE].focus_set() b = Button(root, command=move_focus) b.pack() root.mainloop() ### BUG fixing and Exception handling left to the reader! ### (IndexError left in as a nice surprise) ### the use of global is intentional even though I hate it Cheers, Martin. -- signature file not found, must be something I ate From mfranklin1 at gatwick.westerngeco.slb.com Thu Feb 14 08:29:02 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Thu, 14 Feb 2008 07:29:02 +0000 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: References: Message-ID: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> Russell E. Owen wrote: > In article , > Alexander Belchenko wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Jim Kleckner ??????????: >> | Any pointers to what it takes to add/remove widgets >> | from a running application? >> >> Something like this maybe? >> >> from Tkinter import * >> root = Tk() >> x = Label(root, text='Hello') >> x.pack() >> Button(root, text='Hide', command=x.pack_forget).pack() >> root.mainloop() > > Or if you use the gridder you can remove things temporary and restore > them again easily: > x.grid(row=0....) > x.grid_remove() # to temporarily remove > x.grid() # to restore using the original grid settings > x.grid_forget() # to remove permanently > (remove is not supported by the packer) > pack_forget does not erm remove either ;) from Tkinter import * root = Tk() root.title("Pack is BEST!!!") l = Label(root, text="Pack is simply the best") l.pack() def forget(): l.pack_forget() def remember(): l.pack() b = Button(root, text="Forget about it", command=forget) b.pack() b = Button(root, text="Wait, I still need you", command=remember) b.pack() root.mainloop() BUT... the remember function packs the label widget in it's new packing order, so it is packed after the two buttons, as far as I know the only way to 'remember' its pack position is to put it inside a Frame widget (and leave the Frame where it stands) - at least thats how I do it To the OP I guess you've seen how easy this is with Tk(inter) :) Cheers, Martin. From mfranklin1 at gatwick.westerngeco.slb.com Thu Feb 14 08:48:58 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Thu, 14 Feb 2008 07:48:58 +0000 Subject: [Tkinter-discuss] getting started - canvas - "multislider" / function editor In-Reply-To: <47A67906.3010008@d2.net.au> References: <47A67906.3010008@d2.net.au> Message-ID: <47B3F26A.1030807@gatwick.westerngeco.slb.com> Tim Mortimer wrote: > Hello, > > I'm new to GUI programming, & self taught at Python which is the only > "real world" programming language i know - I picked it up last year to > try and work with Csound to make "algorithmically assisted" > compositions, & now hopefully through tkinter some basic interfacing > options. (Csound is accesible via python through an api, &/or vice versa...) > > What i want to do is use the Canvas object (assumedly with a series of > rectangles on it, let's say 64 or 128 or 256 being the likely number of > candidates depending on the editing task..) so that i can graphically > edit the contents of function tables in csound. > > The rectangles on the canvas will simply be lenghtened or shortened in > the vertical direction, & all sit one next to the other (so it looks > like the interface from an EQ on a stereo, or a "skyline" type > appearance...maybe coloured rectangles will identify every 8 or 10 or 12 > index values or something... > > But i've got no experience of this, have run some very simple examples > illustrating some basic tkinter behaviour ("hello world" that type of > thing...) - but surely there is something around showing some simple > canvas operations so i can start hacking it & getting this started, & > learning something about tkinter in the process?? > > Does anyone know or have an implementation of this type of thing in > tkinter, or alternately some simple & pedagogically useful examples of > basic canvas & user interfacing types of operations? (resizing boxes on > a canvas with the mouse & reporting values being the general idea...) > > many thanks > > Tim Tim, The is a tk canvas drag items example in the Python source code I think... lemme see Python25/Python-2.5/Demo/tkinter/matt/canvas-moving-w-mouse.py in fact there are a few, so first grab a tar ball of the source code and take a look.... While I like the canvas as much as the next guy, have you thought about using a 'normal' slider widget? (AKA Tkinter.Scale) these can even be put onto a Canvas (via a canvas window item) Cheers, Martin. From timmortimer at d2.net.au Thu Feb 14 13:08:21 2008 From: timmortimer at d2.net.au (Tim Mortimer) Date: Thu, 14 Feb 2008 04:08:21 -0800 (PST) Subject: [Tkinter-discuss] getting started - canvas - "multislider" / function editor In-Reply-To: <47B3F26A.1030807@gatwick.westerngeco.slb.com> References: <47A67906.3010008@d2.net.au> <47B3F26A.1030807@gatwick.westerngeco.slb.com> Message-ID: <15479102.post@talk.nabble.com> Thanks Martin, glad I stayed tuned. I've never built anything from source, & i'm on windows (curses!), so a tar ball is not something i have experiences with as such. None the less, hopefully your reference will lead me to some useful information. I'll explore my installation for examples & failing that, look for some source code. Thanks for checking the trash. Tim. Martin Franklin wrote: > > Tim Mortimer wrote: >> Hello, >> >> I'm new to GUI programming, & self taught at Python which is the only >> "real world" programming language i know - I picked it up last year to >> try and work with Csound to make "algorithmically assisted" >> compositions, & now hopefully through tkinter some basic interfacing >> options. (Csound is accesible via python through an api, &/or vice >> versa...) >> >> What i want to do is use the Canvas object (assumedly with a series of >> rectangles on it, let's say 64 or 128 or 256 being the likely number of >> candidates depending on the editing task..) so that i can graphically >> edit the contents of function tables in csound. >> >> The rectangles on the canvas will simply be lenghtened or shortened in >> the vertical direction, & all sit one next to the other (so it looks >> like the interface from an EQ on a stereo, or a "skyline" type >> appearance...maybe coloured rectangles will identify every 8 or 10 or 12 >> index values or something... >> >> But i've got no experience of this, have run some very simple examples >> illustrating some basic tkinter behaviour ("hello world" that type of >> thing...) - but surely there is something around showing some simple >> canvas operations so i can start hacking it & getting this started, & >> learning something about tkinter in the process?? >> >> Does anyone know or have an implementation of this type of thing in >> tkinter, or alternately some simple & pedagogically useful examples of >> basic canvas & user interfacing types of operations? (resizing boxes on >> a canvas with the mouse & reporting values being the general idea...) >> >> many thanks >> >> Tim > > > Tim, > > The is a tk canvas drag items example in the Python source code I > think... lemme see > > Python25/Python-2.5/Demo/tkinter/matt/canvas-moving-w-mouse.py > > in fact there are a few, so first grab a tar ball of the source code and > take a look.... > > While I like the canvas as much as the next guy, have you thought about > using a 'normal' slider widget? (AKA Tkinter.Scale) these can even be > put onto a Canvas (via a canvas window item) > > > > Cheers, > Martin. > > > > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > ----- ******************* www.phasetransitions.net hermetic music * python * csound * possibly mindless ranting various werk in perpetual delusions of progress.... -- View this message in context: http://www.nabble.com/getting-started---canvas---%22multislider%22---function-editor-tp15261552p15479102.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From mfranklin1 at gatwick.westerngeco.slb.com Thu Feb 14 14:37:54 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Thu, 14 Feb 2008 13:37:54 +0000 Subject: [Tkinter-discuss] getting started - canvas - "multislider" / function editor In-Reply-To: <15479102.post@talk.nabble.com> References: <47A67906.3010008@d2.net.au> <47B3F26A.1030807@gatwick.westerngeco.slb.com> <15479102.post@talk.nabble.com> Message-ID: <47B44432.2040309@gatwick.westerngeco.slb.com> Tim, The source tar-ball is simply the .tgz file available from the python.org download site, WinZIP will be able to open it and extract it to your hard drive, Its has some very useful stuff inside so well worth getting Cheers Martin -- signature file not found, must be something I ate From rowen at cesmail.net Thu Feb 14 21:38:17 2008 From: rowen at cesmail.net (Russell E. Owen) Date: Thu, 14 Feb 2008 12:38:17 -0800 Subject: [Tkinter-discuss] tk_focusNext and tkfocusPrev References: <15356581.post@talk.nabble.com> <47B3F0A1.5080206@gatwick.westerngeco.slb.com> Message-ID: In article <47B3F0A1.5080206 at gatwick.westerngeco.slb.com>, Martin Franklin wrote: > Hunter0000 wrote: > > Hello, > > > > Can anyone give an example of how to use these two methods? I've tried using > > them is various ways (the end goal being to replicate forward and reverse > > tabbing) but it always comes out saying either it doesn't exist or the > > object it returns in unsubscriptable. Any of the documentation I can find > > about most of the focus-related methods seems spotty at best, and in this > > case nonexistent, so an actual working example would be great to work from. > > > > Mike > > No idea myself, but this seems a decent explanation:- > > http://docs.huihoo.com/tkinter/tkmanual/focusNext.html > > > Found with the power of Google :) - its a copy of the Tk man page in > fact.... > > > Now as to the real problem... tk_focusNext deal in windows (whole > windows not single widgets) so... I think you want to use focus_get and > focus_set like so:- Actually a "window" in tk is a widget. A "whole window" is called a "toplevel" in tk. I find it disconcerting, but at least once I got the hang of that I found the tk documentation made a lot more sense. Also focusNext always stays within the current toplevel (according to the manual). But it looks like it only gives you the name of the next widget (window). So I think the solution to the original poster's question is: currWdg.tk_focusNext().focus_set() -- Russell From mfranklin1 at gatwick.westerngeco.slb.com Fri Feb 15 13:00:39 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Fri, 15 Feb 2008 12:00:39 +0000 Subject: [Tkinter-discuss] tk_focusNext and tkfocusPrev In-Reply-To: References: <15356581.post@talk.nabble.com> <47B3F0A1.5080206@gatwick.westerngeco.slb.com> Message-ID: <47B57EE7.4010401@gatwick.westerngeco.slb.com> Russell E. Owen wrote: > In article <47B3F0A1.5080206 at gatwick.westerngeco.slb.com>, > Martin Franklin wrote: > >> Hunter0000 wrote: >>> Hello, >>> >>> Can anyone give an example of how to use these two methods? I've tried using >>> them is various ways (the end goal being to replicate forward and reverse >>> tabbing) but it always comes out saying either it doesn't exist or the >>> object it returns in unsubscriptable. Any of the documentation I can find >>> about most of the focus-related methods seems spotty at best, and in this >>> case nonexistent, so an actual working example would be great to work from. >>> >>> Mike >> No idea myself, but this seems a decent explanation:- >> >> http://docs.huihoo.com/tkinter/tkmanual/focusNext.html >> >> >> Found with the power of Google :) - its a copy of the Tk man page in >> fact.... >> >> >> Now as to the real problem... tk_focusNext deal in windows (whole >> windows not single widgets) so... I think you want to use focus_get and >> focus_set like so:- > > Actually a "window" in tk is a widget. A "whole window" is called a > "toplevel" in tk. I find it disconcerting, but at least once I got the > hang of that I found the tk documentation made a lot more sense. ahh ok, thanks, I guess I never realised this :) > > Also focusNext always stays within the current toplevel (according to > the manual). But it looks like it only gives you the name of the next > widget (window). So I think the solution to the original poster's > question is: > > currWdg.tk_focusNext().focus_set() > Cheers, martin. -- signature file not found, must be something I ate From tracer at pochtamt.ru Fri Feb 15 16:15:39 2008 From: tracer at pochtamt.ru (tracer) Date: Fri, 15 Feb 2008 07:15:39 -0800 (PST) Subject: [Tkinter-discuss] how to use freeze for making executable python file in linux In-Reply-To: References: Message-ID: <15502432.post@talk.nabble.com> I used cx-freeze for linux binaries creation. It also compiles imported modules to dynamic libraries (.so in case of linux), which should be distribulted with compiled binary. http://www.cxtools.net/default.aspx?nav=cxfrlb http://www.cxtools.net/default.aspx?nav=cxfrlb -- View this message in context: http://www.nabble.com/how-to-use-freeze-for-making-executable-python-file-in-linux-tp15199435p15502432.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From tracer at pochtamt.ru Fri Feb 15 17:02:04 2008 From: tracer at pochtamt.ru (tracer) Date: Fri, 15 Feb 2008 08:02:04 -0800 (PST) Subject: [Tkinter-discuss] how to use freeze for making executable python file in linux Message-ID: <15502432.post@talk.nabble.com> I used cx-freeze for linux binaries creation. It also compiles imported modules to dynamic libraries (.so in case of linux), which should be distribulted with compiled binary. http://www.cxtools.net/default.aspx?nav=cxfrlb http://www.cxtools.net/default.aspx?nav=cxfrlb -- View this message in context: http://www.nabble.com/how-to-use-freeze-for-making-executable-python-file-in-linux-tp15199435p15502432.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From jarausch at skynet.be Wed Feb 13 17:30:01 2008 From: jarausch at skynet.be (HWJ) Date: Wed, 13 Feb 2008 08:30:01 -0800 (PST) Subject: [Tkinter-discuss] tk_focusNext and tkfocusPrev In-Reply-To: <15356581.post@talk.nabble.com> References: <15356581.post@talk.nabble.com> Message-ID: <15459854.post@talk.nabble.com> Hunter0000 wrote: > > Hello, > > Can anyone give an example of how to use these two methods? I've tried > using them is various ways (the end goal being to replicate forward and > reverse tabbing) but it always comes out saying either it doesn't exist or > the object it returns in unsubscriptable. Any of the documentation I can > find about most of the focus-related methods seems spotty at best, and in > this case nonexistent, so an actual working example would be great to work > from. > > Mike > The sad news, it's just broken and nobody fixes it (for years). See http://bugs.python.org/issue799428 I've asked on comp.lang.python but didn't get a reply -- View this message in context: http://www.nabble.com/tk_focusNext-and-tkfocusPrev-tp15356581p15459854.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From tyragsdale at gmail.com Wed Feb 13 22:31:17 2008 From: tyragsdale at gmail.com (RagZ) Date: Wed, 13 Feb 2008 13:31:17 -0800 (PST) Subject: [Tkinter-discuss] tkinter askdirectory print Message-ID: <15468402.post@talk.nabble.com> Hello, I'm writing an application with a browse button that opens up the "askdirectory" box to choose a directory. The problem is when the directory is chosen and the ok button is hit it prints the directory to the terminal (if it's open) and I would like it to print it to a ENTRY() that I have. For example: from Tkinter import * from tkFileDialog import askdirectory root = Tk() e1 = Entry(root) #<---------I would like the dir1 to print here def browser(): dir1 = askdirectory(parent=root, title="Select A Folder", mustexist=1) if len(dir1) > 0: print dir1 Button(root, text="Browse", command=browser) root.mainloop() So from this what I'm asking is how can I get dir1 to print to e1 (the entry box)? I'm new to Python and am taking the learn-as-I-code route but can't seem to figure this one out. It might be really easy but I just don't see it. Thanks for any help. - RagZ -- View this message in context: http://www.nabble.com/tkinter-askdirectory-print-tp15468402p15468402.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From klappnase at web.de Sat Feb 16 11:43:04 2008 From: klappnase at web.de (Michael Lange) Date: Sat, 16 Feb 2008 11:43:04 +0100 Subject: [Tkinter-discuss] tk_focusNext and tkfocusPrev In-Reply-To: <15459854.post@talk.nabble.com> References: <15356581.post@talk.nabble.com> <15459854.post@talk.nabble.com> Message-ID: <20080216114304.f4956114.klappnase@web.de> On Wed, 13 Feb 2008 08:30:01 -0800 (PST) HWJ wrote: > > The sad news, it's just broken and nobody fixes it (for years). > See http://bugs.python.org/issue799428 > It works for me (debian etch, Python-2.4.4), so I cannot verify this, but I suspect that setting Tkinter.wantobjects to False might fix it, at least from what I read there. It reminds me a lot of the random cases where Tkinter functions return TclObjects instead of the data types they were supposed to. Michael From mfranklin1 at gatwick.westerngeco.slb.com Mon Feb 18 10:23:15 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Mon, 18 Feb 2008 09:23:15 +0000 Subject: [Tkinter-discuss] tkinter askdirectory print In-Reply-To: <15468402.post@talk.nabble.com> References: <15468402.post@talk.nabble.com> Message-ID: <47B94E83.1020702@gatwick.westerngeco.slb.com> RagZ wrote: > Hello, > > I'm writing an application with a browse button that opens up the > "askdirectory" box to choose a directory. The problem is when the directory > is chosen and the ok button is hit it prints the directory to the terminal > (if it's open) and I would like it to print it to a ENTRY() that I have. For > example: > > from Tkinter import * > from tkFileDialog import askdirectory > > root = Tk() > > e1 = Entry(root) #<---------I would like the dir1 to print > here > > def browser(): > dir1 = askdirectory(parent=root, title="Select A Folder", mustexist=1) > if len(dir1) > 0: > print dir1 > > Button(root, text="Browse", command=browser) > > root.mainloop() > > So from this what I'm asking is how can I get dir1 to print to e1 (the entry > box)? I'm new to Python and am taking the learn-as-I-code route but can't > seem to figure this one out. It might be really easy but I just don't see > it. Thanks for any help. > > > - RagZ You are almost there ## not tested, but *should* work ;) from Tkinter import * from tkFileDialog import askdirectory root = Tk() ## use a Tkinter.StringVar with and Tkinter Entry widget d1 = StringVar() e1 = Entry(root, textvariable=d1) e1.pack() def browser(): dir1 = askdirectory() if dir1: d1.set(dir1) b1 = Button(root, text="Browse", command=browser) b1.pack() root.mainloop() Cheers Martin -- signature file not found, must be something I ate From PeterM at resmed.com.au Mon Feb 18 03:17:35 2008 From: PeterM at resmed.com.au (Peter Milliken) Date: Mon, 18 Feb 2008 13:17:35 +1100 Subject: [Tkinter-discuss] Determining size of a widget in grid? Message-ID: <3F972823F361A94891FFD6A3B302718006FBF664@au2eml2k303.corp.resmed.org> I have an application which uses the grid layout manager. One of my widgets can grow (and shrink) in width as various events in the application occur. Is there anyway to determine the width of the widget in terms of the column width that the grid manager determines? i.e. the grid manager calculates a column width based on the widgets placed in it - I would like to determine if the "new" width of the widget (as it grows/shrinks) requires a columnspan value or not and if it does, then how many columns should it span? At the moment, as the width of the widget gets larger than the column size allocated in the "other" columns, it makes the widgets in the same column (but different rows) look untidy because that "column" is a different size to the others (the "other" widgets are of a uniform size - it is just this one widget that grows/shrinks that is out of play in the grid/table layout). Hope this is understandable :-) Peter 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 8884 1000 Sydney, Australia. From jarausch at skynet.be Mon Feb 18 20:42:01 2008 From: jarausch at skynet.be (HWJ) Date: Mon, 18 Feb 2008 11:42:01 -0800 (PST) Subject: [Tkinter-discuss] tk_focusNext and tkfocusPrev In-Reply-To: References: <15356581.post@talk.nabble.com> <47B3F0A1.5080206@gatwick.westerngeco.slb.com> Message-ID: <15548084.post@talk.nabble.com> Russell E. Owen wrote: > > In article <47B3F0A1.5080206 at gatwick.westerngeco.slb.com>, > Martin Franklin wrote: > > Actually a "window" in tk is a widget. A "whole window" is called a > "toplevel" in tk. I find it disconcerting, but at least once I got the > hang of that I found the tk documentation made a lot more sense. > > Also focusNext always stays within the current toplevel (according to > the manual). But it looks like it only gives you the name of the next > widget (window). So I think the solution to the original poster's > question is: > > currWdg.tk_focusNext().focus_set() > > -- Russell > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > Hi, thanks for the hint, but unfortunately the bug is still there. Please try the following script: #!/usr/bin/python import Tkinter as Tk def Proc_Enter(Event) : print "Enter - normally lookup a database" Event.widget.tk_focusNext().focus_set() root= Tk.Tk() Tk.Label(root,text='Name').grid(column=0,row=0,sticky=Tk.W) Nm_input= Tk.StringVar() Nm_entry= Tk.Entry(root,textvariable=Nm_input) Nm_entry.bind('',Proc_Enter) Nm_entry.grid(column=1,row=0,sticky=Tk.W) Tk.Label(root,text='City').grid(column=0,row=1,sticky=Tk.W) City_input= Tk.StringVar() City_entry= Tk.Entry(root,textvariable=City_input) City_entry.bind('',Proc_Enter) City_entry.grid(column=1,row=1,sticky=Tk.W) Tk.mainloop() It still fails for me. -- View this message in context: http://www.nabble.com/tk_focusNext-and-tkfocusPrev-tp15356581p15548084.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From mfranklin1 at gatwick.westerngeco.slb.com Tue Feb 19 09:50:31 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Tue, 19 Feb 2008 08:50:31 +0000 Subject: [Tkinter-discuss] Determining size of a widget in grid? In-Reply-To: <3F972823F361A94891FFD6A3B302718006FBF664@au2eml2k303.corp.resmed.org> References: <3F972823F361A94891FFD6A3B302718006FBF664@au2eml2k303.corp.resmed.org> Message-ID: <47BA9857.9010008@gatwick.westerngeco.slb.com> Peter Milliken wrote: > I have an application which uses the grid layout manager. One of my > widgets can grow (and shrink) in width as various events in the > application occur. > > Is there anyway to determine the width of the widget in terms of the > column width that the grid manager determines? i.e. the grid manager > calculates a column width based on the widgets placed in it - I would > like to determine if the "new" width of the widget (as it grows/shrinks) > requires a columnspan value or not and if it does, then how many columns > should it span? > > At the moment, as the width of the widget gets larger than the column > size allocated in the "other" columns, it makes the widgets in the same > column (but different rows) look untidy because that "column" is a > different size to the others (the "other" widgets are of a uniform size > - it is just this one widget that grows/shrinks that is out of play in > the grid/table layout). > > Hope this is understandable :-) > > Peter Peter, Not 100% sure I follow everything you're saying ;) Take a look at the winfo_reqheight and winfo_reqwidth methods you may have to call update_idletasks before calling them so they are 'up to date' There may also be some grid_ methods that can help, but I normally only use pack so I'm afraid I can't be more specific Martin -- signature file not found, must be something I ate From gigs at hi.t-com.hr Tue Feb 19 12:53:26 2008 From: gigs at hi.t-com.hr (Gigs_) Date: Tue, 19 Feb 2008 12:53:26 +0100 Subject: [Tkinter-discuss] tkinter askdirectory print In-Reply-To: <15468402.post@talk.nabble.com> References: <15468402.post@talk.nabble.com> Message-ID: <47BAC336.3000700@hi.t-com.hr> RagZ wrote: > Hello, > > I'm writing an application with a browse button that opens up the > "askdirectory" box to choose a directory. The problem is when the directory > is chosen and the ok button is hit it prints the directory to the terminal > (if it's open) and I would like it to print it to a ENTRY() that I have. For > example: > > from Tkinter import * > from tkFileDialog import askdirectory > > root = Tk() > > e1 = Entry(root) #<---------I would like the dir1 to print > here > > def browser(): > dir1 = askdirectory(parent=root, title="Select A Folder", mustexist=1) > if len(dir1) > 0: > print dir1 > > Button(root, text="Browse", command=browser) > > root.mainloop() > > So from this what I'm asking is how can I get dir1 to print to e1 (the entry > box)? I'm new to Python and am taking the learn-as-I-code route but can't > seem to figure this one out. It might be really easy but I just don't see > it. Thanks for any help. > > > - RagZ > you should pack or grid button and entry to show it e1 = Entry(root) e1.pack() Button(root, text="FFFF", command=browser).pack() in browser function you need to insert text to entry def browser(): dir1 = askdirectory(parent=root, title="Select", mustexist=1) if len(dir1) > 0: e1.insert(0, dir1) From jek-gmane at kleckner.net Thu Feb 21 17:20:06 2008 From: jek-gmane at kleckner.net (Jim Kleckner) Date: Thu, 21 Feb 2008 08:20:06 -0800 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> References: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> Message-ID: Martin Franklin wrote: > Russell E. Owen wrote: >> In article , >> Alexander Belchenko wrote: >> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> Jim Kleckner ??????????: >>> | Any pointers to what it takes to add/remove widgets >>> | from a running application? >>> >>> Something like this maybe? >>> >>> from Tkinter import * >>> root = Tk() >>> x = Label(root, text='Hello') >>> x.pack() >>> Button(root, text='Hide', command=x.pack_forget).pack() >>> root.mainloop() >> Or if you use the gridder you can remove things temporary and restore >> them again easily: >> x.grid(row=0....) >> x.grid_remove() # to temporarily remove >> x.grid() # to restore using the original grid settings >> x.grid_forget() # to remove permanently >> (remove is not supported by the packer) >> > > pack_forget does not erm remove either ;) > > > > from Tkinter import * > > > root = Tk() > root.title("Pack is BEST!!!") > > l = Label(root, text="Pack is simply the best") > l.pack() > > > def forget(): > l.pack_forget() > > def remember(): > l.pack() > > > b = Button(root, text="Forget about it", command=forget) > b.pack() > b = Button(root, text="Wait, I still need you", command=remember) > b.pack() > > > root.mainloop() > > > BUT... the remember function packs the label widget in it's new packing > order, so it is packed after the two buttons, as far as I know the only > way to 'remember' its pack position is to put it inside a Frame widget > (and leave the Frame where it stands) - at least thats how I do it > > To the OP I guess you've seen how easy this is with Tk(inter) :) > > Cheers, > Martin. Thank you for the nice examples. I see running this application that the remember button causes the label to relocated to the bottom of the window. What I actually want is to construct and add new widgets during the mainloop(). So a button that appends new labels at the bottom based on a text entry field would demonstrate the issue. I've been playing with this extremely simple and interesting tVector helper code from here: http://www.freenet.org.nz/python/tVector/ Ideally, I just want to reach in and extend the widget list. I'm attaching a file with some concept code using tVector (yes, I should rewrite it with grid, I guess). The grid manager looks interesting and it seems that it ought to be able do something like this but the methods don't obviously have an append() or some such. Jim From jek-gmane at kleckner.net Thu Feb 21 17:21:29 2008 From: jek-gmane at kleckner.net (Jim Kleckner) Date: Thu, 21 Feb 2008 08:21:29 -0800 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> References: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> Message-ID: And the obligatory second post with the attachment, having forgotten it in the first... -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: TestGrow.py Url: http://mail.python.org/pipermail/tkinter-discuss/attachments/20080221/cc5f055b/attachment.txt From jek-gmane at kleckner.net Thu Feb 21 17:23:51 2008 From: jek-gmane at kleckner.net (Jim Kleckner) Date: Thu, 21 Feb 2008 08:23:51 -0800 Subject: [Tkinter-discuss] Code to dump widget info Message-ID: I'm posting this code snippet for others who might want a cheap way to see into the widget methods/attributes/configure options. Cheers - Jim import Tkinter allWidgets = { "Wm": Tkinter.Wm, "Tk": Tkinter.Tk, "Event": Tkinter.Event, "Variable": Tkinter.Variable, "StringVar": Tkinter.StringVar, "IntVar": Tkinter.IntVar, "DoubleVar": Tkinter.DoubleVar, "BooleanVar": Tkinter.BooleanVar, "Misc": Tkinter.Misc, "CallWrapper": Tkinter.CallWrapper, "Pack": Tkinter.Pack, "Place": Tkinter.Place, "Grid": Tkinter.Grid, "BaseWidget": Tkinter.BaseWidget, "Widget": Tkinter.Widget, "Toplevel": Tkinter.Toplevel, "Button": Tkinter.Button, "Canvas": Tkinter.Canvas, "Checkbutton": Tkinter.Checkbutton, "Entry": Tkinter.Entry, "Frame": Tkinter.Frame, "Label": Tkinter.Label, "Listbox": Tkinter.Listbox, "Menu": Tkinter.Menu, "Menubutton": Tkinter.Menubutton, "Message": Tkinter.Message, "Radiobutton": Tkinter.Radiobutton, "Scale": Tkinter.Scale, "Scrollbar": Tkinter.Scrollbar, "Text": Tkinter.Text, "_setit": Tkinter._setit, "OptionMenu": Tkinter.OptionMenu, "Image": Tkinter.Image, "PhotoImage": Tkinter.PhotoImage, "BitmapImage": Tkinter.BitmapImage, "Spinbox": Tkinter.Spinbox, "LabelFrame": Tkinter.LabelFrame, "PanedWindow": Tkinter.PanedWindow, "Studbutton": Tkinter.Studbutton, "Tributton": Tkinter.Tributton, } someWidgets = { "Button": Tkinter.Button, "Canvas": Tkinter.Canvas, "Checkbutton": Tkinter.Checkbutton, "Entry": Tkinter.Entry, "Label": Tkinter.Label, "Listbox": Tkinter.Listbox, "Menu": Tkinter.Menu, "Menubutton": Tkinter.Menubutton, "Message": Tkinter.Message, "Radiobutton": Tkinter.Radiobutton, "Scrollbar": Tkinter.Scrollbar, "Text": Tkinter.Text, "Spinbox": Tkinter.Spinbox, "LabelFrame": Tkinter.LabelFrame, "PanedWindow": Tkinter.PanedWindow, } if __name__ == '__main__': kl = allWidgets.keys() kl.sort() for k in kl: print "%s:" % k instance = allWidgets[k] # options = instance.configure() options = instance.__dict__ ol = options.keys() ol.sort() for o in ol: print " %s\t%s" % (o, options[o]) #for k in []: print '\n##################\n' kl = someWidgets.keys() kl.sort() root = Tkinter.Tk() for k in kl: print "%s:" % k instance = someWidgets[k](root) options = instance.configure() # options = instance._configure() ol = options.keys() ol.sort() for o in ol: print " %s\t%s" % (o, options[o]) From jek-gmane at kleckner.net Thu Feb 21 17:44:37 2008 From: jek-gmane at kleckner.net (Jim Kleckner) Date: Thu, 21 Feb 2008 08:44:37 -0800 Subject: [Tkinter-discuss] Code to dump widget info In-Reply-To: References: Message-ID: Added dump of function docs: ====== import Tkinter import inspect allWidgets = { "Wm": Tkinter.Wm, "Tk": Tkinter.Tk, "Event": Tkinter.Event, "Variable": Tkinter.Variable, "StringVar": Tkinter.StringVar, "IntVar": Tkinter.IntVar, "DoubleVar": Tkinter.DoubleVar, "BooleanVar": Tkinter.BooleanVar, "Misc": Tkinter.Misc, "CallWrapper": Tkinter.CallWrapper, "Pack": Tkinter.Pack, "Place": Tkinter.Place, "Grid": Tkinter.Grid, "BaseWidget": Tkinter.BaseWidget, "Widget": Tkinter.Widget, "Toplevel": Tkinter.Toplevel, "Button": Tkinter.Button, "Canvas": Tkinter.Canvas, "Checkbutton": Tkinter.Checkbutton, "Entry": Tkinter.Entry, "Frame": Tkinter.Frame, "Label": Tkinter.Label, "Listbox": Tkinter.Listbox, "Menu": Tkinter.Menu, "Menubutton": Tkinter.Menubutton, "Message": Tkinter.Message, "Radiobutton": Tkinter.Radiobutton, "Scale": Tkinter.Scale, "Scrollbar": Tkinter.Scrollbar, "Text": Tkinter.Text, "_setit": Tkinter._setit, "OptionMenu": Tkinter.OptionMenu, "Image": Tkinter.Image, "PhotoImage": Tkinter.PhotoImage, "BitmapImage": Tkinter.BitmapImage, "Spinbox": Tkinter.Spinbox, "LabelFrame": Tkinter.LabelFrame, "PanedWindow": Tkinter.PanedWindow, "Studbutton": Tkinter.Studbutton, "Tributton": Tkinter.Tributton, } someWidgets = { "Button": Tkinter.Button, "Canvas": Tkinter.Canvas, "Checkbutton": Tkinter.Checkbutton, "Entry": Tkinter.Entry, "Label": Tkinter.Label, "Listbox": Tkinter.Listbox, "Menu": Tkinter.Menu, "Menubutton": Tkinter.Menubutton, "Message": Tkinter.Message, "Radiobutton": Tkinter.Radiobutton, "Scrollbar": Tkinter.Scrollbar, "Text": Tkinter.Text, "Spinbox": Tkinter.Spinbox, "LabelFrame": Tkinter.LabelFrame, "PanedWindow": Tkinter.PanedWindow, } if __name__ == '__main__': kl = allWidgets.keys() kl.sort() print '\n################## __dict__\n' for k in kl: print "%s:" % k instance = allWidgets[k] # options = instance.configure() options = instance.__dict__ ol = options.keys() ol.sort() for o in ol: print " %s\t%s" % (o, options[o]) #for k in []: print '\n################## configure\n' sl = someWidgets.keys() sl.sort() root = Tkinter.Tk() for k in sl: print "%s:" % k instance = someWidgets[k](root) options = instance.configure() # options = instance._configure() ol = options.keys() ol.sort() for o in ol: print " %s\t%s" % (o, options[o]) print '\n################## functions\n' for k in kl: print "%s:" % k instance = allWidgets[k] #print instance.__dict__ funcDict = {} id = instance.__dict__ for k in id: if inspect.isfunction(id[k]): funcDict[k] = id[k] fl = funcDict.keys() fl.sort() for f in fl: print " %s\t%s" % (f, funcDict[f].__doc__) From brindly at gmail.com Sat Feb 23 06:55:20 2008 From: brindly at gmail.com (brindly sujith) Date: Sat, 23 Feb 2008 11:25:20 +0530 Subject: [Tkinter-discuss] how to display terminal messages in a dialog box using tkinter Message-ID: hi i m developing a application using tkinter i want the messages that we get in the terminal to be displayed in the tkinter dialog box do we have any option for that thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20080223/f9293c3a/attachment.htm From gigs at hi.t-com.hr Sat Feb 23 15:27:25 2008 From: gigs at hi.t-com.hr (Gigs_) Date: Sat, 23 Feb 2008 15:27:25 +0100 Subject: [Tkinter-discuss] how to display terminal messages in a dialog boxusing tkinter In-Reply-To: References: Message-ID: <47C02D4D.7060505@hi.t-com.hr> brindly sujith wrote: > hi > > i m developing a application using tkinter > > i want the messages that we get in the terminal to be displayed in the > tkinter dialog box > > do we have any option for that > > thank you > ------------------------------------------------------------------------ > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > maybe you could redirect sys.stdout to tkinter textbox. or make wrapper for stdout or something like this class Klass(): def __init__(self): self.x = '' def write(self, c): self.x += c def writelines(self, l): for i in l: self.x += i w = Wrapper() sys.stdout = w and insert w.x to tkinter text t.insert(1.1, w.x) w.x = '' dont know much about tkinter, but i hope that this help you From rdmoores at gmail.com Sun Feb 24 15:13:24 2008 From: rdmoores at gmail.com (Dick Moores) Date: Sun, 24 Feb 2008 06:13:24 -0800 Subject: [Tkinter-discuss] Is Rapyd-Tk still developing? Message-ID: Is Rapyd-Tk still developing? If it is, I'm interested in learning to use it. If not, I'm not. The version history file shows the last version, 0.1.1 came out 2007/01/08. Thanks, Dick Moores From hsa01 at bitflipper.ca Sun Feb 24 18:30:31 2008 From: hsa01 at bitflipper.ca (Cam Farnell) Date: Sun, 24 Feb 2008 12:30:31 -0500 Subject: [Tkinter-discuss] Is Rapyd-Tk still developing? In-Reply-To: References: Message-ID: <47C1A9B7.5070609@bitflipper.ca> Dick, The answer is that Rapyd-Tk is developing, albeit slowly. The slow development is because: 1) Like everybody else I'm pretty busy. 2) I use Rapyd-Tk daily for major programs and have no serious issues; it just works. 3) No bugs have been reported and almost nobody has put in feature requests. There is no intention of abandoning Rapyd-Tk and if someone submitted a report of a non-trivial bug I would do my best to fix it promptly. I have recently been contacted by a Mike Ward who is interested in adding Tix support. Assuming that goes ahead, it will result in a new release and I would probably throw in some beetle corrections at the same time. So the short answer is go ahead and use Rapyd-Tk; it's an active project. Cam Farnell Dick Moores wrote: > > > Is Rapyd-Tk still developing? If it is, I'm interested in learning to > use it. If not, I'm not. > > The version history file shows the last version, 0.1.1 came out 2007/01/08. > > Thanks, > > Dick Moores From rdmoores at gmail.com Sun Feb 24 21:29:35 2008 From: rdmoores at gmail.com (Dick Moores) Date: Sun, 24 Feb 2008 12:29:35 -0800 Subject: [Tkinter-discuss] Is Rapyd-Tk still developing? In-Reply-To: <47C1A9B7.5070609@bitflipper.ca> References: <47C1A9B7.5070609@bitflipper.ca> Message-ID: Terrific! I'm glad to hear it. Dick Moores On Sun, Feb 24, 2008 at 9:30 AM, Cam Farnell wrote: > Dick, > > The answer is that Rapyd-Tk is developing, albeit slowly. The slow development is because: > > 1) Like everybody else I'm pretty busy. > 2) I use Rapyd-Tk daily for major programs and have no serious issues; it just works. > 3) No bugs have been reported and almost nobody has put in feature requests. > > There is no intention of abandoning Rapyd-Tk and if someone submitted a report of a non-trivial bug > I would do my best to fix it promptly. > > I have recently been contacted by a Mike Ward who is interested in adding Tix support. Assuming that > goes ahead, it will result in a new release and I would probably throw in some beetle corrections at > the same time. > > So the short answer is go ahead and use Rapyd-Tk; it's an active project. > > Cam Farnell > > > Dick Moores wrote: > > > > > > Is Rapyd-Tk still developing? If it is, I'm interested in learning to > > use it. If not, I'm not. > > > > The version history file shows the last version, 0.1.1 came out 2007/01/08. > > > > Thanks, > > > > Dick Moores > > From mfranklin1 at gatwick.westerngeco.slb.com Mon Feb 25 13:56:00 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Mon, 25 Feb 2008 12:56:00 +0000 Subject: [Tkinter-discuss] how to display terminal messages in a dialog boxusing tkinter In-Reply-To: <47C02D4D.7060505@hi.t-com.hr> References: <47C02D4D.7060505@hi.t-com.hr> Message-ID: <47C2BAE0.3040705@gatwick.westerngeco.slb.com> Gigs_ wrote: > brindly sujith wrote: >> hi >> >> i m developing a application using tkinter >> >> i want the messages that we get in the terminal to be displayed in the >> tkinter dialog box >> >> do we have any option for that >> >> thank you >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Tkinter-discuss mailing list >> Tkinter-discuss at python.org >> http://mail.python.org/mailman/listinfo/tkinter-discuss >> > maybe you could redirect sys.stdout to tkinter textbox. or make wrapper > for stdout > > or something like this > > class Klass(): > def __init__(self): > self.x = '' > def write(self, c): > self.x += c > def writelines(self, l): > for i in l: > self.x += i > w = Wrapper() > sys.stdout = w > > and insert w.x to tkinter text > t.insert(1.1, w.x) > w.x = '' > > dont know much about tkinter, but i hope that this help you > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > Extending the Tkinter.Text widget works great here, give it a write method and optionally scroll to the inserted text too... class STDText(Text): def __init__(self, parent): Text.__init__(self, parent) def write(self, stuff): self.insert("end", stuff) self.yview_pickplace("end") root=Tk() sText = STDText(root) sText.pack() sys.stdout = sText root.mainloop() -- signature file not found, must be something I ate From jek-gmane at kleckner.net Tue Feb 26 04:45:00 2008 From: jek-gmane at kleckner.net (Jim Kleckner) Date: Mon, 25 Feb 2008 19:45:00 -0800 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: References: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> Message-ID: <47C38B3C.7000908@kleckner.net> Jim Kleckner wrote: [snip] > What I actually want is to construct and add new widgets > during the mainloop(). So a button that appends new labels > at the bottom based on a text entry field would demonstrate > the issue. > > I've been playing with this extremely simple and interesting > tVector helper code from here: > http://www.freenet.org.nz/python/tVector/ > > Ideally, I just want to reach in and extend the widget list. > I'm attaching a file with some concept code using tVector > (yes, I should rewrite it with grid, I guess). > > The grid manager looks interesting and it seems that it > ought to be able do something like this but the methods > don't obviously have an append() or some such. Ok, I hacked together a grid-based demo. Care to comment on this code? Jim -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: TestGrow.py Url: http://mail.python.org/pipermail/tkinter-discuss/attachments/20080225/fdffbc63/attachment.txt From mfranklin1 at gatwick.westerngeco.slb.com Tue Feb 26 10:53:20 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Tue, 26 Feb 2008 09:53:20 +0000 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: <47C38B3C.7000908@kleckner.net> References: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> <47C38B3C.7000908@kleckner.net> Message-ID: <47C3E190.9070800@gatwick.westerngeco.slb.com> Jim Kleckner wrote: > Jim Kleckner wrote: > [snip] > Ok, I hacked together a grid-based demo. > Care to comment on this code? > > Jim well, it works ;) I guess the real question is, does it do what you wanted in your original post ? Cheers, Martin. -- signature file not found, must be something I ate From jek-gmane at kleckner.net Wed Feb 27 03:16:30 2008 From: jek-gmane at kleckner.net (Jim Kleckner) Date: Tue, 26 Feb 2008 18:16:30 -0800 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: <47C3E190.9070800@gatwick.westerngeco.slb.com> References: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> <47C38B3C.7000908@kleckner.net> <47C3E190.9070800@gatwick.westerngeco.slb.com> Message-ID: Martin Franklin wrote: > Jim Kleckner wrote: >> Jim Kleckner wrote: >> [snip] >> Ok, I hacked together a grid-based demo. >> Care to comment on this code? > > well, it works ;) I guess the real question is, does it do what you > wanted in your original post ? I think so. ;) I'm not sure if I should destroy the widgets or not. Clearly, the grid keeps on getting more and more rows even as you delete (forget) some of them. I'm not sure just what issues might happen when approaching it this way. From mfranklin1 at gatwick.westerngeco.slb.com Wed Feb 27 10:28:04 2008 From: mfranklin1 at gatwick.westerngeco.slb.com (Martin Franklin) Date: Wed, 27 Feb 2008 09:28:04 +0000 Subject: [Tkinter-discuss] Adding/removing widgets from a running application? In-Reply-To: References: <47B3EDBE.5010804@gatwick.westerngeco.slb.com> <47C38B3C.7000908@kleckner.net> <47C3E190.9070800@gatwick.westerngeco.slb.com> Message-ID: <47C52D24.1000400@gatwick.westerngeco.slb.com> Jim Kleckner wrote: > Martin Franklin wrote: >> Jim Kleckner wrote: >>> Jim Kleckner wrote: >>> [snip] >>> Ok, I hacked together a grid-based demo. >>> Care to comment on this code? >> well, it works ;) I guess the real question is, does it do what you >> wanted in your original post ? > > I think so. ;) I'm not sure if I should destroy the widgets or not. > Clearly, the grid keeps on getting more and more rows even as you > delete (forget) some of them. I'm not sure just what issues might > happen when approaching it this way. > > _____ I remember, before I found Tktable & its like, I attempted to create a 'spreadsheet' widget out of lots and lot (and lots) of Entry widgets it quickly grew into a monster memory hog! You would have to test, but I'd assume destroying the widgets will free any memory they are using so you should not run into to many problems Cheers, Martin. -- signature file not found, must be something I ate