DrawBot in Glyphs + Vanilla

I am trying to add a little control window to my script to execute it with preselected values.

Is there a smarter way to do it instead of writing everything in the callback functions of one huge “general” class? The vanilla documentation does not give examples how to link up controls and code.

Also: why does it print to the console of the macro window instead of the Drawbot plugin window?

Something like this should work:

either A)

from vanilla import *

class MyExternalClass(object):
	def checkBoxCallback(self, sender):
		print "Print from external class", sender.get()

class CheckBoxDemo(object):

	def __init__(self):
		EC = MyExternalClass()
		self.w = Window((100, 40))
		self.w.checkBox = CheckBox((10, 10, -10, 20), "A CheckBox", callback=EC.checkBoxCallback, value=True)
		self.w.open()

CheckBoxDemo()

or B)

from vanilla import *

class MyExternalClass(object):
	def checkBoxCallback(self, sender):
		print "Print from external class", sender.get()

class CheckBoxDemo(MyExternalClass, object):

	def __init__(self):
		self.w = Window((100, 40))
		self.w.checkBox = CheckBox((10, 10, -10, 20), "A CheckBox", callback=super(CheckBoxDemo, self).checkBoxCallback, value=True)
		self.w.open()

CheckBoxDemo()