Re: [Tutor] Tkinter class question - solved

2017-04-08 Thread Alan Gauld via Tutor
On 07/04/17 20:21, Phil wrote: > After a bit more thought I now realise that I just > need to use self to reference e[][] in my check function. You need to use self any time you access any member of your class. So in your case: class TestGUI: def __init__(self, master): self.master

Re: [Tutor] Tkinter class question

2017-04-08 Thread Peter Otten
Phil wrote: > On Sat, 08 Apr 2017 09:12:17 +0200 > Peter Otten <__pete...@web.de> wrote: > > Thank you yet again Peter. > > I realised what the answer is after taking a break for a couple of hours, > however, I didn't know about: > >> ... >> self.check_button = Button( >>

Re: [Tutor] Tkinter class question - solved

2017-04-08 Thread Peter Otten
Phil wrote: > On Sat, 8 Apr 2017 02:00:38 +1000 > > This is one of those times where I wish I could delete a sent message. > > After a bit more thought I now realise that I just need to use self to > reference e[][] in my check function. Relax ;) We all had to go through a learning process.

Re: [Tutor] Tkinter class question

2017-04-08 Thread Phil
On Sat, 08 Apr 2017 09:12:17 +0200 Peter Otten <__pete...@web.de> wrote: Thank you yet again Peter. I realised what the answer is after taking a break for a couple of hours, however, I didn't know about: > ... > self.check_button = Button( > master, > tex

Re: [Tutor] Tkinter class question - solved

2017-04-08 Thread Phil
On Sat, 8 Apr 2017 02:00:38 +1000 This is one of those times where I wish I could delete a sent message. After a bit more thought I now realise that I just need to use self to reference e[][] in my check function. -- Regards, Phil ___ Tutor maillist

Re: [Tutor] Tkinter class question

2017-04-08 Thread Alan Gauld via Tutor
On 07/04/17 17:00, Phil wrote: > ...I'm now having a problem knowing when to use the "self" reference. self is needed every time you use an instance attribute or method. It is equivalent to 'this' in C++(or Java), but in Python it is never implicit you always have to explicitly specify self when

Re: [Tutor] Tkinter class question

2017-04-08 Thread Peter Otten
Phil wrote: > I've progressed a little further but I'm now having a problem knowing when > to use the "self" reference. In the following code, the function "ckeck" > is called without the need to press the "check" button. This didn't occur > before I sprinkled "selfs" into the code and added "arra

Re: [Tutor] Tkinter class question - refinement

2017-04-07 Thread Phil
On Sat, 8 Apr 2017 02:00:38 +1000 Phil wrote: If I define "e" lists before the class then everything works as I had expected, however, I don't that's technically correct. Or is it? -- Regards, Phil ___ Tutor maillist - Tutor@python.org To unsubscri

[Tutor] Tkinter class question

2017-04-07 Thread Phil
Thank you for reading this. I've progressed a little further but I'm now having a problem knowing when to use the "self" reference. In the following code, the function "ckeck" is called without the need to press the "check" button. This didn't occur before I sprinkled "selfs" into the code and