PTK

Rendering Engine Interface
Login

Rendering Engine Interface

Business Side

The common rendering routines are part of PTK on the business logic side. A particular rederer must implemented:

::ptk::renderer::binding tag event ?command?

    This command is called when a binding changes.

::ptk::renderer::bindtags wName tagList

    This command is called when a bindtags changes.

::Protocol change wName id changeDict

    This command handles when there is a change to the shared object specifeied by wName/id, the chage is specified in changeDict.

::ptk::renderer::destroy wName

    This command handles when the "widget", wName, is no longer needed.

::ptk::renderer::initialize ?args?

    The routine the first call to the render. The signature is up to the particular renderer as to what, if any, parameters it takes.

::ptk::renderer::factory WidgetClassName

    The factory routine, will be called once per widget class to specify the hander which will handle rendering of widgets of that class. It must return a list that is a command name and optional arguments (i.e. a list suitable for a method to be forwarded to) that will render that widget class or the null string if no renderer exists for the class.
    When a widget is to be rendered, the command, with any arguments specified will be called with the widget name to be rendered and should do whatever is required to render the widget. This may include querying of bindtags, bindings, winfo and the appropriate geometry manager.

::ptk::renderer::geometry manager args

    The command is called when a gemetry management changes.

::ptk::renderer::widget wName id method ?args?

    The widget routine, will be called as needed to request a particular method be run on a remote widget and the results returned. For example, the get method on an entry widget to return the current value.

::ptk::renderer::wm subcommand wName args

    This command handles a "window manager" command. The actual actions is speficied by subcommand and the parameters to that action by args.

Note: the routines must be defined after the PTK package is required since the PTK package defines stubs for the routines.

Display Side

The display side render handler must be implemented as appropriate. The following commands must be implemented:

::Render destroy wName

    This command handles when the "widget", wName, is no longer needed.

::Render new class wName id objValue

    This command handles when there is a new "widget" and its associated shared object. The Tk "class" of the widget is specified by class. The widget and its associated shared object are specifeied/named by wName/id. The value of the shared object is specified in objValue.

::Render widget wName id method ?args?

    This command handles a request to run a given method on the specified widget and return the result.

::Render wm subcommand wName args

    This command handles a "window manager" command. The actual actions is speficied by subcommand and the parameters to that action by args.