Auto completion
 
 
 

In the interactive console, access auto complete with Ctrl+Space.

Auto completion uses the Python global namespace to make a suggestion. That means, any name that can be found by typing dir() in the interactive console can be auto completed or examined to suggest completion for its member. However, how the auto complete list is populated depends on the state of the interactive console:

From a name contained in the global Python namespace, you can also use auto completion to know which functions and properties are available for an object. For example:

  1. In the interactive console, type from pyfbsdk import *.
  2. Type FB, then Ctrl+Space. Note that suggestions are case-sensitive.
  3. Choose one of the suggestions, and type a period after it in the interactive console.
  4. Type Ctrl+Space again to pop up a section of completions relevant to that member.

For example, on entering FBEdit.On in the Ctrl+Space pops up a list of available events for FBEdit, since all property events begin with "On".

Auto completion also works in the work area, in the same way as in the interactive console. It always checks the Python global namespace. To get the most out of the auto completion, execute the script often, as in the following example.

  1. Create a new script, and in the first two lines add:
    from pyfbsdk import *
    from pyfbsdk_additions import *
    Execute the script. Although it doesn’t do anything yet, executing it adds the SDK names to the global namespace, and they can then be used in auto completion.
  2. On the next line: type tool = Create. Type Ctrl+Space and choose CreateUnique tool.. Complete as tool = CreateUniqueTool("tool example").
  3. Execute the script. This adds the tool variable to the global namespace.
  4. On the next line type tool. then Ctrl+Space to see all the functions and properties available in the object named tool. This is the same output you would get from the command dir(tool).
  5. Choose StartSizeX, and complete with the following lines:
    tool.StartSizeX = 800
    tool.StartSizeY = 200
    ShowTool( tool)
  6. Execute the script to display the tool.

It is good practice to execute a script each time you add new variables, and use auto completion. If auto completion does not work, either the name you are trying to complete is not in the global namespace, or you have a typing error.