MCPcopy Create free account
hub / github.com/Eve-PySpy/PySpy / _fontScaleMenu

Method _fontScaleMenu

gui.py:366–384  ·  view source on GitHub ↗

Populates the font scale sub menu with scale percentages based on input bounds. :param `lower`: The minimum scale represented as a decimal, e.g. 0.6 :param `upper`: The maximum scale represented as a decimal, e.g. 1.4

(self, lower, upper)

Source from the content-addressed store, hash-verified

364 self._stretchLastCol()
365
366 def _fontScaleMenu(self, lower, upper):
367 '''
368 Populates the font scale sub menu with scale percentages
369 based on input bounds.
370
371 :param `lower`: The minimum scale represented as a decimal, e.g. 0.6
372
373 :param `upper`: The maximum scale represented as a decimal, e.g. 1.4
374 '''
375 for scale in range(lower, upper):
376 scale = scale / 10
377 self.font_sub.AppendRadioItem(wx.ID_ANY, "{:.0%}".format(scale))
378 self.font_sub.Bind(
379 wx.EVT_MENU,
380 lambda evt, scale=scale: self._setFontScale(scale, evt),
381 self.font_sub.MenuItems[-1]
382 )
383 if scale == self.options.Get("FontScale", 1):
384 self.font_sub.MenuItems[-1].Check(True)
385
386 def _setFontScale(self, scale, evt=None):
387 '''

Callers 1

__init__Method · 0.95

Calls 2

_setFontScaleMethod · 0.95
GetMethod · 0.80

Tested by

no test coverage detected