def __init__(self, parent, selected=None, isOpenGL=False, callback=None, *args, **kw): self.isOpenGL = isOpenGL PulldownList.__init__(self, parent, callback, *args, **kw) texts = [] cats = [] if isOpenGL: index = 0 # Helvetica 10 for name in glNames: for size in glSizes[name]: text = '%s %d' % (name, size) texts.append(text) cats.append(name) else: index = 2 # Helvetica 10 for name in tkNames: for size in tkSizes: text = '%s %d' % (name, size) texts.append(text) cats.append(name) if selected in texts: index = texts.index(selected) PulldownList.setup(self, texts, texts, index, categories=cats)
def __init__(self, parent, getColors, extra_label='', *args, **kw): self.getColors = getColors self.extra_label = extra_label PulldownList.__init__(self, parent, *args, **kw) for func in notify_funcs: Implementation.registerNotify(self.setColors, 'ccpnmr.Analysis.Color', func) self.setColors()
def __init__(self, parent, callback=None, *args, **kw): fkey_entries = ['F%d' % (n + 1) for n in range(12)] misc_entries = [ \ 'Home', 'End', 'Prior', 'Next', 'Up', 'Down', 'Right', 'Left', 'Delete', ] # remove 0-9 because used for spectrum shortcuts texts = [no_keysym] categories = [ None, ] objects = [ None, ] for category, sublabels in ( ('a-z', string.lowercase[:26]), ('A-Z', string.uppercase[:26]), #('0-9', string.digits), ('F keys', fkey_entries), ('Misc', misc_entries)): for text in sublabels: texts.append(text) objects.append(text) categories.append(category) PulldownList.__init__(self, parent, callback=callback, texts=texts, objects=objects, categories=categories, *args, **kw)
def __init__(self, parent, browser=None, **kw): self.browserList = getBrowserList() if not browser: browser = getDefaultBrowser() if self.browserList: if (not browser) or (browser not in self.browserList): browser = self.browserList[0] self.browser = browser PulldownList.__init__(self, parent, **kw) if self.browserList: self.setup(self.browserList, self.browserList, self.browserList.index(self.browser)) self.callback = self.setWebBrowser