Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41561

Re: Python GUI questions

Newsgroups comp.lang.python
Date 2013-03-19 20:06 -0700
References <4250fe44-c09c-48a8-aca2-51c1a8bc3a48@googlegroups.com> <e745739b-a9bb-49a3-8a06-1b4ae3f4d901@googlegroups.com> <262b7363-f980-4926-bb36-1f795769b359@googlegroups.com> <495e8e74-2211-4a82-a632-61e1cd16f854@l16g2000yqe.googlegroups.com> <e5f572a7-9e30-401e-b3a6-c4bf4dceeb83@googlegroups.com>
Message-ID <96c80660-a4ec-41ad-9205-4d615d452229@googlegroups.com> (permalink)
Subject Re: Python GUI questions
From Rick Johnson <rantingrickjohnson@gmail.com>

Show all headers | View raw


On Tuesday, March 19, 2013 9:36:28 PM UTC-5, maiden129 wrote:

> So should I redo my other code that I created with
> the radioButtons to change the colors of a text?

I believe so. Although you really should explain what your trying to achieve with this code. There is nothing wrong with wrapping some widgets into a single reusable class, however, your examples look more like more "using a hammer to drive screws".

For instance, you have two classes named "button" and "word" (psst: those identifiers should start with a capitol letter BTW!) which are basically two independent Tkinter root windows (even though they don't inherit from Tkinter.Tk). 

"Tkinter.Tk" is meant to be used as the first window, from there you can add as many sub-frames, sub-widgets, or even sub-windows (instances of Tkinter.Toplevel) as you want. 

If you want more than one window, for your GUI application, then instance as many "Tkinter.Toplevel" windows as you like AFTER you create the ONE AND ONLY Tkinter.Tk window.

If however you want to "group" a number of widgets inside a single window, then use the "Tkinter.Frame" to hold them.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python GUI  questions maiden129 <sengokubasarafever@gmail.com> - 2013-03-19 12:01 -0700
  Re: Python GUI questions Chris Angelico <rosuav@gmail.com> - 2013-03-20 08:39 +1100
    Re: Python GUI questions maiden129 <sengokubasarafever@gmail.com> - 2013-03-19 15:50 -0700
    Re: Python GUI questions maiden129 <sengokubasarafever@gmail.com> - 2013-03-19 15:50 -0700
  Re: Python GUI  questions Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-19 17:57 -0700
    Re: Python GUI  questions maiden129 <sengokubasarafever@gmail.com> - 2013-03-19 18:25 -0700
      Re: Python GUI questions Ranting Rick <rantingrickjohnson@gmail.com> - 2013-03-19 19:16 -0700
        Re: Python GUI questions maiden129 <sengokubasarafever@gmail.com> - 2013-03-19 19:36 -0700
          Re: Python GUI questions Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-19 20:06 -0700
        Re: Python GUI questions Terry Reedy <tjreedy@udel.edu> - 2013-03-19 23:21 -0400
          Re: Python GUI questions Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-20 10:37 -0700
      Re: Python GUI questions Jason Swails <jason.swails@gmail.com> - 2013-03-19 22:14 -0400
  Re: Python GUI  questions Jan Riechers <janpeterr@freenet.de> - 2013-03-31 16:33 +0300

csiph-web