[Tkinter-discuss] ttk.Spinbox missing?

Michael Lange klappnase at web.de
Wed Jun 13 14:12:10 CEST 2012


Hi Mark,

Thus spoketh Mark Summerfield <list at qtrac.plus.com> 
unto us on Wed, 13 Jun 2012 11:41:03 +0100:

> > 
> > $ wish
> > % ttk::entry .e
> > .e
> > % ttk::spinbox .s
> > invalid command name "ttk::spinbox"
> > % 
> 
> I just tried the above (and then pack .e and pack .s) and it worked.
> 
> But I have 8.5.11.
> 
> So maybe it'll get wrapped Python 3.4 (since I guess it is too late for
> 3.3?)

I don't know who currently maintains Tkinter and how much time they have
to work on it, maybe it would help if someone wrote a patch.
>From a quick glance I think the spinbox might not require any more code
than the following snippet:

#################################################################
import ttk

class Spinbox(ttk.Entry):

    def __init__(self, master=None, **kw):
        ttk.Entry.__init__(self, master, "ttk::spinbox", **kw)

    def current(self, newindex=None):
        return self.tk.call(self._w, 'current', index)

    def set(self, value):
        return self.tk.call(self._w, 'set', value)
#################################################################

Can you store this to a file spinbox.py and then import the spinbox
widget from there and test if everything works? Maybe there still needs
some tweaking to be done to make all configuration options work properly
(as in ttk.Combobox).

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

There are some things worth dying for.
		-- Kirk, "Errand of Mercy", stardate 3201.7


More information about the Tkinter-discuss mailing list