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

Method _toggleColumn

gui.py:428–455  ·  view source on GitHub ↗

Depending on the respective menu item state, either reveals or hides a column. If it hides a column, it first stores the old column width in self.options to allow for subsequent restore. :param `index`: Integer representing the index of the column which is t

(self, index, event=None)

Source from the content-addressed store, hash-verified

426 )
427
428 def _toggleColumn(self, index, event=None):
429 '''
430 Depending on the respective menu item state, either reveals or
431 hides a column. If it hides a column, it first stores the old
432 column width in self.options to allow for subsequent restore.
433
434 :param `index`: Integer representing the index of the column
435 which is to shown / hidden.
436 '''
437 try:
438 checked = self.col_menu_items[index].IsChecked()
439 except:
440 checked = False
441 col_name = self.columns[index][1]
442 if checked:
443 default_width = self.columns[index][3]
444 col_width = self.options.Get(col_name, default_width)
445 if col_width > 0:
446 self.grid.SetColSize(index, col_width)
447 else:
448 self.grid.SetColSize(index, default_width)
449 else:
450 col_width = self.grid.GetColSize(index)
451 # Only save column status if column is actually hideable
452 if self.columns[index][4]:
453 self.options.Set(col_name, col_width)
454 self.grid.HideCol(index)
455 self._stretchLastCol()
456
457 def _stretchLastCol(self, event=None):
458 '''

Callers 1

Calls 3

_stretchLastColMethod · 0.95
GetMethod · 0.80
SetMethod · 0.80

Tested by

no test coverage detected