def show_help_popup ( event ): """ Displays a pop-up help window for a single trait. """ control = event.GetEventObject() template = help_template() html = template.item_html % ( control.GetLabel(), control.trait.get_help() ) HTMLHelpWindow( control, html, .25, .13 )
def show_help_popup ( event ): """ Displays a pop-up help window for a single trait. """ control = event.GetEventObject() template = help_template() # Note: The following check is necessary because under Linux, we get back # a control which does not have the 'help' trait defined (it is the parent # of the object with the 'help' trait): help = getattr( control, 'help', None ) if help is not None: html = template.item_html % ( control.GetLabel(), help ) HTMLHelpWindow( control, html, .25, .13 )
def show_help ( ui, button ): """ Displays a help window for the specified UI's active Group. """ group = ui._groups[ ui._active_group ] template = help_template() if group.help is not None: header = template.group_help % group.help else: header = template.no_group_help fields = [] for item in group.get_content( False ): if not item.is_spacer(): fields.append( template.item_help % ( item.get_label( ui ), item.get_help( ui ) ) ) html = template.group_html % ( header, '\n'.join( fields ) ) HTMLHelpWindow( button, html, .25, .33 )