Re: Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
Greetings, .append(self) is a hit idea Updated the project with the button demo https://github.com/Abdur-rahmaanJ/hooman/ Next i will be attempting to add a grid system. I feel myself developing tkinter from scratch Thanks for the help everybody ^^_ Kind Regards, Abdur-Rahmaan Janhangeer comp

Re: Access an object to which being bound

2020-05-27 Thread DL Neil via Python-list
@AR, On 28/05/20 8:41 AM, Chris Angelico wrote: On Thu, May 28, 2020 at 6:27 AM Abdur-Rahmaan Janhangeer wrote: Thanks, Actually i want to keep a reference from B to all A instantiated like in the case of z I have class A and i want to call class B via A You can have def x(self, *args, *

Re: Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
Hum yes a third class is a nice option! btw managed to do it with those in Hooman self._all_widgets = [] def button(self, *args, **kwargs): b = Button(*args, **kwargs) self._all_widgets.append(b) return b def update_all(self): for widget in self._all_

Re: Access an object to which being bound

2020-05-27 Thread Chris Angelico
On Thu, May 28, 2020 at 6:27 AM Abdur-Rahmaan Janhangeer wrote: > > Thanks, > > Actually i want to keep a reference from B to all A > instantiated like in the case of z > > I have class A and i want to call class B via A > > You can have > > def x(self, *args, **kwargs): > return A(*args, **kw

Re: Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
i have this: https://github.com/Abdur-rahmaanJ/hooman/blob/master/hooman/hooman.py someone PRed a Button class i want the class button to be available to the class Hooman via Human.button self.button = Button but button has update() which must be called individually one way to update all butto

Re: Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
Thanks, Actually i want to keep a reference from B to all A instantiated like in the case of z I have class A and i want to call class B via A You can have def x(self, *args, **kwargs): return A(*args, **kwargs) but was wondering if we could keep track while doing it via z = ... Kind Rega

Re: Access an object to which being bound

2020-05-27 Thread Chris Angelico
On Thu, May 28, 2020 at 5:48 AM Abdur-Rahmaan Janhangeer wrote: > > Greetings, > > Lets say i have > > class A: > ... > > class B: >self.x = A > > then used > > b = B() > z = b.x() > > now how in A i get a reference to B when z is assigned to b.x? > Things are very tangled here. What exactl

Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
Greetings, Lets say i have class A: ... class B: self.x = A then used b = B() z = b.x() now how in A i get a reference to B when z is assigned to b.x? Thanks Kind Regards, Abdur-Rahmaan Janhangeer compileralchemy | blog