frames in toplevel Tkinter

2009-12-16 Thread J Wolfe
Probably a stupid question, but can you have a frames in a toplevel widget? Anything I try to put in a frame goes back to the main or root widget and not the toplevel or pop-up widget. Thanks for the help! Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: frames in toplevel Tkinter

2009-12-17 Thread J Wolfe
On Dec 16, 11:09 pm, J Wolfe wrote: > Probably a stupid question, but can you have a frames in a toplevel > widget? Anything I try to put in a frame goes back to the main or root > widget and not the toplevel or pop-up widget. > > Thanks for the help! > Jonathan Thank you J

ScrolledText get xy index of rowheader component?

2009-12-21 Thread J Wolfe
Hi, I tried to get the xycoordinate of a click of the rowheader column of Pmw's ScrolledText...and it returns the xycoordinate of the text portion...even though I supplied it with the rowheader component. self.scrolledtext.component('rowheader').index("@%d,%d" % (event.x,event.y)) What am I doin

Re: ScrolledText get xy index of rowheader component?

2009-12-22 Thread J Wolfe
Nevermind I figured it out... I set self.dummyvar = self.scrolledtext.component('rowheader') and then did something like so self.dummyvar.index("@%d,%d" % (event.x,event.y)) not sure why it worked like that...but it did :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: re.sub do not replace portion of match

2009-10-02 Thread J Wolfe
Thanks Duncan, I did look at that, but it was kinda greek to me. Thanks for pulling out the part I was looking for that should do the trick. Jonathan > http://www.python.org/doc/current/library/re.html#re.sub > > > Backreferences, such as \6, are replaced with the substring matched by > > group

re.sub do not replace portion of match

2009-10-03 Thread J Wolfe
Hi, Is there a way to flag re.sub not to replace a portion of the string? I have a very long string that I want to add two new line's to rather than one, but keep the value X: string = "testX.\n.today" <-- note X is a value string = re.sub("testX.\n.","testX.\n\n.", stri

Tkinter -- the best way to make a realtime loop

2009-10-07 Thread J Wolfe
What's the best way to make a realtime loop in Tkinter? I know in perl you can use "repeat" and it will call a function every x seconds, in python it seems like "after" may be the equivalent though it doesn't seem to behave like the perl repeat function. Any ideas? Thanks, Jonathan -- http://mai

Re: Tkinter -- the best way to make a realtime loop

2009-10-08 Thread J Wolfe
Thank you both for your replies. I had something similar to this: def incr(): var.set(1 + var.get()) root.after(1000, incr) except I had an extra set of parenthesis... def incr(): var.set(1 + var.get()) root.after(1000, incr()) on the function which was screwing it up. Also needed to ha

Re: sort values from dictionary of dictionaries python 2.4

2009-11-20 Thread J Wolfe
On Nov 9, 2:27 pm, Peter Otten <__pete...@web.de> wrote: > J Wolfe wrote: > > I would like to sort this dictionary by the values of the inner > > dictionary ‘ob’ key. > > Python's built-in dictionary is unsorted by design. > > > > > mydict = > >

Print to Printer Tkinter Text

2009-11-23 Thread J Wolfe
Hi, Is there a way to print the format of a Tkinter text box to a color printer with its tags, e.g. a blue text at font size 18 and bold will like it displays? Thanks, Jonathan -- http://mail.python.org/mailman/listinfo/python-list

How do you implement a Progress Bar

2010-02-12 Thread J Wolfe
I would really appreciate some help with this. I'm fairly new to using classes...What am I doing wrong? All I get is a blank window. I can't seem to figure out how to initialize this Progress Bar. Thanks, Jonathan ##file Meter.py from Tkinter imp

passing menu label to function

2009-08-07 Thread J Wolfe
Hi, I would like to pass the label name of a menu to the command it is calling, is that possible? self.menuitem.menu.add_command(label="pass this",command = lambda i = self.self.menuitem.menu.cget("label"): self.function(i)) def function(self, i) print i # print the label name Any help

Re: passing menu label to function

2009-08-07 Thread J Wolfe
Thanks Peter, I figured out an alternative just as you posted your response, I just looped through the buttons I wanted to add and used the loop variable to label the item and then passed it to the function, though your way seems much more robust. Thanks a lot! -- http://mail.python.org/mailman

Pmw optionmenu color

2009-08-24 Thread J Wolfe
Hello, It seems like this should be easy to do... change the background color of the Pmw optionmenu. I have not been able to find this. Anyone have a hint or know how to do this? Thanks, Jonathan -- http://mail.python.org/mailman/listinfo/python-list