4 Oz API Reference

This chapter describes functions specific to the binding, i. e., those procedures not covered by the mapping described in Chapter 3.

4.1 String Arrays

makeStrArr

{GTK.makeStrArr +Vs ?ForeignPointer}

converts the list of virtual strings Vs to a string array.

getStrArr

{GTK.getStrArr +ForeignPointer ?Vs}

converts the string array ForeignPointer to a list of virtual strings.

freeStrArr

{GTK.freeStrArr +ForeignPointer}

deallocates the string array ForeignPointer, which must have been allocated with GTK.makeStrArr.

4.2 GtkArg Handling

makeArg

{GTK.makeArg +V +X ?ForeignPointer}

creates a GtkArg structure with the name V and the value X. X can be of type int, float, bool, virtual string and foreign pointer.

getArg

{GTK.getArg +ForeignPointer ?X}

retrieves the value stored in ForeignPointer.

freeArg

{GTK.freeArg +ForeignPointer}

deallocates the GtkArg structure, which must have been allocated with GTK.makeArg.

4.3 Creating Canvas Items

new

{New GTKCANVAS.canvas new(+ImageSupportB?CanvasO}

creates are new canvas widget CanvasO. ImageSupportB indicates whether the canvas supports image items; if true, pushVisual is called. You are required to call popVisual after the last image item has been created for that canvas.

Trying to create image items without image support being enabled causes a segmentation violation of the Mozart process due to implementation limitations.

newItem

{CanvasO newItem(+GroupO +TypeA +Ts ?O)}

creates a new item O of type TypeA, belonging to group GroupO and with properties given by Ts.

Ts denotes a list of properties given as pairs NameV#X, where X is the value assigned to the property named NameV.

configureItem

{CanvasO configureItem(+CanvasItemO +Ts)}

configures the properties of CanvasItemO as specified by Ts.

pushVisual

{CanvasO pushVisual()}

pushes the default visual onto the GTK+ widget stack. This method should not be invoked directly; instead, it should be invoked through the canvas constructor.

popVisual

{CanvasO popVisual()}

pops the default visual from the GTK+ widget stack. This method must be invoked after the last image item has been created in a canvas with image support.

newImageItem

{Canvas newImageItem(+GroupO +ImageO +X_I +Y_I +WidthI +HeightI +AnchorI ?O}

creates a new item O of type image, belonging to group GroupO and scaled to fit into the rectangle described by X_I, Y_I, WidthI and HeightI in relation to the anchor +AnchorI.


Thorsten Brunklaus and Leif Kornstaedt
Version 1.3.1 (20040823)