parameters: (self)
docstring: Constructs this :class:`Shortcut` starting from a :class:`Menu` or :class:`MenuItem`.
  
          The attributes needed to properly construct a :class:`Shortcut` are the label,
          the accelerator string, the help string (optional) and the bitmap associated
          with it (optional).
docstring_summary: Constructs this :class:`Shortcut` starting from a :class:`Menu` or :class:`MenuItem`.
docstring_tokens: Constructs this : class : Shortcut starting from a : class : Menu or : class : MenuItem .
function: def FromMenuItem(self):
          """
          Constructs this :class:`Shortcut` starting from a :class:`Menu` or :class:`MenuItem`.
  
          The attributes needed to properly construct a :class:`Shortcut` are the label,
          the accelerator string, the help string (optional) and the bitmap associated
          with it (optional).
          """
  
          if self.menuItem is None:
              return
          
          menuItem = self.menuItem
          
          if isinstance(menuItem, wx.Menu):
              label = menuItem.GetTitle()
              accelerator = DISABLED_STRING
              help = ''
              bitmap = wx.NullBitmap
          else:
              label = menuItem.GetItemLabelText()
              accelerator = menuItem.GetItemLabel()
              
              if '\t' in accelerator:
                  accelerator = accelerator[accelerator.index('\t')+1:]
              else:
                  accelerator = DISABLED_STRING
  
              help = menuItem.GetHelp()
              bitmap = menuItem.GetBitmap()
                  
          self.label = label
          self.accelerator = accelerator
          self.help = help
          self.bitmap = bitmap
          
          self.originalAccelerator = accelerator
function_tokens: def FromMenuItem ( self ) : if self . menuItem is None : return menuItem = self . menuItem if isinstance ( menuItem , wx . Menu ) : label = menuItem . GetTitle ( ) accelerator = DISABLED_STRING help = '' bitmap = wx . NullBitmap else : label = menuItem . GetItemLabelText ( ) accelerator = menuItem . GetItemLabel ( ) if '\t' in accelerator : accelerator = accelerator [ accelerator . index ( '\t' ) + 1 : ] else : accelerator = DISABLED_STRING help = menuItem . GetHelp ( ) bitmap = menuItem . GetBitmap ( ) self . label = label self . accelerator = accelerator self . help = help self . bitmap = bitmap self . originalAccelerator = accelerator