def init(self, parent): """ Finishes initializing the editor by creating the underlying toolkit widget. """ from pyface.image_button import ImageButton factory = self.factory if self.factory.label: label = self.factory.label else: label = self.item.get_label(self.ui) self._control = ImageButton( parent, label=self.string_value(label), image=factory.image, style=factory.style, orientation=factory.orientation, width_padding=factory.width_padding, height_padding=factory.height_padding, ) self.control = self._control.control self._control.on_trait_change(self.update_object, "clicked", dispatch="ui") self.sync_value(self.factory.label_value, "label", "from") self.set_tooltip()
def init ( self, parent ): """ Finishes initializing the editor by creating the underlying toolkit widget. """ from pyface.image_button import ImageButton factory = self.factory self._control = ImageButton( parent, label = self.string_value( factory.label ), image = factory.image, style = factory.style, orientation = factory.orientation, width_padding = factory.width_padding, height_padding = factory.height_padding ) self.control = self._control.control self._control.on_trait_change( self.update_object, 'clicked', dispatch = 'ui' ) self.set_tooltip()