Tkinter wrappers for TkTreeCtrl and Tile

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

    #1

    Tkinter wrappers for TkTreeCtrl and Tile

    I was looking at the Tcl/Tk sourceforge page and found that there were
    a couple of new widgets being produced for Tcl 8.5. Does anyone know if
    there are any Tkinter wrappers somewhere?

    thanks,

    Harlin

  • Martin Franklin

    #2
    Re: Tkinter wrappers for TkTreeCtrl and Tile

    Harlin Seritt wrote:[color=blue]
    > I was looking at the Tcl/Tk sourceforge page and found that there were
    > a couple of new widgets being produced for Tcl 8.5. Does anyone know if
    > there are any Tkinter wrappers somewhere?
    >
    > thanks,
    >
    > Harlin
    >[/color]

    Harlin,


    I can't see the web page saying these will be included in Tk 8.5 can you
    give me the URL?

    As far as wrappers go, if they don't exist (and I don't think they do)
    it is fairly easy to create them provided they are written in a very
    similar style to 'standard' Tk widgets. Somone usually steps up and
    patches Tkinter.py to include changes in the Tk core, but usually only
    when a new _final_ version is released...

    Martin.

    Comment

    • Harlin Seritt

      #3
      Re: Tkinter wrappers for TkTreeCtrl and Tile

      Martin,

      Take a look here:

      It is a well-known post from what I understand. You may have already
      seen it before. Actually, (as I'm looking at a 8.4 demo set from
      ActiveTcl distribution), it seems the Tree widget has been added to the
      8.4 set. I don't think the Tiles has been added just yet though.

      Harlin

      Comment

      • Martin Franklin

        #4
        Re: Tkinter wrappers for TkTreeCtrl and Tile

        Harlin Seritt wrote:[color=blue]
        > Martin,
        >
        > Take a look here:
        > http://mail.python.org/pipermail/tki...ch/000010.html
        > It is a well-known post from what I understand. You may have already
        > seen it before. Actually, (as I'm looking at a 8.4 demo set from
        > ActiveTcl distribution), it seems the Tree widget has been added to the
        > 8.4 set. I don't think the Tiles has been added just yet though.
        >
        > Harlin
        >[/color]


        Thanks, I must have missed it first time round...
        after more googling I did find a reference to Tile going
        into Tk 8.5 but it was not on the tcltk wiki recent changes
        for 8.5:



        Which made me think it will not go in.....

        Cheers,
        Martin.

        Comment

        • Harlin Seritt

          #5
          Re: Tkinter wrappers for TkTreeCtrl and Tile

          Martin,

          If I may ask, who actually works on the Tkinter module? Is there a
          certain group that does this? I'm just curious as I've never been able
          to find this information. I know there are, of course, someone who
          develops Tk but just not sure who does this on the Python side.

          Thanks,

          Harlin

          Comment

          • Martin Franklin

            #6
            Re: Tkinter wrappers for TkTreeCtrl and Tile

            Harlin Seritt wrote:[color=blue]
            > Martin,
            >
            > If I may ask, who actually works on the Tkinter module? Is there a
            > certain group that does this? I'm just curious as I've never been able
            > to find this information. I know there are, of course, someone who
            > develops Tk but just not sure who does this on the Python side.
            >
            > Thanks,
            >
            > Harlin
            >[/color]

            Harlin,

            There is no Tkinter group of core developers, if somthing needs doing
            then it is done by those who need it (AFAIK) I have made a few small
            patches to Tkinter.py in the past and will do so again should I need to


            I have been looking some more at Tile - it's come a long way in the
            last few months (since the last time I looked at it), I have even
            started writting a *test* wrapper for it (I first had to build tcl, tk,
            tile and python from source!)

            I have created a Style class (as a mixin like the Pack and Grid classes
            in Tkinter.py

            I have also wrapped the Tile.Button but right now it extends
            Tkinter.Widget class (as it is starting to look like a large chunk of
            work wrapping Tile from scratch;-)

            That said I have got a Tile Button example working (and I can change
            it's style) so perhaps not that much work

            I've cc'd the tkinter mailing list to see if there is any more interest
            over there...

            Cheers
            Martin

            Comment

            • Harlin Seritt

              #7
              Re: Tkinter wrappers for TkTreeCtrl and Tile

              (snip)[color=blue][color=green]
              >>That said I have got a Tile Button example working (and I can change
              >>it's style) so perhaps not that much work[/color][/color]

              Do you happen to have a sampling of this that I can get my hands on??
              [color=blue][color=green]
              >>I've cc'd the tkinter mailing list to see if there is any more[/color][/color]
              interest[color=blue][color=green]
              >>over there...[/color][/color]

              Thanks for doing so!

              Harlin

              Comment

              • Martin Franklin

                #8
                Re: Tkinter wrappers for TkTreeCtrl and Tile

                Harlin Seritt wrote:[color=blue]
                > (snip)
                >[color=green][color=darkred]
                >>>That said I have got a Tile Button example working (and I can change
                >>>it's style) so perhaps not that much work[/color][/color]
                >
                >
                > Do you happen to have a sampling of this that I can get my hands on??
                >
                >[color=green][color=darkred]
                >>>I've cc'd the tkinter mailing list to see if there is any more[/color][/color]
                >
                > interest
                >[color=green][color=darkred]
                >>>over there...[/color][/color]
                >
                >
                > Thanks for doing so!
                >
                > Harlin
                >[/color]


                Harlin,

                Sure here is all 90 lines of it:-


                ############### ############### ########


                import Tkinter
                from Tkconstants import *


                class Style:
                def default(self, style, **kw):
                """Sets the default value of the specified option(s) in style"""
                pass

                def map_style(self, **kw):
                """Sets dynamic values of the specified option(s) in style. See
                "STATE MAPS", below."""
                pass

                def layout(self, style, layoutSpec):
                """Define the widget layout for style style. See "LAYOUTS" below
                for the format of layoutSpec. If layoutSpec is omitted, return the
                layout specification for style style. """
                pass

                def element_create( self, name, type, *args):
                """Creates a new element in the current theme of type type. The
                only built-in element type is image (see image(n)), although
                themes may define other element types (see
                Ttk_RegisterEle mentFactory).
                """
                pass

                def element_names(s elf):
                """Returns a list of all elements defined in the current theme.
                """
                pass

                def theme_create(se lf, name, parent=None, basedon=None):
                """Creates a new theme. It is an error if themeName already
                exists.
                If -parent is specified, the new theme will inherit styles,
                elements,
                and layouts from the parent theme basedon. If -settings is
                present,
                script is evaluated in the context of the new theme as per
                style theme
                settings.
                """
                pass

                def theme_settings( self, name, script):
                """Temporar ily sets the current theme to themeName, evaluate
                script,
                then restore the previous theme. Typically script simply
                defines styles
                and elements, though arbitrary Tcl code may appear.
                """
                pass

                def theme_names(sel f):
                """Returns a list of the available themes. """
                return self.tk.call("s tyle", "theme", "names")

                def theme_use(self, theme):
                """Sets the current theme to themeName, and refreshes all
                widgets."""
                return self.tk.call("s tyle", "theme", "use", theme)



                class Button(Tkinter. Widget, Style):
                def __init__(self, master=None, cnf={}, **kw):
                master.tk.call( "package", "require", "tile")
                Tkinter.Widget. __init__(self, master, 'ttk::button', cnf, kw)

                class Treeview(Tkinte r.Widget):
                def __init__(self, master=None, cnf={}, **kw):
                master.tk.call( "package", "require", "tile")
                Tkinter.Widget. __init__(self, master, 'ttk::treeview' , cnf, kw)



                def callback():
                print "Hello"

                root = Tkinter.Tk()

                b = Button(root, text="Tile Button", command=callbac k)
                b.pack()

                print b.theme_names()

                b.theme_use("st ep")

                b1 = Tkinter.Button( root, text="Tk Button", command=callbac k)
                b1.pack()

                tree = Treeview(root)
                tree.pack()

                root.mainloop()


                ############### ###############

                Comment

                Working...