Re: Very practical question

2006-07-06 Thread Simon Forman
madpython wrote: > ... > self.b=Tkinter.Button(root,txt="Button",command=self.doSmth).pack() > self.l=Tkinter.Label(root,txt="default").pack() > def doSmth(self): > var=globals()["m"].__dict__["progLogic"].func("some > input") > self.l.config(txt=var) > self.l.update_

Re: Very practical question

2006-07-06 Thread madpython
Thank you all for your comments. They are priceless beyond any doubt. As for the matter of the discussion it took me only a minute looking at the code to realize that with Tkinter I pass "master" reference to every widget and therefore I can access every method in the class hierarchy. I'm a fool th

Re: Very practical question

2006-07-05 Thread Fredrik Lundh
madpython wrote: > Here is a short illustration: > > ... > self.b=Tkinter.Button(root,txt="Button",command=self.doSmth).pack() > self.l=Tkinter.Label(root,txt="default").pack() > def doSmth(self): > var=globals()["m"].__dict__["progLogic"].func("some > input") > self.l.con

Re: Very practical question

2006-07-05 Thread Tim Roberts
"madpython" <[EMAIL PROTECTED]> wrote: >I've been doing an application with Tkinter widgets. Nothing really >fancy just routine stuff. Though I have no problems with it by now I >guess it would be reasonable to ask about a thing that's been bothering >me a bit. Look at this piece of code: > >class

Re: Very practical question

2006-07-05 Thread Bruno Desthuilliers
madpython a écrit : > Marc 'BlackJack' Rintsch wrote: > >>In <[EMAIL PROTECTED]>, madpython >>wrote: >> >> >>No it's not the normal way. Why don't you give `c` as argument to the >>`interClassCall()`? >> >>class B(object): >>def interClassCall(self, c): >>print c.a.a() >> >>class C(ob

Re: Very practical question

2006-07-05 Thread madpython
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, madpython > wrote: > > > No it's not the normal way. Why don't you give `c` as argument to the > `interClassCall()`? > > class B(object): > def interClassCall(self, c): > print c.a.a() > > class C(object): > def __init__(sel

Re: Very practical question

2006-07-05 Thread Bruno Desthuilliers
madpython a écrit : > I've been doing an application with Tkinter widgets. Nothing really > fancy just routine stuff. Though I have no problems with it by now I > guess it would be reasonable to ask about a thing that's been bothering > me a bit. Look at this piece of code: > > class A(object): >

Re: Very practical question

2006-07-05 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, madpython wrote: > I've been doing an application with Tkinter widgets. Nothing really > fancy just routine stuff. Though I have no problems with it by now I > guess it would be reasonable to ask about a thing that's been bothering > me a bit. Look at this piece of code: >

Re: Very practical question

2006-07-05 Thread Fredrik Lundh
madpython wrote: > What is another way to get data from method of another instance of a > class? Or maybe print globals()['c'].__dict__['a'].a() is perfectly > normal. I'd say it's a fireable offense. -- http://mail.python.org/mailman/listinfo/python-list

Very practical question

2006-07-05 Thread madpython
I've been doing an application with Tkinter widgets. Nothing really fancy just routine stuff. Though I have no problems with it by now I guess it would be reasonable to ask about a thing that's been bothering me a bit. Look at this piece of code: class A(object): def a(self): return "a