The Calltip tab displays the contents of the most recent calltip in the Python shell. If you are working with a callable that requires a large number of parameters to be passed to it, select the Calltip tab. When using the wxPython package itself, there are a lot of classes that can have many methods, which may take many parameters. For example, to create a wx.Button, you can supply up to eight parameters, one of which is required, while the other seven have default values. The Calltip tab displays the following details about the wx.Button constructor:
_init_(self, Window parent, int id=-1, String label=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, String name=ButtonNameStr) -> Button
Create and show a button. The preferred way to create standard buttons is to use a standard ID and an empty label. In this case wxWigets will automatically use a stock label that corresponds to the ID given. In addition, the button will be decorated with stock icons under GTK+2.
Because the wxPython classes are actually wrappers for C + + classes, the calltip information is based entirely on the docstrings for the class. These have been generated to show both the parameters that can be passed, and the type (int, string, point, etc.) required by the underlying C+ + class. That's why the wx.But-ton constructor calltip appears the way it does. For objects defined completely in the Python language, PyCrust inspects the object to determine the nature of its arguments.
Was this article helpful?