How to change tkinter GUI look-and-feel?

Discussion in 'Python' started by Jonathon McKitrick, May 6, 2004.

  1. I saw some screenshots of mayavi. Is there any way we can set tkinter to
    use the motif (or some other toolkit under Unix) rather than the default?

    jm
    --
    My other computer is your Windows box.
     
    Jonathon McKitrick, May 6, 2004
    #1
    1. Advertising

  2. Jonathon McKitrick

    Eric Brunel Guest

    Jonathon McKitrick wrote:
    > I saw some screenshots of mayavi. Is there any way we can set tkinter to
    > use the motif (or some other toolkit under Unix) rather than the default?
    >
    > jm


    Motif *is* the default look for tk/Tkinter on Unix. I also saw some screenshots
    of Mayavi, and I also noticed the NextStep look they had for their tk widgets. I
    don't exactly know how they did that; I know there is a very old branch of tk
    named tkstep that had this look, but it has been unsupported for years. Or maybe
    they hacked the current Tkinter to support the new "tile" package for tk which
    allows to apply themes to tk widgets? Maybe one of the MayaVi people would like
    to enlighten us?

    Anyway, downloading Mayavi sources and using your own Tkinter should not show
    this look for the widgets, but the more "standard" Motif look.

    HTH
    --
    - Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
    PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com
     
    Eric Brunel, May 7, 2004
    #2
    1. Advertising

  3. Jonathon McKitrick

    klappnase Guest

    Jonathon McKitrick <> wrote in message news:<>...
    > I saw some screenshots of mayavi. Is there any way we can set tkinter to
    > use the motif (or some other toolkit under Unix) rather than the default?
    >
    > jm


    Hi Jonathon,

    you cannot make Tkinter use another toolkit (of course); if you mean
    just to change the look and feel you can use the tk_strictMotif()
    method to get a quite "native" motif look and feel:

    from Tkinter import *
    root = Tk()
    root.tk_strictMotif()

    or use an optionDB file if you just want to do an application wide
    change of tk's sometimes ugly defaults on unix:

    from Tkinter import *
    root = Tk()
    root.option_readfile(path-to-your-optionDB)

    The contents of the optionDB may look like this:
    ########-file optionDB-##############################
    *font : Helvetica -12
    *Entry*background : white
    *Listbox*background : white
    *Listbox*exportSelection : 0
    *selectBackground : #a0a
    *selectForeground : white
    *Scrollbar*Width : 12
    *Scrollbar*troughColor : #aaa
    *Scrollbar*takeFocus : 0
    *Checkbutton*selectColor : green
    *Radiobutton*selectColor : green
    *Menu*tearOff : 0
    *Menu*relief : ridge
    *Menu*borderWidth : 2
    *Button*Width : 10
    ######################################################
    That's an optionDB I've been using, I think you'll see the point how
    to change the default values of configuration options for different
    widgets.

    I hope this helps

    Michael
     
    klappnase, May 7, 2004
    #3
  4. Jonathon McKitrick

    j_mckitrick Guest

    That's a good start, thanks!
     
    j_mckitrick, May 7, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nick

    Consistent Look and Feel

    Nick, Jan 14, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    403
  2. Marina
    Replies:
    3
    Views:
    397
    Marina
    Jan 28, 2004
  3. fishfry
    Replies:
    2
    Views:
    863
    Tom N
    Mar 1, 2004
  4. Guest
    Replies:
    6
    Views:
    7,209
    G Winstanley
    Oct 1, 2004
  5. Martin

    Change Tkinter Look and Feel?

    Martin, Jul 17, 2004, in forum: Python
    Replies:
    1
    Views:
    564
    klappnase
    Jul 17, 2004
Loading...

Share This Page