Welcome, guest | Sign In | My Account | Store | Cart
try:
    from Tkinter import BitmapImage, Checkbutton, Radiobutton
    from Tkconstants import *
except ImportError:
    from tkinter import BitmapImage, Checkbutton, Radiobutton
    from tkinter.constants import *

import base64

# Python 2 and 3 compatibility
try:
  basestring
except NameError:
  basestring = str

class Metro_Checkbutton(Checkbutton):
    image = { 
        16: 'I2RlZmluZSBpbWFnZV93aWR0aCAxNgojZGVmaW5lIGltYWdlX2hlaWdodCAxNgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4ZmYsMHhmZiwweDAxLDB4ODAsMHgwMSwweDgwLDB4MDEsMHg4MCwweDAxLDB4ODAsMHgwMSwweDgwLDB4MDEsMHg4MCwweDAxLAoweDgwLDB4MDEsMHg4MCwweDAxLDB4ODAsMHgwMSwweDgwLDB4MDEsMHg4MCwweDAxLDB4ODAsMHgwMSwweDgwLDB4MDEsMHg4MCwKMHhmZiwweGZmCn07',
        22: 'I2RlZmluZSBpbWFnZV93aWR0aCAyMgojZGVmaW5lIGltYWdlX2hlaWdodCAyMgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4MDAsMHgwMCwweDAwLDB4ZmYsMHhmZiwweDNmLDB4MDEsMHgwMCwweDIwLDB4MDEsMHgwMCwweDIwLDB4MDEsMHgwMCwweDIwLAoweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMCwKMHgwMSwweDAwLDB4MjAsMHgwMSwweDAwLDB4MjAsMHgwMSwweDAwLDB4MjAsMHgwMSwweDAwLDB4MjAsMHgwMSwweDAwLDB4MjAsCjB4MDEsMHgwMCwweDIwLDB4MDEsMHgwMCwweDIwLDB4MDEsMHgwMCwweDIwLDB4MDEsMHgwMCwweDIwLDB4MDEsMHgwMCwweDIwLAoweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMAp9Ow==',
        24: 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3LDB4MDAsMHhmZiwweDAzLDB4MDAsMHhlMCwweDA3LDB4MDAsMHhmZSwweDAxLDB4MDAsMHhlMCwKMHgwNywweDAwLDB4ZmMsMHgwMCwweDAwLDB4ZTAsMHgwNywweDAwLDB4NzgsMHgwMCwweDAwLDB4ZTAsMHgwNywweDAwLDB4MzAsCjB4MDAsMHgwMCwweGUwLDB4MDcsMHgwMCwweDAwLDB4MDAsMHgwMCwweGUwLDB4MDcsMHgwMCwweDAwLDB4MDAsMHgwMCwweGUwLAoweDA3LDB4MDAsMHgwMCwweDAwLDB4MDAsMHhlMCwweDA3LDB4MDAsMHgwMCwweDAwLDB4MDAsMHhlMCwweDA3LDB4MDAsMHgwMCwKMHgwMCwweDAwLDB4ZTAsMHgwNywweDAwLDB4MDAsMHgwMCwweDAwLDB4ZTAsMHgwNywweDAwLDB4MDAsMHgwMCwweDAwLDB4ZTAsCjB4MDcsMHgwMCwweDAwLDB4MDAsMHgwMCwweGUwLDB4ZmYsMHhmZiwweGZmLDB4ZmYsMHhmZiwweGZmLDB4ZmYsMHhmZiwweGZmLAoweGZmLDB4ZmYsMHhmZgp9Ow=='
    }

    def __init__(self, master, size=22, **kw):
        image = Metro_Checkbutton.image[size]
        
        if isinstance(image, basestring):
            Metro_Checkbutton.image[size] = image = BitmapImage(data=base64.b64decode(image))

        selectimage = Metro_Checkbutton.selectimage[size]
        
        if isinstance(selectimage, basestring):
            Metro_Checkbutton.selectimage[size] = selectimage = BitmapImage(data=base64.b64decode(selectimage))

        Checkbutton.__init__(self, master, indicatoron=0, selectimage=selectimage, image=image, highlightthickness=0, **kw)

