Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #31468
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <clinicalfilm@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'configure': 0.04; 'skip:` 10': 0.05; 'attributes': 0.07; 'classes.': 0.07; 'completeness': 0.07; 'width': 0.07; '40,': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.10; 'gui': 0.11; 'cases': 0.15; '????????': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'name...': 0.16; 'securities,': 0.16; 'subject:Tkinter': 0.16; 'subject:access': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'wrote:': 0.17; 'widget': 0.17; 'thanks,': 0.18; 'idea': 0.24; 'cc:2**1': 0.24; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'cc:addr:gmail.com': 0.27; 'accuracy': 0.27; 'label': 0.27; 'helpful.': 0.29; 'question:': 0.29; "i'm": 0.29; 'classes': 0.30; 'usually': 0.30; 'skip:\xd0 10': 0.33; 'venture': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'false': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'created': 0.36; 'but': 0.36; 'wanted': 0.36; 'method': 0.36; 'should': 0.36; 'uses': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'store': 0.38; 'easier': 0.38; 'sure': 0.38; 'instead': 0.39; 'little': 0.39; 'skip:" 10': 0.40; 'information,': 0.63; 'url:email': 0.63; 'here': 0.65; 'legal': 0.65; 'subject': 0.66; 'purchase': 0.67; '8bit%:100': 0.70; 'sale': 0.76; 'widgets:': 0.84; 'received:209.85.220.184': 0.91 |
| Newsgroups | comp.lang.python |
| Date | Tue, 16 Oct 2012 22:35:29 -0700 (PDT) |
| In-Reply-To | <mailman.2244.1350339981.27098.python-list@python.org> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=128.69.71.8; posting-account=xl9-GQoAAACPcxqjfxLnmwPQvAoNXyyR |
| References | <40621ce6-1b68-4cfa-8baf-cbfefce4f32b@googlegroups.com> <mailman.2244.1350339981.27098.python-list@python.org> |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| X-Google-IP | 128.69.71.8 |
| MIME-Version | 1.0 |
| Subject | Re: Tkinter how to access the widget by name |
| From | Владимир Пылев <clinicalfilm@gmail.com> |
| To | comp.lang.python@googlegroups.com |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | Владимир Пылев <clinicalfilm@gmail.com>, "python-list@python.org" <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Message-ID | <mailman.2322.1350452138.27098.python-list@python.org> (permalink) |
| Lines | 125 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1350452138 news.xs4all.nl 6862 [2001:888:2000:d::a6]:60965 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:31468 |
Show key headers only | View raw
вторник, 16 октября 2012 г., 2:26:22 UTC+4 пользователь Prasad, Ramit написал:
> ???????? ????? wrote:
>
> > I'm a little teapot ... himself the question: if I want to appeal to the widget, knowing his name... ?
>
> >
>
> > # appropriated the name of the widget
>
> > label = Label(frame, width = 40, text='text', name = 'name')
>
> > ...
>
> > name_='name'
>
> > configure(name_)
>
> > ...
>
> > def configure(name_)
>
> > #And how can that be?
>
> > # At least let the text you want to change ....
>
> >
>
> > I beg you ..!!!!
>
> > --
>
>
>
> I am unfamiliar with Tkinter, so this might not be very helpful.
>
>
>
> Usually with the GUI I have created before I uses classes and store
>
> the widgets inside the classes. That makes it easier to use
>
> `self.widgetname` or `getattr(self, widgetname)`. If that is not
>
> something you can instead store the attributes in a list/dictionary.
>
> In both cases make sure not to have multiple widgets created with
>
> the same name.
>
>
>
> Note the following is all untested and should be considered pseudo-code.
>
>
>
> widgets = {}
>
> label = Label(frame, width = 40, text='text', name = 'name')
>
> widgets['name'] = label
>
>
>
> def configure(name_):
>
> widget = widgets[name_]
>
>
>
> OR
>
>
>
> widgets = []
>
> label = Label(frame, width = 40, text='text', name = 'name')
>
> widgets.append( label )
>
>
>
> def configure(name_):
>
> found = False
>
> for w in widgets:
>
> if w.name == name_: # No idea how to get name from Tk widget
>
> found = True
>
> break
>
> if found:
>
> # configure here
>
>
>
>
>
> Ramit Prasad
>
>
>
>
>
> This email is confidential and subject to important disclaimers and
>
> conditions including on offers for the purchase or sale of
>
> securities, accuracy and completeness of information, viruses,
>
> confidentiality, legal privilege, and legal entity disclaimers,
>
> available at http://www.jpmorgan.com/pages/disclosures/email.
ok thanks, that this method is suitable in full: "widgets.append( label )" , аlthough at the beginning wanted to access the widget by its internal name, but I left this venture )).
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Tkinter how to access the widget by name Владимир Пылев <clinicalfilm@gmail.com> - 2012-10-14 13:11 -0700
RE: Tkinter how to access the widget by name "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-15 22:26 +0000
Re: Tkinter how to access the widget by name Владимир Пылев <clinicalfilm@gmail.com> - 2012-10-16 22:35 -0700
Re: Tkinter how to access the widget by name Владимир Пылев <clinicalfilm@gmail.com> - 2012-10-16 22:35 -0700
Re: Tkinter how to access the widget by name woooee <woooee@gmail.com> - 2012-10-16 18:52 -0700
csiph-web