MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _setup_wx

Function _setup_wx

galleries/examples/user_interfaces/mplcvd.py:234–255  ·  view source on GitHub ↗
(tb)

Source from the content-addressed store, hash-verified

232
233
234def _setup_wx(tb):
235 import wx
236
237 idx = next(idx for idx in range(tb.ToolsCount)
238 if tb.GetToolByPos(idx).IsStretchableSpace())
239 tb.InsertSeparator(idx)
240 tool = tb.InsertTool(
241 idx + 1, -1, _BUTTON_NAME,
242 # FIXME: _icon needs public API.
243 tb._icon(str(Path(__file__).parent / "images/eye.png")),
244 # FIXME: ITEM_DROPDOWN is not supported on macOS.
245 kind=wx.ITEM_DROPDOWN, shortHelp=_BUTTON_HELP)
246
247 menu = wx.Menu()
248 for name in _MENU_ENTRIES:
249 item = menu.AppendRadioItem(-1, name)
250 menu.Bind(
251 wx.EVT_MENU,
252 lambda event, _name=name: _set_menu_entry(tb, _name),
253 id=item.Id,
254 )
255 tb.SetDropdownMenu(tool.Id, menu)
256
257
258if __name__ == '__main__':

Callers 1

setupFunction · 0.85

Calls 3

PathClass · 0.85
_set_menu_entryFunction · 0.85
_iconMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…