#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    145
    Rep Power
    10

    Tkinter -- XP Themes


    Hi, I have been having a go at creating GUI's in python, using tkinter, however is there a way to make my programs have XP style buttons/scrollbars etc if the client is running XP? Currently my GUI's all look like a 9x (apart from the title bar) even if I am running XP. When I did some TCL (which was a while ago) I used TK to create some GUI's and the buttons then were XP style, if run under windows xp. Does anyone know if this is possible using Tkinter.
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    The simple answer is no.

    Are you sure about TCL? Tkinter uses a TK widget set which is independent of the platform it is running on. It has always been a complaint about Tkinter.

    You will have more luck with wxPython it is a more modern widget set and uses the native stuff where possible.

    grim

    Comments on this post

    • CyBerHigh agrees
    Last edited by Grim Archon; June 3rd, 2005 at 06:18 AM.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    145
    Rep Power
    10
    Lots of people have suggested wxPython, and it seems really good. However from what I read in one of my Python books and on the Python website TK is the de facto standard for creating GUI's in python. Does wxPython come with a normal Python distribution, and if not is there a way I can include it in the scripts I distribute?
  6. #4
  7. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    There is no problem bundling wxPython with your applications at least on a Window platforms. If you want to have it run on Linux then you obviously need to make sure wxWindows and wxPython are installed - They are usually available as packages.

    (Side Note: On Linux you can't assume Tkinter is installed either - it is also an optional package that usually has many dependencies - but it still easier to install that wxPython )

    Here is what I do for Windows apps:

    My set-up is based on Python 2.3 because I like to use Boa Constructor which is an IDE for Python/wxPython. (Tip - if you want to use Boa make sure that you install the version of wxPython it recommends).

    I use Py2exe to compile the .exe - with no special handling required for wxPython. - all the files needed for distribution are picked up by py2exe.

    I use INNO to produce a self installing package. (In fact I use the py2exe set-up script to also write the Inno installer script and then launch it - a poor man's way to get simple file versioning).
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    145
    Rep Power
    10
    May be a tad of-topic here, sorry if it is.
    Does py2exe create executables in a real binary sense, or does it just 'bundle' a python interpreter along with the needed modules?
  10. #6
  11. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Originally Posted by EvilGuru
    May be a tad of-topic here, sorry if it is.
    Does py2exe create executables in a real binary sense, or does it just 'bundle' a python interpreter along with the needed modules?
    Py2exe and Py2app etc. work by bundle the interpreter. Sadly this is the only way to do it right now . Check out their homepages for more:

    http://starship.python.net/crew/theller/py2exe/
    http://undefined.org/python/py2app.html

    Take care,

    Mark.
    programming language development: www.netytan.com Hula

  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    in the sence both are true. The executible is as binary as binary gets. It is just no the kind of binary file that you would get if you compiled say a c++ program. However it is a binary file that is executed like a binary file, it is just that it executes into an interpriter of python and then interprites the python code to machin code. Where as a normal c++ app would lunch the already machin code app.

    just a way to put it in a more general prospective. However Netytan is right as well.

IMN logo majestic logo threadwatch logo seochat tools logo