Package otk :: Module otk
[hide private]
[frames] | no frames]

Module otk

source code

The `otk` is a python binding for the otk tool kit.

Classes [hide private]
  OtkTabbedPanel
Proxy of C OtkTabbedPanel struct
  OtkColor_record
Proxy of C OtkColor_record struct
Functions [hide private]
 
_swig_setattr_nondynamic(self, class_type, name, value, static=1) source code
 
_swig_setattr(self, class_type, name, value) source code
 
_swig_getattr(self, class_type, name) source code
 
_swig_repr(self)
repr(x)
source code
 
_swig_setattr_nondynamic_method(set) source code
 
Otk_Set_Default_Border_Thickness(*args)
Otk_Set_Default_Border_Thickness(float thickness)
source code
 
Otk_Set_Object_Border_Thickness(*args)
Otk_Set_Object_Border_Thickness(OtkWidget obj, float thickness)
source code
 
OtkSetColor(*args)
OtkSetColor(float r, float g, float b) -> OtkColor
source code
 
OtkMakePanel(*args)
OtkMakePanel(OtkWidget container, int panel_type, OtkColor panel_color, float left, float top, float horiz_size, float vert_size) -> OtkWidget
source code
 
OtkResizePanel(*args)
OtkResizePanel(OtkWidget panel, float left, float top, float horiz_size, ...
source code
 
OtkMakeImagePanel(*args)
OtkMakeImagePanel(OtkWidget container, char file_name, float left, float top, ...
source code
 
Otk_Dispose_Image(*args)
Otk_Dispose_Image(char file_name)
source code
 
Otk_Add_Line(*args)
Otk_Add_Line(OtkWidget container, OtkColor tmpcolor, float thickness, float x1, float y1, float x2, float y2) -> OtkWidget
source code
 
Otk_Add_BoundingBox(*args)
Otk_Add_BoundingBox(OtkWidget container, OtkColor tmpcolor, float thickness, float x1, float y1, float x2, float y2) -> OtkWidget
source code
 
Otk_Set_Line_Thickness(*args)
Otk_Set_Line_Thickness(OtkWidget tmpobj, float thickness)
source code
 
OtkMakeTextLabel(*args)
OtkMakeTextLabel(OtkWidget container, char text, OtkColor text_color, float scale, float thickness, float x, float y) -> OtkWidget
source code
 
Otk_Modify_Text_Slant(*args)
Otk_Modify_Text_Slant(OtkWidget tmpobj, float slant)
source code
 
Otk_Modify_Text_Color(*args)
Otk_Modify_Text_Color(OtkWidget tmpobj, OtkColor text_color)
source code
 
Otk_Modify_Text_Thickness(*args)
Otk_Modify_Text_Thickness(OtkWidget tmpobj, float thickness)
source code
 
Otk_Modify_Text_Scale(*args)
Otk_Modify_Text_Scale(OtkWidget tmpobj, float scale)
source code
 
Otk_Modify_Text_Aspect(*args)
Otk_Modify_Text_Aspect(OtkWidget tmpobj, float aspect)
source code
 
Otk_Set_Text_Aspect(*args)
Otk_Set_Text_Aspect(float aspect)
source code
 
Otk_Modify_Text_Position(*args)
Otk_Modify_Text_Position(OtkWidget tmpobj, float x, float y)
source code
 
Otk_Get_Text_Size(*args)
Otk_Get_Text_Size(OtkWidget tmpobj, float width, float height)
source code
 
Otk_Get_Character_Size(*args)
Otk_Get_Character_Size(OtkWidget tmpobj, float width, float height)
source code
 
Otk_Modify_Text(*args)
Otk_Modify_Text(OtkWidget tmpobj, char text)
source code
 
Otk_FitTextInPanel(*args)
Otk_FitTextInPanel(OtkWidget txtobj)
source code
 
OtkMakeButton(*args)
OtkMakeButton(OtkWidget container, float left, float top, float horiz_size, float vert_size, char text, PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget
source code
 
Otk_Set_Default_Button_Color(*args)
Otk_Set_Default_Button_Color(float r, float g, float b)
source code
 
Otk_Set_Button_Color(*args)
Otk_Set_Button_Color(OtkWidget button, OtkColor panel_color)
source code
 
Otk_Set_Panel_Color(*args)
Otk_Set_Panel_Color(OtkWidget container, OtkColor panel_color)
source code
 
Otk_Set_Default_Button_BorderThickness(*args)
Otk_Set_Default_Button_BorderThickness(float x)
source code
 
Otk_Set_Button_BorderThickness(*args)
Otk_Set_Button_BorderThickness(OtkWidget button, float x)
source code
 
Otk_Set_Button_Outline_Style(*args)
Otk_Set_Button_Outline_Style(int style)
source code
 
Otk_Set_Button_State(*args)
Otk_Set_Button_State(OtkWidget button, int state)
source code
 
Otk_Get_Button_State(*args)
Otk_Get_Button_State(OtkWidget button) -> int
source code
 
OtkMakeToggleButton(*args)
OtkMakeToggleButton(OtkWidget container, float left, float top, float horiz_size, float vert_size, PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget
source code
 
OtkMakeRadioButton(*args)
OtkMakeRadioButton(OtkWidget container, float left, float top, float horiz_size, float vert_size, PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget
source code
 
Otk_SetRadioButton(*args)
Otk_SetRadioButton(OtkWidget topobj)
source code
 
Otk_Set_Button_Icon(*args)
Otk_Set_Button_Icon(OtkWidget button, struct Otk_image image_ptr)
source code
 
Otk_Set_Button_Icon_File(*args)
Otk_Set_Button_Icon_File(OtkWidget button, char file_name)
source code
 
OtkMakeWindow(*args)
OtkMakeWindow(int panel_type, OtkColor tab_color, OtkColor panel_color, float left, float top, float horiz_size, float vert_size) -> OtkWidget
source code
 
OtkSetWindowTitle(*args)
OtkSetWindowTitle(OtkWidget window, OtkColor text_color, char title)
source code
 
Otk_RegisterWindowKillEventFunction(*args)
Otk_RegisterWindowKillEventFunction(OtkWidget topobj, PyFunctionObject func=None, PyObject parameter=None)
source code
 
OtkMakeTextFormBox(*args)
OtkMakeTextFormBox(OtkWidget container, char text, int ncols, float x, float y, float horiz_size, float vert_size, PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget
source code
 
OtkGetText(*args)
OtkGetText(OtkWidget obj, int n) -> char
source code
 
OtkMakeTextEditBox(*args)
OtkMakeTextEditBox(OtkWidget container, char text, int nrows, int ncols, float left, float top, float horiz_size, float vert_size) -> OtkWidget
source code
 
OtkAddTextScrollbar(*args)
OtkAddTextScrollbar(OtkWidget container, float width)
source code
 
Otk_Right_Justify_Formbox(*args)
Otk_Right_Justify_Formbox(OtkWidget formbox)
source code
 
Otk_Browse_Files(*args)
Otk_Browse_Files(char prompt, int maxlength, char directory, char wildcards, char filename, PyFunctionObject func=None) -> OtkWidget
source code
 
Otk_Browse_Dirs(*args)
Otk_Browse_Dirs(char prompt, int maxlength, char directory, char wildcards, char dirname, PyFunctionObject func=None) -> OtkWidget
source code
 
Otk_fb_add_optional_dirfile(*args)
Otk_fb_add_optional_dirfile(char dir_or_file)
source code
 
Otk_fb_clear_optional_dirfiles()
All entries made by this function will be available on all future calls to the file-browser, until cleared by this function.
source code
 
Otk_fbrowse_size_hint(*args)
Otk_fbrowse_size_hint(float width, float height, float horiz_center_offset, float vert_center_offset)
source code
 
Otk_handle_key_input(*args)
Otk_handle_key_input(int ks) -> int
source code
 
Otk_handle_key_release(*args)
Otk_handle_key_release(int ks)
source code
 
Otk_UpdateMouse(*args)
Otk_UpdateMouse(int x, int y, int state) -> int
source code
 
Otk_handle_mouse_move(*args)
Otk_handle_mouse_move(int MouseDx, int MouseDy) -> int
source code
 
Otk_Make_Menu(*args)
Otk_Make_Menu(OtkWidget container, float left, float top, float horiz_size, float vert_size, char text) -> OtkWidget
source code
 
Otk_Add_Menu_Item(*args)
Otk_Add_Menu_Item(OtkWidget container, char text, PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget
source code
 
Otk_Add_SubMenu(*args)
Otk_Add_SubMenu(OtkWidget container, char text) -> OtkWidget
source code
 
Otk_Set_Menu_Selectable(*args)
Otk_Set_Menu_Selectable(OtkWidget tmpobj, int on_notoff)
source code
 
Otk_Make_Selection_List(*args)
Otk_Make_Selection_List(OtkWidget container, int rows, int cols, float left, float top, float horiz_size, float vert_size) -> OtkWidget
source code
 
Otk_Frame_Selection_List(*args)
Otk_Frame_Selection_List(OtkWidget container)
source code
 
Otk_Add_Selection_Item(*args)
Otk_Add_Selection_Item(OtkWidget container, char text, PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget
source code
 
Otk_Coordinate_Selection_Lists(*args)
Otk_Coordinate_Selection_Lists(OtkWidget master_list, OtkWidget subordinate_list)
source code
 
Otk_MakeDisk(*args)
Otk_MakeDisk(OtkWidget container, float x, float y, float radius, OtkColor disk_color) -> OtkWidget
source code
 
Otk_MakeCircle(*args)
Otk_MakeCircle(OtkWidget container, float x, float y, float radius, OtkColor circ_color, float thickness) -> OtkWidget
source code
 
OtkMakeSliderVertical(*args)
OtkMakeSliderVertical(OtkWidget container, float left, float top, float vertical_size, PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget
source code
 
OtkMakeSliderHorizontal(*args)
OtkMakeSliderHorizontal(OtkWidget container, float left, float top, float horiz_size, PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget
source code
 
Otk_SetSlider(*args)
Otk_SetSlider(OtkWidget slider, float position, float sz)
source code
 
Otk_Set_Default_Slider_Width(*args)
Otk_Set_Default_Slider_Width(float x)
source code
 
Otk_Register_Hover_Box(*args)
Otk_Register_Hover_Box(OtkWidget obj, char text)
source code
 
Otk_Unregister_Hover_Box(*args)
Otk_Unregister_Hover_Box(OtkWidget obj)
source code
 
Otk_Set_HoverBox_Style(*args)
Otk_Set_HoverBox_Style(OtkColor box_color, OtkColor text_color, float text_size)
source code
 
Otk_Enable_Hoverboxes()
This function enables all hover-boxes.
source code
 
Otk_Disable_Hoverboxes()
This function disable all hover-boxes.
source code
 
OtkInitWindow(*args)
OtkInitWindow(int WinWidth, int WinHeight, int argc=0)
source code
 
OtkMakeOuterWindow()
This function is the alternative to OtkInitWindow above, for applications that are part of another OpenGL application which already opened the outer-window.
source code
 
OtkUpdateWindow(*args)
OtkUpdateWindow(int WinWidth, int WinHeight)
source code
 
OtkUpdateCheck()
Check-for and handle any screen updates or user interaction events.
source code
 
Otk_RemoveObject(*args)
Otk_RemoveObject(OtkWidget objt) -> OtkWidget
source code
 
Otk_ClearAll() source code
 
Set_PermanentObjs() source code
 
OtkDrawObjectTree() source code
 
Otk_ReDraw_Display() source code
 
Otk_Tabbed_Panel_New(*args)
Otk_Tabbed_Panel_New(OtkWidget parent, int num, OtkColor color, float left, ...
source code
 
Otk_Snapshot(*args)
Otk_Snapshot(char fname)
source code
 
Otk_SnapShot_Size(*args)
Otk_SnapShot_Size(int sz) -> int
source code
 
Otk_MakeMovie(*args)
Otk_MakeMovie(int on_notoff)
source code
int
Otk_Get_Shift_Key() source code
int
Otk_Get_Control_Key() source code
int
Otk_Get_MouseButton_Clicked() source code
 
Otk_Set_Mouse_Cursor(*args)
Otk_Set_Mouse_Cursor(int cursor_style)
source code
 
Otk_object_attach(*args)
Otk_object_attach(OtkWidget parent, OtkWidget child)
source code
 
Otk_object_attach_at_end(*args)
Otk_object_attach_at_end(OtkWidget parent, OtkWidget child)
source code
 
Otk_object_attach_hidden(*args)
Otk_object_attach_hidden(OtkWidget parent, OtkWidget child)
source code
 
Otk_object_attach_hidden_at_front(*args)
Otk_object_attach_hidden_at_front(OtkWidget parent, OtkWidget child)
source code
 
Otk_object_detach(*args)
Otk_object_detach(OtkWidget child)
source code
 
Otk_object_detach_hidden(*args)
Otk_object_detach_hidden(OtkWidget child)
source code
 
Otk_object_detach_any(*args)
Otk_object_detach_any(OtkWidget child)
source code
 
Otk_object_correct_position(*args)
Otk_object_correct_position(OtkWidget obj, int descend)
source code
 
Otk_calculate_object_position(*args)
Otk_calculate_object_position(OtkWidget container, OtkWidget obj)
source code
 
Otk_position_object(*args)
Otk_position_object(OtkWidget objpt, int absolute, float x, float y)
source code
 
Otk_move_object(*args)
Otk_move_object(OtkWidget objpt, int absolute, float x, float y)
source code
 
Otk_next_word(*args)
Otk_next_word(char line, char word, char delim)
source code
double
otk_report_time() source code
 
Otk_Start_Capturing_TestFile() source code
 
Otk_Close_TestFile() source code
 
Otk_Apply_Test_Stimuli(*args)
Otk_Apply_Test_Stimuli(char filename)
source code
 
Otk_Register_MouseClick_Callback(*args)
Otk_Register_MouseClick_Callback(PyFunctionObject func=None)
source code
 
Otk_Register_MouseMove_Callback(*args)
Otk_Register_MouseMove_Callback(PyFunctionObject func=None)
source code
 
Otk_Set_Window_Name(*args)
Otk_Set_Window_Name(char name)
source code
 
Otk_Set_Render_Quality_Hint(*args)
Otk_Set_Render_Quality_Hint(float q) -> float
source code
 
OtkMainLoop()
This function is one of the most important.
source code
 
Otk_MakeGauge2(*args)
Otk_MakeGauge2(OtkWidget container, float left, float top, float horiz_size, ...
source code
 
Otk_SetGauge2(*args)
Otk_SetGauge2(OtkWidget container, float value, OtkColor tmpcolor)
source code
 
Otk_SetLEDmeter(*args)
Otk_SetLEDmeter(OtkWidget container, float value, OtkColor offcolor, ...
source code
 
Otk_MakeLEDmeter(*args)
Otk_MakeLEDmeter(OtkWidget container, float left, float top, float horiz_size, ...
source code
 
Otk_MakeBarMeter(*args)
Otk_MakeBarMeter(OtkWidget container, float left, float top, float horiz_size, ...
source code
 
Otk_SetBarMeter(*args)
Otk_SetBarMeter(OtkWidget container, float value)
source code
 
Otk_Plot_Init(*args)
Otk_Plot_Init(OtkWidget container, char xlabel, char ylabel, float xpos, ...
source code
 
Otk_Plot_Set_Axes(*args)
Otk_Plot_Set_Axes(OtkWidget plotbox, float xmin, float xmax, int xgrids, ...
source code
 
Otk_Plot_Data(*args)
Otk_Plot_Data(OtkWidget plotbox, int npoints, OtkColor color)
source code
 
Otk_Plot_Data_AutoScaled(*args)
Otk_Plot_Data_AutoScaled(OtkWidget plotbox, int npoints, OtkColor dcolor, OtkColor tcolor, ...
source code
 
Otk_StripChart_Init(*args)
Otk_StripChart_Init(OtkWidget plotbox, int xrange, float ymin, float ymax, ...
source code
 
Otk_StripChart_AddPoint(*args)
Otk_StripChart_AddPoint(OtkWidget plotbox, float value)
source code
 
Otk_AddIndicatorLight(*args)
Otk_AddIndicatorLight(OtkWidget container, float x, float y, float radius, ...
source code
 
Otk_SetIndicatorLight(*args)
Otk_SetIndicatorLight(OtkWidget indlght, OtkColor color)
source code
 
Otk_SetIndicatorLightBorder(*args)
Otk_SetIndicatorLightBorder(OtkWidget indlght, OtkColor color)
source code
Variables [hide private]
  _newclass = 1
  Otk_Flat = 0
  Otk_Raised = 1
  Otk_Recessed = 2
  Otk_Invisible = 10
  Otk_ImagePanel = 20
  Otk_SC_Panel = 1
  Otk_SC_TextLabel = 2
  Otk_SC_Button = 3
  Otk_SC_FormBox = 4
  Otk_SC_Line = 5
  Otk_SC_Box = 500
  Otk_SC_hSlider = 6
  Otk_SC_vSlider = 7
  Otk_SC_textscrollbar = 8
  Otk_SC_Window = 10
  Otk_SC_WindowPane = 11
  Otk_SC_Menu_DropDown_Button = 12
  Otk_SC_Menu_Item = 14
  Otk_SC_Menu_Submenu = 15
  Otk_SC_RadioButton = 20
  Otk_SC_ToggleButton = 30
  Otk_SC_Select_List = 40
  Otk_SC_Select_List_Item = 41
  Otk_SC_Select_List_SubList = 42
  Otk_SC_TabHandle = 300
  Otk_class_panel = 1
  Otk_class_text = 2
  Otk_class_button = 3
  Otk_class_line = 5
  Otk_class_box = 500
  Otk_class_radiobutton1 = 20
  Otk_class_radiobutton2 = 21
  Otk_class_togglebutton = 30
  Otk_class_triangle = 100
  Otk_class_disk = 200
  Otk_class_circle = 250
  Otk_class_userdefd = 1000
  Otk_class_other = 2000
  Otk_subtype_plane = 0
  Otk_subtype_raised = 1
  Otk_subtype_recessed = 2
  Otk_subtype_moveable = 3
  Otk_subtype_recessed_diamond = 4
  Otk_subtype_raised_diamond = 5
  Otk_hover_mask = 1
  Otk_MouseCursor_Arrow = 0
  Otk_MouseCursor_Cross = 1
  Otk_MouseCursor_Hand = 2
  Otk_MouseCursor_Wait = 3
  Otk_Font_Vect = 0
  Otk_Font_Helv = 1
  Otk_FontDefault = 1
  Otk_FontSpacing_Mono = 0
  Otk_FontSpacing_Proportional = 1
  Otk_FontSpacingDefault = 0
  Otk_SC_Gauge1 = 2001
  Otk_SC_Gauge2 = 2002
  Otk_SC_LEDmeter = 2100
  Otk_SC_BarMeter = 2200
  Otk_SC_XYgraph = 2300
  Otk_SC_XYaxis = 2301
  Otk_SC_XYdata = 2302
  OTK_SC_IndicatorLight = 2400
  Otk_White = <otk.otk.OtkColor_record; proxy of <Swig Object of...
  Otk_LightGray = <otk.otk.OtkColor_record; proxy of <Swig Objec...
  Otk_Gray = <otk.otk.OtkColor_record; proxy of <Swig Object of ...
  Otk_DarkGray = <otk.otk.OtkColor_record; proxy of <Swig Object...
  Otk_Black = <otk.otk.OtkColor_record; proxy of <Swig Object of...
  Otk_Red = <otk.otk.OtkColor_record; proxy of <Swig Object of t...
  Otk_Green = <otk.otk.OtkColor_record; proxy of <Swig Object of...
  Otk_Blue = <otk.otk.OtkColor_record; proxy of <Swig Object of ...
  Otk_Cyan = <otk.otk.OtkColor_record; proxy of <Swig Object of ...
  Otk_Yellow = <otk.otk.OtkColor_record; proxy of <Swig Object o...
  Otk_Orange = <otk.otk.OtkColor_record; proxy of <Swig Object o...
  Otk_Violet = <otk.otk.OtkColor_record; proxy of <Swig Object o...
  cvar = <Swig global variables>
  OtkOuterWindow = None
  Otk_MouseX = -1.0
  Otk_MouseY = -1.0
  __package__ = 'otk'
Function Details [hide private]

OtkMakePanel(*args)

source code 

OtkMakePanel(OtkWidget container, int panel_type, OtkColor panel_color, 
    float left, float top, float horiz_size, 
    float vert_size) -> OtkWidget

This function makes a rectangular panel, either flat, raised, or recessed, within the
parent window or panel.  The concept of the panel, also called a container widget,
is a very important aspect of Otk.  All other widgets and sub-panels must be placed on a 
container/panel.  The OtkOuterWindow is the first container/panel, and is provided by default.
Placing sub-panels on a panel provides a method of dividing-up the parent panel.

Returns OtkWidget.

Container - is the parent container-panel, onto which the new panel is placed, and to whose
  frame the coordinates will be relative.

Panel types currently include:
   Otk_Flat = Plan flat rectangle.
   Otk_Raised = Raised rectangle.
   Otk_Recessed = Recessed Rectangle.
  (In the future, more panel types could be added.)

Color is an OtkColor record.

The left, top, coordinates are relative to the parent window/container origin.
All coordinates are in percentage of outer window size, where the upper left corner is (0.0,0.0)
and the lower right corner is (100.0,100.0).

The following related functions set additional attributes or change default settings:

Otk_Set_Object_Border_Thickness( OtkWidget panel, float thickness )
Otk_Set_Default_Border_Thickness( float thickness )
OtkResizePanel( OtkWidget panel, float left, float top, float horiz_size, float vert_size )
Otk_Tabbed_Panel_New( parent, num, **names, color, left, top, width, height, button_height )

See Panel Functions for more on panel-related functions.

OtkResizePanel(*args)

source code 

OtkResizePanel(OtkWidget panel, float left, float top, float horiz_size, 
    float vert_size)

OtkMakeImagePanel(*args)

source code 

OtkMakeImagePanel(OtkWidget container, char file_name, float left, float top, 
    float horiz_size, float vert_size) -> OtkWidget

Otk_Dispose_Image(*args)

source code 

Otk_Dispose_Image(char file_name)

Removes all resources associated with the named image, from the graphics-card, when an image is no longer needed. This is to be used after an image was loaded via OtkMakeImagePanel, and/or related image functions, and later the object is removed and it is known the image is no longer needed. (Normally, one copy of each image is retained in graphics memory that can be referenced by many object instances, and for rapid re-use.)

Otk_Add_Line(*args)

source code 

Otk_Add_Line(OtkWidget container, OtkColor tmpcolor, float thickness, 
    float x1, float y1, float x2, float y2) -> OtkWidget

Often it is useful to add lines or separators to a GUI panel.  General purpose lines can be
added with the Otk_Add_Line function.  Specify the window/container, line color, thickness, 
and the coordinates to draw the line from (x1,y1) and to (x2,y2).  The coordinates are in 
percentages of the container-window.  Boxes can be drawn as a set of four lines.

Otk_Add_BoundingBox(*args)

source code 

Otk_Add_BoundingBox(OtkWidget container, OtkColor tmpcolor, float thickness, 
    float x1, float y1, float x2, float y2) -> OtkWidget

Makes a rectangular separating boundary outline, whose upper left corner is (x1,y1) and lower
right corner is (x2,y2).

OtkMakeTextLabel(*args)

source code 

OtkMakeTextLabel(OtkWidget container, char text, OtkColor text_color, 
    float scale, float thickness, float x, float y) -> OtkWidget

This function places text onto a panel or window.

    Returns OtkWidget.

    Panel - is the container-panel, or parent widget, on which the label is attached/placed.
        And to whose frame the coordinates will be relative!
    Text - is the character string array to make the label out of.
    Fontcolor - an OtkColor record.
    fontsize - A float scaling factor.  1.0 is normal size, with each character being 12.0% high
        by 8.0% wide in Otk coordinates.
    fontweight - 1.0 is normal. 2.0 is bold (double-thick).
    x, y - Coordinates of the origin of the label.  Upper left edge relative to containing panel's 
        upper left origin.

    The following related functions set additional attributes or change default settings:
        Otk_Modify_Text( OtkWidget label, char *text ) 
        Otk_Modify_Text_Aspect( OtkWidget label, float aspect ) 
        Otk_Modify_Text_Scale( OtkWidget label, float scale ) 
        Otk_Modify_Text_Color( OtkWidget label, OtkColor text_color ) 
        Otk_Modify_Text_Slant( OtkWidget label, float slant ) 
        Otk_Modify_Text_Thickness( OtkWidget label, float thickness ) 
        Otk_Modify_Text_Position( OtkWidget label, float x, float y ) 
            Otk_Set_Text_Aspect( float aspect ) 
        Otk_Get_Character_Size( OtkWidget label, float *width, float *height ) 
        Otk_Get_Text_Size( OtkWidget label, float *width, float *height ) 
        Otk_FitTextInPanel( OtkWidget label ) 

OtkMakeButton(*args)

source code 

OtkMakeButton(OtkWidget container, float left, float top, float horiz_size, 
    float vert_size, char text, PyFunctionObject func=None, 
    PyObject parameter=None) -> OtkWidget

This function makes a push-button that will call the named user's function when pressed.

Returns OtkWidget.

   Panel - is the container-panel, or parent widget, on which the button is attached/placed.
           And to whose frame the coordinates will be relative!

   x, y - Coordinates of the button's upper-left corner on the containing panel (in %).
           Relative to containing panel's upper left origin.

horiz_size, vert_size - Horizontal and vertical size of the button, in % of the 
   containing window's size.

   Text - is the character string array to put onto the button.

CallBack - Function which gets called back when button is pressed.
CallParam - Parameter passed to callback function.

OtkMakeToggleButton(*args)

source code 

OtkMakeToggleButton(OtkWidget container, float left, float top, float horiz_size, 
    float vert_size, PyFunctionObject func=None, 
    PyObject parameter=None) -> OtkWidget

This function makes a simple toggle-button on the panel.  When pressed, it toggles it's state,
and calls the named user function while passing the given parameter.  The parameter, such as an
integer, can be used to identify which button was pressed.

Returns OtkWidget handle.
Where:
    container - is the container-panel, or parent widget, on which the button is attached/placed.
            And to whose frame the coordinates will be relative!
    x, y - Coordinates of the button's upper-left corner on the containing panel (in %).
            Relative to containing panel's upper left origin.
horiz_size, vert_size - The horizontal and vertical size of the button in percentage
    of the containing window.
callback - User function called when toggled.
parameter - parameter passed to user function.

The following are related functions:

void Otk_Set_Button_State( OtkWidget button, int state )

    Causes named button to assume the specified state of:
        0 = not toggled, not depressed.
        1 = toggled on, depressed.

int Otk_Get_Button_State( OtkWidget button)

    Returns the named button's state as 0=not-depressed, or 1=depressed.

OtkMakeRadioButton(*args)

source code 

OtkMakeRadioButton(OtkWidget container, float left, float top, float horiz_size, 
    float vert_size, PyFunctionObject func=None, 
    PyObject parameter=None) -> OtkWidget

This function places a radio-button onto the panel.  The first radio-button of a set must name the
parent-panel/window as the container.  The remaining radio-buttons in a set must name one of the
other buttons in the set as their parent-container.  When pressed, the pressed radio button is
set, and the others are un-set.  Only one radio-button in a set has the depressed state at a time.
The named user function is called when pressed, and the given parameter value is passed.
The parameter, such as an integer, can be used to identify which button was pressed.

Returns OtkWidget handle.
Where:
    container - is the container-panel, or parent widget, on which the button is attached/placed.
            And to whose frame the coordinates will be relative!
    x, y - Coordinates of the button's upper-left corner on the containing panel (in %).
            Relative to containing panel's upper left origin.
horiz_size, vert_size - The horizontal and vertical size of the button in percentage
    of the containing window.
callback - User function called when toggled.
parameter - parameter passed to user function.

The following are related functions:    

void Otk_SetRadioButton( OtkWidget radiobutton )

    Causes named button to be depressed, while releasing all others in the set.

int Otk_Get_Button_State( OtkWidget button)

    Returns the named button's state as 0=not-depressed, or 1=depressed.

OtkMakeWindow(*args)

source code 

OtkMakeWindow(int panel_type, OtkColor tab_color, OtkColor panel_color, 
    float left, float top, float horiz_size, 
    float vert_size) -> OtkWidget

This function makes a floating sub-window which can be closed by the user.
Widgets can then be added to this window, like any other container-window.

OtkSetWindowTitle(*args)

source code 

OtkSetWindowTitle(OtkWidget window, OtkColor text_color, char title)

This function sets a sub-window's title. It places text in the window title-bar.

OtkMakeTextFormBox(*args)

source code 

OtkMakeTextFormBox(OtkWidget container, char text, int ncols, float x, 
    float y, float horiz_size, float vert_size, 
    PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget

This function places a text fill-in box on the panel.  Initial text can be placed in the box, or
it can be initialized blank ().  Your own call-back function is called when <Enter> is
pressed.  The text can also be read from the box by the Otk_Get_Text function below.

 Returns OtkWidget handle.

 Where:
     container - is the container-panel, or parent widget, on which the form-box is attached/placed.
             And to whose frame the coordinates will be relative!
 text - any initial text to place in the fill-in box.  Can be empty string, .
 ncols - number of characters to fit in the box.  (Note that the width of the box is specified
     by the horiz_size parameters, so the ncols really sets the horizontal size of the 
     characters to fit in the box of that size.)
     x, y - Location of the fill-in box's upper-left corner on the containing panel (in %).
             Relative to containing panel's upper left origin.
 horiz_size, vert_size - The horizontal and vertical size of the fill-in box in percentage
     of the containing window.
 callback - Your function to call when <enter> is pressed.  
 parameter - arbitrary parameter to pass to your callback function.

 The following are related functions:   

     void Otk_Modify_Text( OtkWidget textbox, char *text ) 

     Places the specified text in the form box.
 
     void *Otk_Get_Text( OtkWidget textbox, char *text, int n ) 

     Returns any text from the specified form-box into the character-array in the
     second parameter.  The third parameter should be specified as the maximum length of
     the character array for safety.

OtkMakeTextEditBox(*args)

source code 

OtkMakeTextEditBox(OtkWidget container, char text, int nrows, int ncols, 
    float left, float top, float horiz_size, float vert_size) -> OtkWidget

This function places a multi-row text-edit box on the panel.  Initial text can be placed in the box, or
it can be initialized blank ('').  The text can be read from the box by the Otk_Get_Text function below.
Much like the simple text-box above, but enables more than one row, and has no callback function, since
<enter> is legal character to break lines in the edit-box.  Read any entered text with the 
Otk_Get_Text (below), perhaps initiated by an 'ok' button callback..

Returns OtkWidget handle.

Where:
    container - is the container-panel, or parent widget, on which the edit-box is attached/placed.
            And to whose frame the coordinates will be relative!
text - any initial text to place in the edit-box.  Can be empty string, ''.
ncols - number of character columns to fit in the box.  (Note that the size of the box is 
    specified by the horiz_size and vert_size parameters, so ncols and nrows really set
    the horizontal and vertical size of the characters to fit in the box.)
nrows - number of character rows to fit in the box.  
    x, y - Location of the edit-box's upper-left corner on the containing panel (in %).
            Relative to containing panel's upper left origin.
horiz_size, vert_size - The horizontal and vertical size of the edit-box in percentage
    of the containing window.

The following are related functions:

    OtkAddTextScrollbar( OtkWidget container, float width )

    Otk_Get_Text( OtkWidget textbox, char *text, int n )

Otk_Browse_Files(*args)

source code 

Otk_Browse_Files(char prompt, int maxlength, char directory, char wildcards, 
    char filename, PyFunctionObject func=None) -> OtkWidget

This is a higher level convenience widget that is useful for helping the user find files to open, 
save-as, import, or etc..  You can indicate the intended operation to the user through the prompt
argument.  The Otk_Browse_Files widget allows navigation of the file system by showing the
files in the directory, and by going up and down into other directories.  It allows filtering the
displayed files.  Defaults can be supplied for the file name, directory, and filter (wildcards), 
which the user can also change.  The Otk_Browse_Files routine will call the user-supplied
call-back routine when a file is selected.  It passes the selected file's name as a character
string into the call-back function, where you can open the file for reading/writing, or whatever.  

Where:
 prompt - Input (can be constant literal string).  The 'title' string or purpose
     of the browser window.  For example:  'Open' 'Save-As' 'Import' etc..
 maxlength - The minimum array size of the next three character string parameters, 
    (directory, wildcard, filename).  If any strings to be returned are longer than or equal
    to maxlength, then the returned string is truncated to maxlength-1 characters for safety.
 directory - Input/Output.  Must point to an allocated[*] character string array variable
    of size maxlength or greater.  This specifies the starting directory for browsing.
    Often set to '.' (local directory) initially.  If user browses to other directories,
    then last visited directory path is copied to this string.  Path may be relative or absolute.
 filetype_filter - Input/Output.  Must point to an allocated[*] character string array
    variable of size maxlength or greater.  This specifies the type of files to filter and
    list, much like file-wildcards, such as *.doc .  For example, '*.txt *.dat', 
    or for everything '*'.  If the user changes the file-type setting, the new setting is
    returned in this string.
 filename - Input/Output.  Must point to an allocated[*] character string array variable of
        size maxlength or greater.  This specifies any initial file-name to place in the
    file-name box, if any.  Often, an empty file-name string is passed in.
    The selected file name is copied into this string.  The whole purpose of this
    widget is to select the file-name, so this is the primary output of the routine.
    At most maxlength-1 characters will be copied into the file-name array.
 callback - The user's callback function.  Function will called when file is selected.
    The selected file is passed as the argument.

For complete example, see: File Browser Example.

Otk_Browse_Dirs(*args)

source code 

Otk_Browse_Dirs(char prompt, int maxlength, char directory, char wildcards, 
    char dirname, PyFunctionObject func=None) -> OtkWidget

Sometimes your application needs to locate a directory; not a particular file.
In this case, is the Otk_Browse_Dirs function, instead of Otk_Browse_Files.

This function displays only directories. Users can navigate directories by double-clicking them.
The final directory is selected by clicking the OK button.

Otk_fb_add_optional_dirfile(*args)

source code 

Otk_fb_add_optional_dirfile(char dir_or_file)

You can provide a pull-down menu to the right of the file-name entry, for the purpose of suggesting alternate, or recently visited, directory(s) or files

Otk_fbrowse_size_hint(*args)

source code 

Otk_fbrowse_size_hint(float width, float height, float horiz_center_offset, 
    float vert_center_offset)

The file and directory-browser gadgets attempt to display themselves at a reasonable size and
aspect ratio, depending on the application window's size.  For various reasons, you may wish
to have the broswer be a different size, aspect ratio, or screen position.  You can control
these things with the Otk_fbrowse_size_hint function.

The coordinates are all in percent of the outer window.

Otk_Make_Menu(*args)

source code 

Otk_Make_Menu(OtkWidget container, float left, float top, float horiz_size, 
    float vert_size, char text) -> OtkWidget

This function creates a menu pull-down.  This forms the top-level entry-point to a pull-down
menu.  Items are then added to the menu with the Otk_Add_Menu_Item and/or Otk_Add_SubMenu functions
described below.

Otk_Add_Menu_Item(*args)

source code 

Otk_Add_Menu_Item(OtkWidget container, char text, PyFunctionObject func=None, 
    PyObject parameter=None) -> OtkWidget

This function adds a menu item to a pull-down menu.

Otk_Add_SubMenu(*args)

source code 

Otk_Add_SubMenu(OtkWidget container, char text) -> OtkWidget

This function creates a sub-menu pull-down on an existing menu.

Otk_Set_Menu_Selectable(*args)

source code 

Otk_Set_Menu_Selectable(OtkWidget tmpobj, int on_notoff)

This function deativates (0) or activates (1) a menu-item.

Otk_Make_Selection_List(*args)

source code 

Otk_Make_Selection_List(OtkWidget container, int rows, int cols, float left, 
    float top, float horiz_size, float vert_size) -> OtkWidget

This function creates a scrollable selection-list container at the specified location and size.
Use Otk_Add_Selection_Item to add items to the list.  If more than rows items are added,
a scroll-bar is automatically added to the list.

Otk_Add_Selection_Item(*args)

source code 

Otk_Add_Selection_Item(OtkWidget container, char text, PyFunctionObject func=None, 
    PyObject parameter=None) -> OtkWidget

This function adds the specified text string to the referenced selection-list.  If selected by the
user, the named callback function will be called and the specified parameter will be passed.
In actual usage, often, all entries are assigned a common callback function with parameters assigned
sequentially to identify the selected item in the callback.

Otk_Coordinate_Selection_Lists(*args)

source code 

Otk_Coordinate_Selection_Lists(OtkWidget master_list, OtkWidget subordinate_list)

This function links multiple selection lists together, so that all are controlled by a single scroll-bar, and all scroll together. It is a convenient way to create multiple-column scrolling selection lists. This function is to be called after the list widgets have been created with Otk_Make_Selection_List, but before any items have been added to the lists. One list is designated as the master-list, since it will have the scroll-bar. Usually, all lists in a group are created next to each other, at equal height and size. The right-most list is usually designated as the master, since the scroll-bar attaches to the right side, when there are sufficient items in the list. It is assumed that all lists in such a group will always hold an equal number of items. See example application: multiple_selection_lists.py.

Otk_MakeDisk(*args)

source code 

Otk_MakeDisk(OtkWidget container, float x, float y, float radius, 
    OtkColor disk_color) -> OtkWidget

Places a solid disk of the specified color and radius centered at (x,y).

Otk_MakeCircle(*args)

source code 

Otk_MakeCircle(OtkWidget container, float x, float y, float radius, 
    OtkColor circ_color, float thickness) -> OtkWidget

Places an empty circular ring of the specified color, radius, and line-thickness, centered at (x,y).
Normal thickness is 1.0, while 2.0 is double thickness, etc..

OtkMakeSliderVertical(*args)

source code 

OtkMakeSliderVertical(OtkWidget container, float left, float top, float vertical_size, 
    PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget

This function places a vertical slider onto the named panel.  See OtkMakeSliderHorizontal above.

OtkMakeSliderHorizontal(*args)

source code 

OtkMakeSliderHorizontal(OtkWidget container, float left, float top, float horiz_size, 
    PyFunctionObject func=None, PyObject parameter=None) -> OtkWidget

This function places a horizontal slider onto the named panel.  The named user function
is called when the slider is moved.  The new slider position is passed as the first value
in the range 0.0 to 1.0.  The given parameter is passed as the second value.  The parameter
can be used for a variety of purposes, and it can be a pointer to a larger data structure.
One usage of the parameter is to uniquely identify which slider moved, when a single
call-back routine is used to handle multiple sliders.

Otk_SetSlider(*args)

source code 

Otk_SetSlider(OtkWidget slider, float position, float sz)

This function places the slider knob at the specified position, from 0.0 to 1.0. For vertical sliders, 0.0 is the bottom, and 1.0 is the top. For horizontal sliders, 0.0 is the left side, and 1.0 is the right side. These values also correspond to the values returned from the slider.

This function can also set the size of the slider knob. The default knob size is 1.0.

Otk_Register_Hover_Box(*args)

source code 

Otk_Register_Hover_Box(OtkWidget obj, char text)

Hover-boxes, sometimes called Tool-Tips, are useful to provide hints about buttons or other controls. They pop-up a small text-message when the mouse hovers over the given item for a prolonged period.

This function associates the given widget, usually a button or menu, with the text message. The message will pop-up when the mouse hovers over the given widget.

Otk_Enable_Hoverboxes()

source code 

This function enables all hover-boxes. Hover-boxes are initially enabled by default.

Otk_Disable_Hoverboxes()

source code 

This function disable all hover-boxes. Hover-boxes are initially enabled by default.

OtkInitWindow(*args)

source code 

OtkInitWindow(int WinWidth, int WinHeight, int argc=0)

This function is one of the most important. It produces the initial outer window, called OtkOuterWindow, You specify the initial size of the window in pixels for width and height. You can pass command-line arguments as argc and argv. It must be called first, before any other Otk calls. OtkInitWindow is intended for stand-alone applications.

OtkMakeOuterWindow()

source code 

This function is the alternative to OtkInitWindow above, for applications that are part of another OpenGL application which already opened the outer-window. It initializes the Otk global variables and establishes the OtkOuterWindow widget within the existing window. It must be called first, before any other Otk calls. Often used with OtkUpdateCheck().

OtkUpdateCheck()

source code 

Check-for and handle any screen updates or user interaction events. Normally, this is handled by the OtkMainLoop() function. However, some applications may either be busy for a long while, or do not wish to have Otk be the main routine. (OtkMainLoop never returns, it just calls other routines.) In such situations, call OtkUpdateCheck() periodically. It allows your application to respond to user interactions or screen updates. OtkUpdateCheck simply returns if there are no pending events, or handles them and returns, but never blocks.

Otk_RemoveObject(*args)

source code 

Otk_RemoveObject(OtkWidget objt) -> OtkWidget

Removes the referenced object, and it's children.

Otk_Tabbed_Panel_New(*args)

source code 

Otk_Tabbed_Panel_New(OtkWidget parent, int num, OtkColor color, float left, 
    float top, float width, float height, float button_height) -> OtkTabbedPanel

Otk_Snapshot(*args)

source code 

Otk_Snapshot(char fname)

Captures an image snapshot of the current screen window to the specified filename. It saves it as a PPM color image, which can be converted to other formats by a variety of means, such as the NetPBM utilities.

Otk_SnapShot_Size(*args)

source code 

Otk_SnapShot_Size(int sz) -> int

Sets snap-shot size: 1=full-size, 2=half-size. Half-size images require less time to save, and are automatically anti-aliased for improved image appearance. Useful for rapid repeated saves, such as capturing making frames.

Otk_MakeMovie(*args)

source code 

Otk_MakeMovie(int on_notoff)

A value of 1, begins capturing frames at a regular rate. The snapshot frames are sequentially numbered, and can be combined into MPEG or AVI movies, via tools such as mencoder or ppmtompeg.

Otk_Set_Mouse_Cursor(*args)

source code 

Otk_Set_Mouse_Cursor(int cursor_style)

Sometimes it is useful to change the mouse-cursor to a different shape.

Where the cursor_style can be one of the following: Otk_MouseCursor_Arrow - Default pointer. Otk_MouseCursor_Cross - Useful when ready to mark a location. Otk_MouseCursor_Hand - Useful when in grabbing mode. Otk_MouseCursor_Wait - Useful while waiting for something (ex. Hour-glass)

Otk_Register_MouseClick_Callback(*args)

source code 

Otk_Register_MouseClick_Callback(PyFunctionObject func=None)

The state value of the MouseClick_Callback function passes in 0 when the left mouse-button is down, and 1 when the mouse-button is up. When your callback function is called, the value of the global variables, cvar.Otk_MouseX and cvar.Otk_MouseY, hold the mouse position in OTK coordinates, which are the percentage of the window from 0.0 to 100.0 horizontally and vertically, respectively.

Otk_Register_MouseMove_Callback(*args)

source code 

Otk_Register_MouseMove_Callback(PyFunctionObject func=None)

When your callback function is called, the value of the global variables, cvar.Otk_MouseX and cvar.Otk_MouseY, hold the mouse position in OTK coordinates, which are the percentage of the window from 0.0 to 100.0 horizontally and vertically, respectively.

Otk_Set_Window_Name(*args)

source code 

Otk_Set_Window_Name(char name)

This function sets the outer-window's name in the window's title-bar. It must be called before calling: OtkInitWindow.

OtkMainLoop()

source code 

This function is one of the most important. It is the Otk event-loop. It makes everything happen. You need to call this once, usually near the end of your application's main() routine. It does not return until the application exits. The OtkMainLoop routine is an infinite while loop that waits for keyboard or mouse input, then calls appropriate handlers, and then waits for more input. Otk is single-threaded. This function is called last, after the Otk calls which set up the initial window.

See also OtkUpdateCheck(). OtkMainLoop is equivalent to a while(1) loop around OtkUpdateCheck().

Otk_MakeGauge2(*args)

source code 

Otk_MakeGauge2(OtkWidget container, float left, float top, float horiz_size, 
    float vert_size, char title) -> OtkWidget

Otk_SetLEDmeter(*args)

source code 

Otk_SetLEDmeter(OtkWidget container, float value, OtkColor offcolor, 
    OtkColor oncolor)

Otk_MakeLEDmeter(*args)

source code 

Otk_MakeLEDmeter(OtkWidget container, float left, float top, float horiz_size, 
    float vert_size, int nbars, char orientation, 
    OtkColor tmpcolor) -> OtkWidget

Otk_MakeBarMeter(*args)

source code 

Otk_MakeBarMeter(OtkWidget container, float left, float top, float horiz_size, 
    float vert_size, char orientation, 
    OtkColor tmpcolor) -> OtkWidget

Otk_Plot_Init(*args)

source code 

Otk_Plot_Init(OtkWidget container, char xlabel, char ylabel, float xpos, 
    float ypos, float width, float height, 
    OtkColor fgcolor, OtkColor bgcolor) -> OtkWidget

Otk_Plot_Set_Axes(*args)

source code 

Otk_Plot_Set_Axes(OtkWidget plotbox, float xmin, float xmax, int xgrids, 
    float ymin, float ymax, int ygrids, OtkColor tcolor, 
    OtkColor gcolor)

Otk_Plot_Data_AutoScaled(*args)

source code 

Otk_Plot_Data_AutoScaled(OtkWidget plotbox, int npoints, OtkColor dcolor, OtkColor tcolor, 
    OtkColor gcolor, int xgrids, int ygrids)

Otk_StripChart_Init(*args)

source code 

Otk_StripChart_Init(OtkWidget plotbox, int xrange, float ymin, float ymax, 
    OtkColor text_color, OtkColor grid_color, 
    OtkColor data_color)

Otk_AddIndicatorLight(*args)

source code 

Otk_AddIndicatorLight(OtkWidget container, float x, float y, float radius, 
    OtkColor color) -> OtkWidget


Variables Details [hide private]

Otk_White

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x22cbb90> >

Otk_LightGray

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x22c0380> >

Otk_Gray

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e2830> >

Otk_DarkGray

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e2850> >

Otk_Black

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e2870> >

Otk_Red

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e2890> >

Otk_Green

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e28b0> >

Otk_Blue

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e28d0> >

Otk_Cyan

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e28f0> >

Otk_Yellow

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e2910> >

Otk_Orange

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e2930> >

Otk_Violet

Value:
<otk.otk.OtkColor_record; proxy of <Swig Object of type 'OtkColor *' a\
t 0x26e2950> >