#NEWLINE# def __init__( self , appInstance , widgetClass , **kwargs_to_widget ) : #NEWLINE# #INDENT# self . kwargs_to_widget = kwargs_to_widget #NEWLINE# self . appInstance = appInstance #NEWLINE# self . widgetClass = widgetClass #NEWLINE# super ( WidgetHelper , self ) . __init__ ( ) #NEWLINE# self . style [ 'display' ] = 'block' #NEWLINE# self . style [ 'background-color' ] = 'white' #NEWLINE# self . icon = gui . Image ( ( '/res/widget_%s.png' % self . widgetClass . __name__ ) , width = 'auto' , margin = '2px' ) #NEWLINE# self . icon . style [ 'max-width' ] = '100%' #NEWLINE# self . icon . style [ 'image-rendering' ] = 'auto' #NEWLINE# self . icon . attributes [ 'draggable' ] = 'false' #NEWLINE# self . icon . attributes [ 'ondragstart' ] = 'event.preventDefault();' #NEWLINE# self . append ( self . icon ) #NEWLINE# self . attributes [ 'draggable' ] = 'true' #NEWLINE# self . attributes [ 'ondragstart' ] = "this.style.cursor='move'; event.dataTransfer.dropEffect = 'move';   event.dataTransfer.setData('application/json', JSON.stringify(['add',event.target.id,(event.clientX),(event.clientY)]));" #NEWLINE# self . attributes [ 'ondragover' ] = 'event.preventDefault();' #NEWLINE# self . attributes [ 'ondrop' ] = 'event.preventDefault();return false;' #NEWLINE# self . optional_style_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . set_on_click_listener ( self , 'prompt_new_widget' )