MCPcopy Create free account
hub / github.com/ActiveState/code / add

Method add

recipes/Python/577261_Python_Tkinter_Tabs/recipe-577261.py:49–56  ·  view source on GitHub ↗
(self, tab)

Source from the content-addressed store, hash-verified

47 self.switch_tab(self.init_name or self.tabs.keys()[-1])# switch the tab to the first tab
48
49 def add(self, tab):
50 tab.pack_forget() # hide the tab on init
51
52 self.tabs[tab.tab_name] = tab # add it to the list of tabs
53 b = Button(self, text=tab.tab_name, relief=BASE, # basic button stuff
54 command=(lambda name=tab.tab_name: self.switch_tab(name))) # set the command to switch tabs
55 b.pack(side=LEFT) # pack the buttont to the left mose of self
56 self.buttons[tab.tab_name] = b # add it to the list of buttons
57
58 def delete(self, tabname):
59

Callers 5

recipe-577204.pyFile · 0.45
treeFunction · 0.45
hyphen_rangeFunction · 0.45
recipe-577261.pyFile · 0.45

Calls 4

switch_tabMethod · 0.95
pack_forgetMethod · 0.80
ButtonClass · 0.50
packMethod · 0.45

Tested by

no test coverage detected