@@ -37,9 +37,8 @@ class Layout:
3737
3838class ControlPanel (Tkinter .Toplevel ):
3939
40- def __init__ (self , culebron , vc , printOperation , ** kwargs ):
40+ def __init__ (self , culebron , printOperation , ** kwargs ):
4141 self .culebron = culebron
42- self .vc = vc
4342 self .printOperation = printOperation
4443 self .parent = culebron .window
4544 self .childWindow = Tkinter .Toplevel (self .parent )
@@ -52,7 +51,6 @@ def __init__(self, culebron, vc, printOperation, **kwargs):
5251 self .childWindow .title ('Control Panel' )
5352 self .childWindow .resizable (width = Tkinter .FALSE , height = Tkinter .FALSE )
5453 self .childWindow .printOperation = printOperation
55- self .childWindow .vc = vc
5654 self .childWindow .grid ()
5755 self .childWindow .column = self .childWindow .row = 0
5856 self .createKeycodeTab ()
@@ -70,7 +68,7 @@ def createKeycodeTab(self):
7068 'KEYCODE_BRIGHTNESS_UP' , 'KEYCODE_VOLUME_MUTE' , 'KEYCODE_MEDIA_STOP' , 'KEYCODE_CALCULATOR' , 'KEYCODE_SETTINGS' , 'QUIT'
7169 ]
7270 for keycode in self .keycodeList :
73- self .keycode = ControlPanelButton (self .keycodeTab , self .culebron , self .vc , self . printOperation , value = keycode , text = keycode [8 :],
71+ self .keycode = ControlPanelButton (self .keycodeTab , self .culebron , self .printOperation , value = keycode , text = keycode [8 :],
7472 width = Layout .BUTTON_WIDTH , bg = Color .DARK_GRAY , fg = Color .LIGHT_GRAY ,
7573 highlightbackground = Color .DARK_GRAY )
7674
@@ -99,7 +97,7 @@ def createKeyboardTab(self):
9997 ]
10098
10199 for keyboard in self .keyboardList :
102- self .keyboard = ControlPanelButton (self .keyboardTab , self .culebron , self .vc , self . printOperation , value = keyboard , text = keyboard [8 :],
100+ self .keyboard = ControlPanelButton (self .keyboardTab , self .culebron , self .printOperation , value = keyboard , text = keyboard [8 :],
103101 width = Layout .BUTTON_WIDTH , bg = Color .DARK_GRAY , fg = Color .LIGHT_GRAY ,
104102 highlightbackground = Color .DARK_GRAY )
105103
@@ -117,13 +115,12 @@ def tabLayout(self):
117115
118116class ControlPanelButton (Tkinter .Button ):
119117
120- def __init__ (self , parent , culebron , vc , printOperation , value = None , ** kwargs ):
118+ def __init__ (self , parent , culebron , printOperation , value = None , ** kwargs ):
121119 Tkinter .Button .__init__ (self , parent , kwargs )
122120 self .culebron = culebron
123121 self .printOperation = printOperation
124122 self .value = value
125- self .vc = vc
126- self .device = vc .device
123+ self .device = culebron .device
127124
128125 def command (self ):
129126 key = self .value
0 commit comments