Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I haven't lost my mind -- it's backed up on tape somewhere.


devel / comp.lang.python / Tkinter module test: widget class not inserted in application frame

SubjectAuthor
* Tkinter module test: widget class not inserted in applicationRich Shepard
`* Re: Tkinter module test: widget class not inserted in application frameDennis Lee Bieber
 +- Re: Tkinter module test: widget class not inserted in applicationRich Shepard
 +- Re: Tkinter module test: widget class not inserted in applicationPeter J. Holzer
 `- Re: Tkinter module test: widget class not inserted in applicationRich Shepard

1
Tkinter module test: widget class not inserted in application frame

<mailman.639.1655483228.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18630&group=comp.lang.python#18630

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: rshep...@appl-ecosys.com (Rich Shepard)
Newsgroups: comp.lang.python
Subject: Tkinter module test: widget class not inserted in application
frame
Date: Fri, 17 Jun 2022 09:19:59 -0700 (PDT)
Lines: 88
Message-ID: <mailman.639.1655483228.20749.python-list@python.org>
References: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com>
Reply-To: Rich Shepard <rshepard@appl-ecosys.com>
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
X-Trace: news.uni-berlin.de 53bw/nlozpCVB4R1OOCmggISxo3EBo8DtxgCOVKwfDfQ==
Return-Path: <rshepard@appl-ecosys.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '17,': 0.04; 'def': 0.04;
'traceback': 0.04; '(most': 0.05; 'last):': 0.05;
'subject:module': 0.07; 'tkinter': 0.07; 'subject:class': 0.09;
'subject:not': 0.09; 'subject:test': 0.09; 'widgets': 0.09;
'import': 0.15; 'column': 0.16; 'dict': 0.16; 'from:addr:appl-
ecosys.com': 0.16; 'from:addr:rshepard': 0.16; 'from:name:rich
shepard': 0.16; 'master,': 0.16; 'received:50.126': 0.16;
'received:50.126.108': 0.16; 'received:50.126.108.78': 0.16;
'received:appl-ecosys.com': 0.16; 'received:mail.appl-ecosys.com':
0.16; 'skip:" 60': 0.16; 'subject:application': 0.16; 'testing.':
0.16; 'python': 0.16; 'to:addr:python-list': 0.20; 'input': 0.21;
'skip:_ 10': 0.22; 'object': 0.26; 'error': 0.29; 'module': 0.31;
'false,': 0.32; "i'm": 0.33; '----------': 0.33; 'track': 0.35;
'source': 0.36; "skip:' 10": 0.37; 'class': 0.37; 'file': 0.38;
'seeing': 0.39; 'skip:o 10': 0.61; 'skip:b 20': 0.63; 'pass':
0.64; 'height': 0.64; 'skip:w 20': 0.69;
'received:localhost.localdomain': 0.76; 'header:Reply-To:1': 0.79;
'received:localdomain': 0.81; '-----------': 0.84; 'attribute':
0.84; 'skip:" 40': 0.84; 'subject: \n ': 0.84; 'placing': 0.91
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com>
 by: Rich Shepard - Fri, 17 Jun 2022 16:19 UTC

I'm not seeing the error source in a small tkinter module I'm testing.

The module code:
-----------
import tkinter as tk
from tkinter import ttk

import common_classes as cc

