Where to find all functions that can be bound to keys in Pythowin

Mark Hammond MarkH at ActiveState.com
Tue Aug 15 19:50:04 EDT 2000


You have to look through the sources :-(

But take heed - if you can't find what you want, you can write your
own :-)

For example, Neil Hodgson wrote a new event I include below.
Unfortunately, it is not documented that MFC binds "F6" to this exact
process, so the code as shown isnt that useful other than as a custom
event sample...

---
The place to look for the split window stuff is in
Pythonwin\pywin\framework\editor\frame.py, so define a method on
EditorFrame:

def SwitchView(self):
  if self.GetActiveView() == self.sub_splitter.GetPane(0,0):
    self.SetActiveView(self.sub_splitter.GetPane(1,0))
  else:
    self.SetActiveView(self.sub_splitter.GetPane(0,0))

Hook the event into the view Pythonwin\pywin\scintilla\view.py, by
defining a method on CScintillaView:

def SwitchingViewsEvent(self, event):
  parent = self.GetParentFrame()
  parent.SwitchView()

And then in the cfg file attach this to a key:

Ctrl+Shift+E = SwitchingViews

Mark.
--
markh at activestate.com - but if you think I speak for them, you dont
know Dick!






More information about the Python-list mailing list