class Metro_Radiobutton(Radiobutton):
    image = {
        16: 'I2RlZmluZSBpbWFnZV93aWR0aCAxNgojZGVmaW5lIGltYWdlX2hlaWdodCAxNgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4ZTAsMHgwNywweGY4LDB4MWYsMHgzYywweDNjLDB4MGUsMHg3MCwweDA2LDB4NjAsMHgwNywweGUw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weDAwLDB4MDAsMHg4MCwweGZmLAoweGZmLDB4MDEsMHgwMAp9Ow=='
    }

    selectimage = {
        16: 'I2RlZmluZSBpbWFnZV93aWR0aCAxNgojZGVmaW5lIGltYWdlX2hlaWdodCAxNgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4ZTAsMHgwNywweGY4LDB4MWYsMHgzYywweDNjLDB4MGUsMHg3MCwweDA2LDB4NjAsMHhjNywweGUzLDB4ZTMsMHhjNywweGUzLAoweGM3LDB4ZTMsMHhjNywweGUzLDB4YzcsMHhjNywweGUzLDB4MDYsMHg2MCwweDBlLDB4NzAsMHgzYywweDNjLDB4ZjgsMHgxZiwKMHhlMCwweDA3Cn07',
        22: 'I2RlZmluZSBpbWFnZV93aWR0aCAyMgojZGVmaW5lIGltYWdlX2hlaWdodCAyMgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4MDAsMHgzZiwweDAwLDB4ZTAsMHhmZiwweDAxLDB4ZjAsMHhmZiwweDAzLDB4ZjgsMHhjMCwweDA3LDB4M2MsMHgwMCwweDBmLAoweDFlLDB4MDAsMHgxZSwweDBlLDB4MDAsMHgxYywweDBlLDB4MWUsMHgxYywweDA3LDB4M2YsMHgzOCwweDg3LDB4N2YsMHgzOCwKMHg4NywweDdmLDB4MzgsMHg4NywweDdmLDB4MzgsMHg4NywweDdmLDB4MzgsMHgwNywweDNmLDB4MzgsMHgwZiwweDFlLDB4MWMsCjB4MGUsMHgwMCwweDFjLDB4MWUsMHgwMCwweDFlLDB4M2MsMHgwMCwweDBmLDB4ZjgsMHhjMCwweDA3LDB4ZjAsMHhmZiwweDAzLAoweGUwLDB4ZmYsMHgwMSwweDAwLDB4M2YsMHgwMAp9Ow==',
        24: 'I2RlZmluZSBpbWFnZV93aWR0aCAyNAojZGVmaW5lIGltYWdlX2hlaWdodCAyNApzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4MDAsMHg3ZSwweDAwLDB4YzAs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DB4ZmUsMHgwMywweDgwLDB4ZmYsMHgwMSwweDgwLDB4ZmYsMHgwMSwweDAwLDB4ZmYsMHgwZiwKMHhmMCwweGZmLDB4MDAsMHgwMCwweGZlLDB4ZmYsMHhmZiwweDdmLDB4MDAsMHgwMCwweGZjLDB4ZmYsMHhmZiwweDNmLDB4MDAsCjB4MDAsMHhmOCwweGZmLDB4ZmYsMHgxZiwweDAwLDB4MDAsMHhlMCwweGZmLDB4ZmYsMHgwNywweDAwLDB4MDAsMHg4MCwweGZmLAoweGZmLDB4MDEsMHgwMAp9Ow=='
    }

    def __init__(self, master, size=22, **kw):
        image = Metro_Radiobutton.image[size]
        
        if isinstance(image, basestring):
            Metro_Radiobutton.image[size] = image = BitmapImage(data=base64.b64decode(image))

        selectimage = Metro_Radiobutton.selectimage[size]
        
        if isinstance(selectimage, basestring):
            Metro_Radiobutton.selectimage[size] = selectimage = BitmapImage(data=base64.b64decode(selectimage))

        Radiobutton.__init__(self, master, indicatoron=0, selectimage=selectimage, image=image, highlightthickness=0, borderwidth=0, **kw)


if __name__ == "__main__":
    try:
        from Tkinter import Tk, StringVar, Frame
    except ImportError:
        from tkinter import Tk, StringVar, Frame

    root = Tk()
    root.geometry("200x300")
    root.configure(background="white")

    Metro_Checkbutton(root, background="white").pack(pady=10)

    var = StringVar()

    row = Frame(root, background="white")
    row.pack(pady=10)

    Metro_Radiobutton(row, background="white",variable=var, value="0").pack(side=LEFT)
    Metro_Radiobutton(row, background="white",variable=var, value="1").pack(side=LEFT, padx=(10,0))

    root.mainloop()

Diff to Previous Revision

--- revision 1 2017-04-12 23:23:33
+++ revision 2 2017-04-12 23:25:49
@@ -6,6 +6,12 @@
     from tkinter.constants import *
 
 import base64
+
+# Python 2 and 3 compatibility
+try:
+  basestring
+except NameError:
+  basestring = str
 
 class Metro_Checkbutton(Checkbutton):
     image = { 
@@ -87,5 +93,5 @@
 
     Metro_Radiobutton(row, background="white",variable=var, value="0").pack(side=LEFT)
     Metro_Radiobutton(row, background="white",variable=var, value="1").pack(side=LEFT, padx=(10,0))
-    
+
     root.mainloop()

History