class ConactNameInput(tk.Frame):
def __init__(self, parent, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
# A dict to keep track of input widgets
self.inputs = {}

self.inputs['Last name'] = cc.LabelInput(
ContactNameInput, 'lname',
input_class = ttk.Entry,
input_var = tk.StringVar()
)
self.inputs['Last name'].grid(row = 0, column = 0)
#
self.inputs['First name'] = cc.LabelInput(
ContactNameInput, 'fname',
input_class = ttk.Entry,
input_var = tk.StringVar()
)
self.inputs['First name'].grid(row = 0, column = 1)

okay_button = tk.Button(self, text="OK",
command=self.ok)
okay_button.pack(side=tk.LEFT, padx=(20, 0), pady=(0, 20))

cancel_button = tk.Button(self, text="Cancel",
command=self.cancel)
cancel_button.pack(side=tk.RIGHT, padx=(0, 20), pady=(0, 20))

def okay_button(self):
pass

def cancel_button(self):
Quitter()

def get_last_name(self):
pass

def get_first_name(self):
pass

class NameApplication(tk.Tk):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.title("Contact Name")
self.geometry("800x600")
self.resizable(width = False, height = False)
ContactNameInput(self).grid(row = 0, column = 0, sticky=('EWNS'))
self.columnconfigure(0, weight=1)

if __name__ == '__main__':
app = NameApplication()
app.mainloop()
----------

The python error traceback:
----------
Traceback (most recent call last):
File "contact_history_name_input.py", line 60, in <module>
app = NameApplication()
File "contact_history_name_input.py", line 55, in __init__
ContactNameInput(self).grid(row = 0, column = 0, sticky=('EWNS'))
File "contact_history_name_input.py", line 17, in __init__
input_var = tk.StringVar()
File "/home/rshepard/development/BusinessTracker/views/common_classes.py", line 46, in __init__
super().__init__(parent, **kwargs)
File "/usr/lib64/python3.7/tkinter/__init__.py", line 2744, in __init__
Widget.__init__(self, master, 'frame', cnf, {}, extra)
File "/usr/lib64/python3.7/tkinter/__init__.py", line 2292, in __init__
BaseWidget._setup(self, master, cnf)
File "/usr/lib64/python3.7/tkinter/__init__.py", line 2262, in _setup
self.tk = master.tk
AttributeError: type object 'ContactNameInput' has no attribute 'tk'
----------

I'm not correctly placing the NameInput class in the NameApplication frame.
What have I missed?

Rich

Re: Tkinter module test: widget class not inserted in application frame

<2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18638&group=comp.lang.python#18638

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 17 Jun 2022 19:45:49 -0500
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: Tkinter module test: widget class not inserted in application frame
Date: Fri, 17 Jun 2022 20:45:49 -0400
Organization: IISS Elusive Unicorn
Message-ID: <2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>
References: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com> <mailman.639.1655483228.20749.python-list@python.org>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 30
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-8SzzwCwwsnv6RjlN5k0XKajaADlMiGoMcAft6CrOiktnrH14vdyWrtOvb8KmHvcpy5+9WmyWyzA2iy7!VvOw5BtLXUicOcJD53o3/MU8GDH+pFhrSVJHYFUKckx/YT7EzXQeuLUhp99AJtvh3BzLvD3T
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1920
 by: Dennis Lee Bieber - Sat, 18 Jun 2022 00:45 UTC

On Fri, 17 Jun 2022 09:19:59 -0700 (PDT), Rich Shepard
<rshepard@appl-ecosys.com> declaimed the following:

>I'm not seeing the error source in a small tkinter module I'm testing.
>
>The module code:
>-----------
>import tkinter as tk
>from tkinter import ttk
>
>import common_classes as cc
>
>class ConactNameInput(tk.Frame):

Presuming this is a cut&paste of the actual code...

> ContactNameInput, 'lname',

> ContactNameInput, 'fname',

> ContactNameInput(self).grid(row = 0, column = 0, sticky=('EWNS'))

.... please compare the spelling!

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: Tkinter module test: widget class not inserted in application frame

<mailman.648.1655520460.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18640&group=comp.lang.python#18640

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: rshep...@appl-ecosys.com (Rich Shepard)
Newsgroups: comp.lang.python
Subject: Re: Tkinter module test: widget class not inserted in application
frame
Date: Fri, 17 Jun 2022 19:47:38 -0700 (PDT)
Lines: 13
Message-ID: <mailman.648.1655520460.20749.python-list@python.org>
References: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com>
<mailman.639.1655483228.20749.python-list@python.org>
<2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>
<245cf147-f9e1-fc75-aad0-e8dca81b96e0@appl-ecosys.com>
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
X-Trace: news.uni-berlin.de pLa0YxtSdW8mgbHgi08ruQKAGhBLt6tiu+cC0+sBL4Iw==
Return-Path: <rshepard@appl-ecosys.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:module': 0.07;
'subject:class': 0.09; 'subject:not': 0.09; 'subject:test': 0.09;
'syntax': 0.15; '2022,': 0.16; 'from:addr:appl-ecosys.com': 0.16;
'from:addr:rshepard': 0.16; 'from:name:rich shepard': 0.16;
'received:50.126': 0.16; 'received:50.126.108': 0.16;
'received:50.126.108.78': 0.16; 'received:appl-ecosys.com': 0.16;
'received:mail.appl-ecosys.com': 0.16; 'subject:application':
0.16; 'wrote:': 0.16; 'to:addr:python-list': 0.20; 'fri,': 0.22;
'jun': 0.26; 'header:In-Reply-To:1': 0.34; 'thanks,': 0.36;
'taught': 0.64; 'received:localhost.localdomain': 0.76;
'received:localdomain': 0.81; 'subject: \n ': 0.84
In-Reply-To: <2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <245cf147-f9e1-fc75-aad0-e8dca81b96e0@appl-ecosys.com>
X-Mailman-Original-References: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com>
<mailman.639.1655483228.20749.python-list@python.org>
<2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>
 by: Rich Shepard - Sat, 18 Jun 2022 02:47 UTC

On Fri, 17 Jun 2022, Dennis Lee Bieber wrote:

>> ContactNameInput, 'lname',
>> ContactNameInput, 'fname',

This works if a tk.labelframe is where the widget is placed. In my case, as
MRAB taught me, the proper syntax is
self,'lname'...
self.'fname'...

Thanks, Dennis,

Rich

Re: Tkinter module test: widget class not inserted in application frame

<mailman.649.1655540146.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18642&group=comp.lang.python#18642

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-pyt...@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: Tkinter module test: widget class not inserted in application
frame
Date: Sat, 18 Jun 2022 10:10:34 +0200
Lines: 56
Message-ID: <mailman.649.1655540146.20749.python-list@python.org>
References: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com>
<mailman.639.1655483228.20749.python-list@python.org>
<2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>
<245cf147-f9e1-fc75-aad0-e8dca81b96e0@appl-ecosys.com>
<20220618081034.adyhgyae5n3ln3fm@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="ktvbzd3il4rjvlp3"
X-Trace: news.uni-berlin.de yJFVqMO47EzR6RjsnZKnvQSUXwlyTqGGRvylYadIcM7Q==
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'content-
type:multipart/signed': 0.05; 'subject:module': 0.07; '-0700,':
0.09; 'content-type:application/pgp-signature': 0.09;
'filename:fname piece:asc': 0.09; 'filename:fname
piece:signature': 0.09; 'filename:fname:signature.asc': 0.09;
'subject:class': 0.09; 'subject:not': 0.09; 'subject:test': 0.09;
'syntax': 0.15; '"creative': 0.16; '2022,': 0.16; '__/': 0.16;
'challenge!"': 0.16; 'from:addr:hjp-python': 0.16;
'from:addr:hjp.at': 0.16; 'from:name:peter j. holzer': 0.16;
'hjp@hjp.at': 0.16; 'holzer': 0.16; 'reality.': 0.16; 'shepard':
0.16; 'stross,': 0.16; 'subject:application': 0.16; 'url-
ip:212.17.106.137/32': 0.16; 'url-ip:212.17.106/24': 0.16; 'url-
ip:212.17/16': 0.16; 'url:hjp': 0.16; '|_|_)': 0.16; 'wrote:':
0.16; 'to:addr:python-list': 0.20; 'fri,': 0.22; 'space': 0.26;
'jun': 0.26; 'sense': 0.28; 'think': 0.32; 'there': 0.33; 'header
:In-Reply-To:1': 0.34; 'here.': 0.61; 'received:212': 0.62;
'here': 0.62; 'taught': 0.64; 'received:userid': 0.66; 'url-
ip:212/8': 0.69; 'received:at': 0.84; 'subject: \n ': 0.84
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <245cf147-f9e1-fc75-aad0-e8dca81b96e0@appl-ecosys.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <20220618081034.adyhgyae5n3ln3fm@hjp.at>
X-Mailman-Original-References: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com>
<mailman.639.1655483228.20749.python-list@python.org>
<2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>
<245cf147-f9e1-fc75-aad0-e8dca81b96e0@appl-ecosys.com>
 by: Peter J. Holzer - Sat, 18 Jun 2022 08:10 UTC
Attachments: signature.asc (application/pgp-signature)

On 2022-06-17 19:47:38 -0700, Rich Shepard wrote:
> On Fri, 17 Jun 2022, Dennis Lee Bieber wrote:
>
> > > ContactNameInput, 'lname',
> > > ContactNameInput, 'fname',
>
> This works if a tk.labelframe is where the widget is placed. In my case, as
> MRAB taught me, the proper syntax is
> self,'lname'...

There is a comma (U+002C) here ...

> self.'fname'...

And a dot (U+002E) here.

I don't think this is correct.

I would also recommend to always add a space after a comma.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

Attachments: signature.asc (application/pgp-signature)
Re: Tkinter module test: widget class not inserted in application frame

<mailman.650.1655553986.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18643&group=comp.lang.python#18643

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: rshep...@appl-ecosys.com (Rich Shepard)
Newsgroups: comp.lang.python
Subject: Re: Tkinter module test: widget class not inserted in application
frame
Date: Sat, 18 Jun 2022 05:06:22 -0700 (PDT)
Lines: 11
Message-ID: <mailman.650.1655553986.20749.python-list@python.org>
References: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com>
<mailman.639.1655483228.20749.python-list@python.org>
<2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>
<245cf147-f9e1-fc75-aad0-e8dca81b96e0@appl-ecosys.com>
<20220618081034.adyhgyae5n3ln3fm@hjp.at>
<e19952c-118c-20b9-f541-c5b712c2e5d@appl-ecosys.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
X-Trace: news.uni-berlin.de Rt3RmM4omFt4uTrci9M0kQCtL3VIOrIwas/M70nONWVA==
Return-Path: <rshepard@appl-ecosys.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:module': 0.07;
'subject:class': 0.09; 'subject:not': 0.09; 'subject:test': 0.09;
'2022,': 0.16; 'from:addr:appl-ecosys.com': 0.16;
'from:addr:rshepard': 0.16; 'from:name:rich shepard': 0.16;
'holzer': 0.16; 'received:50.126': 0.16; 'received:50.126.108':
0.16; 'received:50.126.108.78': 0.16; 'received:appl-ecosys.com':
0.16; 'received:mail.appl-ecosys.com': 0.16; 'signs,': 0.16;
'subject:application': 0.16; 'wrote:': 0.16; 'to:addr:python-
list': 0.20; 'sat,': 0.22; 'space': 0.26; 'jun': 0.26; 'there':
0.33; 'header:In-Reply-To:1': 0.34; 'wrote': 0.39; 'here.': 0.61;
'here': 0.62; 'surrounding': 0.69;
'received:localhost.localdomain': 0.76; 'received:localdomain':
0.81; 'subject: \n ': 0.84
In-Reply-To: <20220618081034.adyhgyae5n3ln3fm@hjp.at>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <e19952c-118c-20b9-f541-c5b712c2e5d@appl-ecosys.com>
X-Mailman-Original-References: <fdaa17b-5836-be36-4033-6d2c9baf9a5@appl-ecosys.com>
<mailman.639.1655483228.20749.python-list@python.org>
<2t7qah1dhkk424kpqh16k562qm41gj3qbk@4ax.com>
<245cf147-f9e1-fc75-aad0-e8dca81b96e0@appl-ecosys.com>
<20220618081034.adyhgyae5n3ln3fm@hjp.at>
 by: Rich Shepard - Sat, 18 Jun 2022 12:06 UTC

On Sat, 18 Jun 2022, Peter J. Holzer wrote:

> There is a comma (U+002C) here ...
> And a dot (U+002E) here.

That was a typo when I wrote the message. And I usually add a space after
commas and surrounding equal signs, all for easier reading.

Thank you,

Rich

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor