Advertisement
maxkhl

colorDialog.py

Nov 4th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1.  
  2. from tkinter import *
  3. from tkinter.colorchooser import *
  4. import colorInterface
  5.  
  6. def setColor(value):
  7.     colorInterface.sendColorCommand(0, int(value)) 
  8.  
  9. def setBrightness(value):
  10.     colorInterface.sendBrightnessCommand(0, int(value))
  11.  
  12.  
  13. def Show():
  14.     window = Tk()
  15.     window.title('Lichtsteuerung')
  16.     window.configure(height=400,width=600)
  17.     btnOn = Button(window,text='  On  ', command=colorInterface.sendOnCommand)
  18.     btnOff = Button(window,text='  Off  ', command=colorInterface.sendOffCommand)
  19.     btnWhite = Button(window,text='White', command=colorInterface.sendWhiteCommand)
  20.     btnFunc = Button(window,text='Function', command=colorInterface.sendDiscoCommand)
  21.     btnFuncSlow = Button(window,text='Function Slower', command=colorInterface.sendDiscoDecCommand)
  22.     btnFuncFast = Button(window,text='Function Faster', command=colorInterface.sendDiscoIncCommand)
  23.     slideBrightness = Scale(window, from_=0, to=18, orient=HORIZONTAL, command=setBrightness)
  24.     slideBrightness.set(18)
  25.     slideColor = Scale(window, from_=0, to=255, orient=HORIZONTAL, command=setColor)
  26.     btnOn.pack(side=TOP)
  27.     btnOff.pack(side=TOP)
  28.     btnWhite.pack(side=TOP)
  29.     btnFunc.pack(side=TOP)
  30.     btnFuncSlow.pack(side=TOP)
  31.     btnFuncFast.pack(side=TOP)
  32.     slideColor.pack(side=BOTTOM)
  33.     slideBrightness.pack(side=BOTTOM)
  34.  
  35.     window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement