MCPcopy Index your code
hub / github.com/python/cpython / HelpFrame

Class HelpFrame

Lib/idlelib/configdialog.py:2083–2214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2081
2082
2083class HelpFrame(LabelFrame):
2084
2085 def __init__(self, master, **cfg):
2086 super().__init__(master, **cfg)
2087 self.create_frame_help()
2088 self.load_helplist()
2089
2090 def create_frame_help(self):
2091 """Create LabelFrame for additional help menu sources.
2092
2093 load_helplist loads list user_helplist with
2094 name, position pairs and copies names to listbox helplist.
2095 Clicking a name invokes help_source selected. Clicking
2096 button_helplist_name invokes helplist_item_name, which also
2097 changes user_helplist. These functions all call
2098 set_add_delete_state. All but load call update_help_changes to
2099 rewrite changes['main']['HelpFiles'].
2100
2101 Widgets for HelpFrame(LabelFrame): (*) widgets bound to self
2102 frame_helplist: Frame
2103 (*)helplist: ListBox
2104 scroll_helplist: Scrollbar
2105 frame_buttons: Frame
2106 (*)button_helplist_edit
2107 (*)button_helplist_add
2108 (*)button_helplist_remove
2109 """
2110 # self = frame_help in dialog (until ExtPage class).
2111 frame_helplist = Frame(self)
2112 self.helplist = Listbox(
2113 frame_helplist, height=5, takefocus=True,
2114 exportselection=FALSE)
2115 scroll_helplist = Scrollbar(frame_helplist)
2116 scroll_helplist['command'] = self.helplist.yview
2117 self.helplist['yscrollcommand'] = scroll_helplist.set
2118 self.helplist.bind('<ButtonRelease-1>', self.help_source_selected)
2119
2120 frame_buttons = Frame(self)
2121 self.button_helplist_edit = Button(
2122 frame_buttons, text='Edit', state='disabled',
2123 width=8, command=self.helplist_item_edit)
2124 self.button_helplist_add = Button(
2125 frame_buttons, text='Add',
2126 width=8, command=self.helplist_item_add)
2127 self.button_helplist_remove = Button(
2128 frame_buttons, text='Remove', state='disabled',
2129 width=8, command=self.helplist_item_remove)
2130
2131 # Pack frame_help.
2132 frame_helplist.pack(side=LEFT, padx=5, pady=5, expand=TRUE, fill=BOTH)
2133 self.helplist.pack(side=LEFT, anchor=E, expand=TRUE, fill=BOTH)
2134 scroll_helplist.pack(side=RIGHT, anchor=W, fill=Y)
2135 frame_buttons.pack(side=RIGHT, padx=5, pady=5, fill=Y)
2136 self.button_helplist_edit.pack(side=TOP, anchor=W, pady=5)
2137 self.button_helplist_add.pack(side=TOP, anchor=W)
2138 self.button_helplist_remove.pack(side=TOP, anchor=W, pady=5)
2139
2140 def help_source_selected(self, event):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…