Advertisement
here2share

# Tk_Custom_Checkbutton_And_Radiobuttons.py

May 13th, 2020
1,546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 20.21 KB | None | 0 0
  1. # Tk_Custom_Checkbutton_And_Radiobuttons.py
  2.  
  3. try:
  4.     from Tkinter import BitmapImage, Checkbutton, Radiobutton
  5.     from Tkconstants import *
  6. except ImportError:
  7.     from tkinter import BitmapImage, Checkbutton, Radiobutton
  8.     from tkinter.constants import *
  9.  
  10. import base64
  11.  
  12. # Python 2 and 3 compatibility
  13. try:
  14.   basestring
  15. except NameError:
  16.   basestring = str
  17.  
  18. class Metro_Checkbutton(Checkbutton):
  19.     image = {
  20.         16: 'I2RlZmluZSBpbWFnZV93aWR0aCAxNgojZGVmaW5lIGltYWdlX2hlaWdodCAxNgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4ZmYsMHhmZiwweDAxLDB4ODAsMHgwMSwweDgwLDB4MDEsMHg4MCwweDAxLDB4ODAsMHgwMSwweDgwLDB4MDEsMHg4MCwweDAxLAoweDgwLDB4MDEsMHg4MCwweDAxLDB4ODAsMHgwMSwweDgwLDB4MDEsMHg4MCwweDAxLDB4ODAsMHgwMSwweDgwLDB4MDEsMHg4MCwKMHhmZiwweGZmCn07',
  21.         22: 'I2RlZmluZSBpbWFnZV93aWR0aCAyMgojZGVmaW5lIGltYWdlX2hlaWdodCAyMgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4MDAsMHgwMCwweDAwLDB4ZmYsMHhmZiwweDNmLDB4MDEsMHgwMCwweDIwLDB4MDEsMHgwMCwweDIwLDB4MDEsMHgwMCwweDIwLAoweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMCwweDAxLDB4MDAsMHgyMCwKMHgwMSwweDAwLDB4MjAsMHgwMSwweDAwLDB4MjAsMHgwMSwweDAwLDB4MjAsMHgwMSwwe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weDAwLDB4ZTAsMHgwNywweGY4LDB4ZmYsMHg3ZiwweDAwLDB4ZTAsMHgwNywweGYwLDB4ZmYsMHgzZiwweDAwLDB4ZTAsCjB4MDcsMHhlMCwweGZmLDB4MWYsMHgwMCwweGUwLDB4MDcsMHhjMCwweGZmLDB4MGYsMHgwMCwweGUwLDB4MDcsMHg4MCwweGZmLAoweDA3LDB4MDAsMHhlMCwweDA3LDB4MDAsMHhmZiwweDAzLDB4MDAsMHhlMCwweDA3LDB4MDAsMHhmZSwweDAxLDB4MDAsMHhlMCwKMHgwNywweDAwLDB4ZmMsMHgwMCwweDAwLDB4ZTAsMHgwNywweDAwLDB4NzgsMHgwMCwweDAwLDB4ZTAsMHgwNywweDAwLDB4MzAsCjB4MDAsMHgwMCwweGUwLDB4MDcsMHgwMCwweDAwLDB4MDAsMHgwMCwweGUwLDB4MDcsMHgwMCwweDAwLDB4MDAsMHgwMCwweGUwLAoweDA3LDB4MDAsMHgwMCwweDAwLDB4MDAsMHhlMCwweDA3LDB4MDAsMHgwMCwweDAwLDB4MDAsMHhlMCwweDA3LDB4MDAsMHgwMCwKMHgwMCwweDAwLDB4ZTAsMHgwNywweDAwLDB4MDAsMHgwMCwweDAwLDB4ZTAsMHgwNywweDAwLDB4MDAsMHgwMCwweDAwLDB4ZTAsCjB4MDcsMHgwMCwweDAwLDB4MDAsMHgwMCwweGUwLDB4ZmYsMHhmZiwweGZmLDB4ZmYsMHhmZiwweGZmLDB4ZmYsMHhmZiwweGZmLAoweGZmLDB4ZmYsMHhmZgp9Ow=='
  33.     }
  34.  
  35.     def __init__(self, master, size=22, **kw):
  36.         image = Metro_Checkbutton.image[size]
  37.        
  38.         if isinstance(image, basestring):
  39.             Metro_Checkbutton.image[size] = image = BitmapImage(data=base64.b64decode(image))
  40.  
  41.         selectimage = Metro_Checkbutton.selectimage[size]
  42.        
  43.         if isinstance(selectimage, basestring):
  44.             Metro_Checkbutton.selectimage[size] = selectimage = BitmapImage(data=base64.b64decode(selectimage))
  45.  
  46.         Checkbutton.__init__(self, master, indicatoron=0, selectimage=selectimage, image=image, highlightthickness=0, **kw)
  47.  
  48. class Metro_Radiobutton(Radiobutton):
  49.     image = {
  50.         16: 'I2RlZmluZSBpbWFnZV93aWR0aCAxNgojZGVmaW5lIGltYWdlX2hlaWdodCAxNgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4ZTAsMHgwNywweGY4LDB4MWYsMHgzYywweDNjLDB4MGUsMHg3MCwweDA2LDB4NjAsMHgwNywweGUwLDB4MDMsMHhjMCwweDAzLAoweGMwLDB4MDMsMHhjMCwweDAzLDB4YzAsMHgwNywweGUwLDB4MDYsMHg2MCwweDBlLDB4NzAsMHgzYywweDNjLDB4ZjgsMHgxZiwKMHhlMCwweDA3Cn07',
  51.         22: 'I2RlZmluZSBpbWFnZV93aWR0aCAyMgojZGVmaW5lIGltYWdlX2hlaWdodCAyMgpzdGF0aWMgY2hhciBpbWFnZV9iaXRzW10gPSB7CjB4MDAsMHgzZiwweDAwLDB4ZTAsMHhmZiwweDAxLDB4ZjAsMHhmZiwweDAzLDB4ZjgsMHhjMCwweDA3LDB4M2MsMHgwMCwweDBmLAoweDFlLDB4MDAsMHgxZSwweDBlLDB4MDAsMHgxYywweDBlLDB4MDAsMHgxYywweDA3LDB4MDAsMHgzOCwweDA3LDB4MDAsMHgzOCwKMHgwNywweDAwLDB4MzgsMHgwNywweDAwLDB4MzgsMHgwNywweDAwLDB4MzgsMHgwNywweDAwLDB4MzgsMHgwZiwweDAwLDB4MWMsCjB4MGUsMHgwMCwweDFjLDB4MWUsMHgwMCwweDFlLDB4M2MsMHgwMCwweDBmLDB4ZjgsMHhjMCwweDA3LDB4ZjAsMHhmZiwweDAzLAoweGUwLDB4ZmYsMHgwMSwweDAwLDB4M2YsMHgwMAp9Ow==',
  52.         24: 'I2RlZmluZSBpbWFnZV93aWR0aCAyNAojZGVmaW5lIGltYWdlX2hlaWdodCAyNApzdGF0aWMgY2hhciBpbW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LDB4MDAsMHg3ZiwweGZlLDB4MDAsMHhlMCwweDA3LDB4MDAsMHg3ZiwweGZjLDB4MDEsMHgwMCwweDAwLDB4ODAsMHgzZiwKMHhmYywweDAxLDB4MDAsMHgwMCwweDgwLDB4M2YsMHhmOCwweDAzLDB4MDAsMHgwMCwweGMwLDB4MWYsMHhmOCwweDA3LDB4MDAsCjB4MDAsMHhlMCwweDFmLDB4ZjAsMHgwZiwweDAwLDB4MDAsMHhmMCwweDBmLDB4ZTAsMHgxZiwweDAwLDB4MDAsMHhmOCwweDA3LAoweGMwLDB4N2YsMHgwMCwweDAwLDB4ZmUsMHgwMywweDgwLDB4ZmYsMHgwMSwweDgwLDB4ZmYsMHgwMSwweDAwLDB4ZmYsMHgwZiwKMHhmMCwweGZmLDB4MDAsMHgwMCwweGZlLDB4ZmYsMHhmZiwweDdmLDB4MDAsMHgwMCwweGZjLDB4ZmYsMHhmZiwweDNmLDB4MDAsCjB4MDAsMHhmOCwweGZmLDB4ZmYsMHgxZiwweDAwLDB4MDAsMHhlMCwweGZmLDB4ZmYsMHgwNywweDAwLDB4MDAsMHg4MCwweGZmLAoweGZmLDB4MDEsMHgwMAp9Ow=='
  63.     }
  64.  
  65.     def __init__(self, master, size=22, **kw):
  66.         image = Metro_Radiobutton.image[size]
  67.        
  68.         if isinstance(image, basestring):
  69.             Metro_Radiobutton.image[size] = image = BitmapImage(data=base64.b64decode(image))
  70.  
  71.         selectimage = Metro_Radiobutton.selectimage[size]
  72.        
  73.         if isinstance(selectimage, basestring):
  74.             Metro_Radiobutton.selectimage[size] = selectimage = BitmapImage(data=base64.b64decode(selectimage))
  75.  
  76.         Radiobutton.__init__(self, master, indicatoron=0, selectimage=selectimage, image=image, highlightthickness=0, borderwidth=0, **kw)
  77.  
  78.  
  79. if __name__ == "__main__":
  80.     try:
  81.         from Tkinter import Tk, StringVar, Frame
  82.     except ImportError:
  83.         from tkinter import Tk, StringVar, Frame
  84.  
  85.     root = Tk()
  86.     root.geometry("200x300")
  87.     root.configure(background="white")
  88.  
  89.     Metro_Checkbutton(root, background="white").pack(pady=10)
  90.  
  91.     var = StringVar()
  92.  
  93.     row = Frame(root, background="white")
  94.     row.pack(pady=10)
  95.  
  96.     Metro_Radiobutton(row, background="white",variable=var, value="0").pack(side=LEFT)
  97.     Metro_Radiobutton(row, background="white",variable=var, value="1").pack(side=LEFT, padx=(10,0))
  98.  
  99.     root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement