Tkinter and Graphics

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew

    #1

    Tkinter and Graphics

    Hi I was wondering if there is anyway in Tkinter to create GUIs using
    Graphics, like windows media player or other tools like that

    basically so the interface wouldn't be your standard interface

    any ideas, links to tutorials, or examples

    is appreciated

    Cheers
  • Alex Martelli

    #2
    Re: Tkinter and Graphics

    Andrew <nobody@hotmail .com> wrote:
    [color=blue]
    > Hi I was wondering if there is anyway in Tkinter to create GUIs using
    > Graphics, like windows media player or other tools like that[/color]

    I guess you could do just about anything with Canvas, it that's what you
    mean.


    Alex

    Comment

    • John Hunter

      #3
      Re: Tkinter and Graphics

      >>>>> "Andrew" == Andrew <nobody@hotmail .com> writes:

      Andrew> Hi I was wondering if there is anyway in Tkinter to create
      Andrew> GUIs using Graphics, like windows media player or other
      Andrew> tools like that

      Andrew> basically so the interface wouldn't be your standard
      Andrew> interface

      Andrew> any ideas, links to tutorials, or examples

      Andrew> is appreciated

      This sounds like enthought's enable toolkit, which is still under
      development. Basically, they use the antigrain graphics library to
      develop their own GUI widgets, which can then be embedded in a tk
      graphic's canvas, at gtk drawing area, a wx panel, etc. Though enable
      doesn't support all of these GUIs currently, I believe, it can in
      principle.



      I've often wished for something like this in developing matplotlib,
      because a lot of work goes into supporting multiple GUIs, and it would
      be nice to have a core set of widgets that port across GUIs. Another
      approach is anygui, which I've been meaning to look into...

      JDH


      Comment

      • jmdeschamps

        #4
        Re: Tkinter and Graphics

        aleaxit@yahoo.c om (Alex Martelli) wrote in message news:<1gn98g2.1 uhohpdpev85hN%a leaxit@yahoo.co m>...[color=blue]
        > Andrew <nobody@hotmail .com> wrote:
        >[color=green]
        > > Hi I was wondering if there is anyway in Tkinter to create GUIs using
        > > Graphics, like windows media player or other tools like that[/color]
        >
        > I guess you could do just about anything with Canvas, it that's what you
        > mean.
        >
        >
        > Alex[/color]

        Such as this (below)
        (I made this while reading as an refresher for myself, since I'm doing
        mostly CGI and web related stuff these days!)

        Good interface design!!!

        JM

        ############### #
        import Tkinter

        bar = 1
        cursing = True

        def foo(s):
        global bar
        print bar
        bar += 1

        def baz(s):
        global cursing,rCanvas
        if cursing :
        cursing = False
        rCanvas.config( cursor="pirate" )
        else:
        cursing = True
        rCanvas.config( cursor="")

        root = Tkinter.Tk()
        rCanvas=Tkinter .Canvas(root, background="whi te")
        idPoly=rCanvas. create_polygon( 10,10,10,200,15 0,250,50,100)
        rCanvas.tag_bin d(idPoly,"<Butt on-1>",foo)
        rCanvas.tag_bin d(idPoly,"<Ente r>",baz)
        rCanvas.tag_bin d(idPoly,"<Leav e>",baz)
        rCanvas.pack()
        root.mainloop()
        ###############

        Comment

        • Chad Crabtree

          #5
          Re: Tkinter and Graphics

          Andrew <nobody@hotmail .com> wrote in message news:<10pf6ersh 138jbe@corp.sup ernews.com>...[color=blue]
          > Hi I was wondering if there is anyway in Tkinter to create GUIs using
          > Graphics, like windows media player or other tools like that
          >
          > basically so the interface wouldn't be your standard interface
          >
          > any ideas, links to tutorials, or examples
          >
          > is appreciated
          >
          > Cheers[/color]
          Check out wxPython ShapedWindow in the DEMO

          Comment

          • bsmith

            #6
            Re: Tkinter and Graphics

            On Sun, 14 Nov 2004 21:46:27 -0800, Andrew wrote:
            [color=blue]
            > Hi I was wondering if there is anyway in Tkinter to create GUIs using
            > Graphics, like windows media player or other tools like that
            >
            > basically so the interface wouldn't be your standard interface
            >
            > any ideas, links to tutorials, or examples
            >
            > is appreciated
            >
            > Cheers[/color]

            Highly recommended: _Python and Tkinter Programming_ by John E. Grayson,
            if you can find a copy. (It's out of stock on Manning's site and they
            don't offer it in Electronic form.)

            If you are interested in Python and Tkinter, you have probably noticed that although there is some good contributed documentation on the Web, there is not enough to get Tkinter applications up and running. Python and Tkinter Programming is the answer. It is designed for readers who are familiar with Python and who need to develop applications with Graphical User Interfaces (GUIs). Python and Tkinter Programming presents the elements of typical Python and Tkinter applications in a straight-forward fashion. Sample code illustrates each element. Complete applications that go far beyond the fill-the-form class of graphical user interfaces are presented; here you will find examples of complex controls, drawn interfaces and photorealistic panels. The code can readily be used as templates for new applications. Extensions to Python (such as ODBC) are examined as well.


            Section 8.7 ("Image Maps"), where the author describes building a GUI that
            looks like a TI-82, by using an image of same as the basis for the
            interface seems like it could be relevant.

            Chapter 9 ("Panels and Machines") also seems like it could be of help to
            you. It describes building a GUI modeled on the front panel of an actual
            device. It also contains a nice front-end for a digital multimeter with a
            rotating knob for setting the current range.

            Perhaps you can find a copy on amazon, ebay or a brick-and-mortar store
            with slow turn-over.

            // Ben


            Comment

            Working...