PreviousUpNext

14.4.26  Gtk

The standard library Gtk api defines access to base-level Gtk functionality.

The Gtk api is implemented by the gtk package.

The Gtk api source code is in src/lib/src/gtk.api.

See also: Gtk_Driver.See also: Easy_Gtk.

The above information is manually maintained and may contain errors.

api {    exception GTK_ERROR String;
    Session ;
    Widget ;
    Event_Mask 
      = BUTTON1_MOTION_MASK
      | BUTTON2_MOTION_MASK
      | BUTTON3_MOTION_MASK
      | BUTTON_MOTION_MASK
      | BUTTON_PRESS_MASK
      | BUTTON_RELEASE_MASK
      | ENTER_NOTIFY_MASK
      | EXPOSURE_MASK
      | FOCUS_CHANGE_MASK
      | KEY_PRESS_MASK
      | KEY_RELEASE_MASK
      | LEAVE_NOTIFY_MASK
      | POINTER_MOTION_HINT_MASK
      | POINTER_MOTION_MASK
      | PROPERTY_CHANGE_MASK
      | PROXIMITY_IN_MASK
      | PROXIMITY_OUT_MASK
      | STRUCTURE_MASK;
    Void_Callback  = Void -> Void;
    Bool_Callback  = Bool -> Void;
    Float_Callback  = Float -> Void;
    Button_Event_Callback  =
      ?.gtk_event::Button_Event -> Void;
    Key_Event_Callback  = ?.gtk_event::Key_Event -> Void;
    Expose_Event_Callback  =
      ?.gtk_event::Expose_Event -> Void;
    Motion_Event_Callback  =
      ?.gtk_event::Motion_Event -> Void;
    Configure_Event_Callback  =
      ?.gtk_event::Configure_Event -> Void;
    Pack_From  = FROM_END | FROM_START;
    Arrow_Direction 
      = ARROW_DOWN | ARROW_LEFT | ARROW_RIGHT | ARROW_UP;
    Shadow_Style 
      = SHADOW_ETCHED_IN
      | SHADOW_ETCHED_OUT
      | SHADOW_IN
      | SHADOW_NONE
      | SHADOW_OUT;
    Metric  = CENTIMETERS | INCHES | PIXELS;
    Scrollbar_Policy  = POLICY_ALWAYS | POLICY_AUTOMATIC;
    Justification 
      = JUSTIFY_CENTER
      | JUSTIFY_FILL
      | JUSTIFY_LEFT
      | JUSTIFY_RIGHT;
    Position_Type 
      = POSITION_BOTTOM
      | POSITION_LEFT
      | POSITION_RIGHT
      | POSITION_TOP;
    Update_Policy 
      = CONTINUOUS_UPDATES
      | DELAYED_UPDATES
      | DISCONTINUOUS_UPDATES;
    Table_Attach_Option 
      = TABLE_EXPAND | TABLE_FILL | TABLE_SHRINK;
    set_widget_tree : (Session , Widget) -> Void;
    make_session : List(String ) -> Session;
    run_eventloop_indefinitely : Session -> Void;
    run_eventloop_once : {block_until_event:Bool,  session:Session} -> Bool;
    quit_eventloop : Session -> Void;
    make_dialog : Session
                  -> {action_area:Widget,  dialog:Widget,  vbox:Widget};
    set_easy_id : (Session , String , Widget) -> Void;
    get_by_easy_id : (Session , String) -> Widget;
    drop_easy_id : (Session , String) -> Void;
    unref_object : (Session , Widget) -> Void;
    get_widget_allocation : (Session , Widget) -> ?.gtk_event::Allocation;
    get_window_pointer : (Session , Widget)
                         -> {modifiers:List(?.gtk_event::Modifier ),  x:Int, 
                             y:Int};
    make_window : Session -> Widget;
    make_label : (Session , String) -> Widget;
    make_status_bar_context_id : (Session , Widget , String) -> Int;
    make_menu : Session -> Widget;
    make_option_menu : Session -> Widget;
    make_menu_bar : Session -> Widget;
    make_combo_box : Session -> Widget;
    make_text_combo_box : Session -> Widget;
    make_frame : (Session , String) -> Widget;
    make_button : Session -> Widget;
    make_button_with_label : (Session , String) -> Widget;
    make_button_with_mnemonic : (Session , String) -> Widget;
    make_toggle_button : Session -> Widget;
    make_toggle_button_with_label : (Session , String) -> Widget;
    make_toggle_button_with_mnemonic : (Session , String) -> Widget;
    make_check_button : Session -> Widget;
    make_check_button_with_label : (Session , String) -> Widget;
    make_check_button_with_mnemonic : (Session , String) -> Widget;
    make_menu_item : Session -> Widget;
    make_menu_item_with_label : (Session , String) -> Widget;
    make_menu_item_with_mnemonic : (Session , String) -> Widget;
    make_first_radio_button : Session -> Widget;
    make_next_radio_button : (Session , Widget) -> Widget;
    make_first_radio_button_with_label : (Session , String) -> Widget;
    make_next_radio_button_with_label : (Session , Widget , String) -> Widget;
    make_first_radio_button_with_mnemonic : (Session , String) -> Widget;
    make_next_radio_button_with_mnemonic : (Session , Widget , String) -> Widget;
    make_arrow : (Session , Arrow_Direction , Shadow_Style) -> Widget;
    set_arrow : (Session , Widget , Arrow_Direction , Shadow_Style)
                -> Void;
    make_horizontal_box : (Session , Bool , Int) -> Widget;
    make_vertical_box : (Session , Bool , Int) -> Widget;
    make_horizontal_button_box : Session -> Widget;
    make_vertical_button_box : Session -> Widget;
    make_table : {cols:Int,  homogeneous:Bool,  rows:Int, 
                  session:Session}
                 -> Widget;
    make_event_box : Session -> Widget;
    make_image_from_file : (Session , String) -> Widget;
    make_horizontal_separator : Session -> Widget;
    make_vertical_separator : Session -> Widget;
    make_layout_container : Session -> Widget;
    layout_put : {kid:Widget,  layout:Widget,  session:Session, 
                  x:Int,  y:Int}
                 -> Void;
    layout_move : {kid:Widget,  layout:Widget,  session:Session, 
                   x:Int,  y:Int}
                  -> Void;
    make_fixed_container : Session -> Widget;
    fixed_put : {kid:Widget,  layout:Widget,  session:Session, 
                 x:Int,  y:Int}
                -> Void;
    fixed_move : {kid:Widget,  layout:Widget,  session:Session, 
                  x:Int,  y:Int}
                 -> Void;
    make_adjustment : {lower:Float,  page_increment:Float, 
                       page_size:Float,  session:Session, 
                       step_increment:Float,  upper:Float,  value:Float}
                      -> Widget;
    make_viewport : {horizontal_adjustment:Null_Or(Widget ), 
                     session:Session, 
                     vertical_adjustment:Null_Or(Widget )}
                    -> Widget;
    make_scrolled_window : {horizontal_adjustment:Null_Or(Widget ), 
                            session:Session, 
                            vertical_adjustment:Null_Or(Widget )}
                           -> Widget;
    make_horizontal_ruler : Session -> Widget;
    make_vertical_ruler : Session -> Widget;
    make_vertical_scrollbar : (Session , Null_Or(Widget )) -> Widget;
    make_horizontal_scrollbar : (Session , Null_Or(Widget )) -> Widget;
    make_vertical_scale : (Session , Null_Or(Widget )) -> Widget;
    make_horizontal_scale : (Session , Null_Or(Widget )) -> Widget;
    make_vertical_scale_with_range : {max:Float,  min:Float,  session:Session, 
                                      step:Float}
                                     -> Widget;
    make_horizontal_scale_with_range : {max:Float,  min:Float,  session:Session, 
                                        step:Float}
                                       -> Widget;
    make_drawing_area : Session -> Widget;
    make_pixmap : {high:Int,  session:Session,  wide:Int, 
                   window:Widget}
                  -> Widget;
    make_status_bar : Session -> Widget;
    push_text_on_status_bar : (Session , Widget , Int , String) -> Int;
    pop_text_off_status_bar : (Session , Widget , Int) -> Void;
    remove_text_from_status_bar : {context:Int,  message:Int,  session:Session, 
                                   status_bar:Widget}
                                  -> Void;
    pack_box : {box:Widget,  expand:Bool,  fill:Bool,  kid:Widget, 
                pack:Pack_From,  padding:Int,  session:Session}
               -> Void;
    menu_shell_append : {kid:Widget,  menu:Widget,  session:Session} -> Void;
    menu_bar_append : {kid:Widget,  menu:Widget,  session:Session} -> Void;
    append_text_to_combo_box : (Session , Widget , String) -> Void;
    set_option_menu_menu : {menu:Widget,  option_menu:Widget,  session:Session}
                           -> Void;
    set_text_tooltip_on_widget : (Session , Widget , String) -> Void;
    set_ruler_metric : (Session , Widget , Metric) -> Void;
    set_ruler_range : {lower:Float,  max_size:Float,  position:Float, 
                       ruler:Widget,  session:Session,  upper:Float}
                      -> Void;
    set_scrollbar_policy : {horizontal_scrollbar:Scrollbar_Policy, 
                            session:Session,  vertical_scrollbar:Scrollbar_Policy, 
                            window:Widget}
                           -> Void;
    draw_rectangle : {drawable:Widget,  filled:Bool,  gcontext:Widget, 
                      high:Int,  session:Session,  wide:Int,  x:Int, 
                      y:Int}
                     -> Void;
    draw_drawable : {drawable:Widget,  from:Widget,  from_x:Int, 
                     from_y:Int,  gcontext:Widget,  high:Int, 
                     session:Session,  to_x:Int,  to_y:Int,  wide:Int}
                    -> Void;
    queue_redraw : {high:Int,  session:Session,  wide:Int, 
                    widget:Widget,  x:Int,  y:Int}
                   -> Void;
    press_button : (Session , Widget) -> Void;
    release_button : (Session , Widget) -> Void;
    click_button : (Session , Widget) -> Void;
    enter_button : (Session , Widget) -> Void;
    leave_button : (Session , Widget) -> Void;
    show_widget : (Session , Widget) -> Void;
    show_widget_tree : (Session , Widget) -> Void;
    destroy_widget : (Session , Widget) -> Void;
    emit_changed_signal : (Session , Widget) -> Void;
    pop_up_combo_box : (Session , Widget) -> Void;
    pop_down_combo_box : (Session , Widget) -> Void;
    set_combo_box_title : (Session , Widget , String) -> Void;
    set_window_title : (Session , Widget , String) -> Void;
    set_window_default_size : (Session , Widget , ((Int , Int))) -> Void;
    set_minimum_widget_size : (Session , Widget , ((Int , Int))) -> Void;
    set_border_width : (Session , Widget , Int) -> Void;
    set_event_box_visibility : (Session , Widget , Bool) -> Void;
    set_widget_alignment : {session:Session,  widget:Widget,  x:Float, 
                            y:Float}
                           -> Void;
    set_widget_events : (Session , Widget , List(Event_Mask )) -> Void;
    set_widget_name : (Session , Widget , String) -> Void;
    set_label_justification : (Session , Widget , Justification) -> Void;
    set_label_line_wrapping : (Session , Widget , Bool) -> Void;
    set_label_underlines : (Session , Widget , String) -> Void;
    set_scale_value_position : (Session , Widget , Position_Type) -> Void;
    set_draw_scale_value : (Session , Widget , Bool) -> Void;
    get_scale_value_digits_shown : (Session , Widget) -> Int;
    set_scale_value_digits_shown : (Session , Widget , Int) -> Void;
    set_range_update_policy : (Session , Widget , Update_Policy) -> Void;
    get_toggle_button_state : (Session , Widget) -> Bool;
    set_toggle_button_state : (Session , Widget , Bool) -> Void;
    get_adjustment_value : (Session , Widget) -> Float;
    set_adjustment_value : (Session , Widget , Float) -> Void;
    get_white_graphics_context : (Session , Widget) -> Widget;
    get_black_graphics_context : (Session , Widget) -> Widget;
    get_current_foreground_graphics_context : (Session , Widget) -> Widget;
    get_current_background_graphics_context : (Session , Widget) -> Widget;
    get_widget_window : (Session , Widget) -> Widget;
    add_kid : {kid:Widget,  mom:Widget,  session:Session} -> Void;
    add_scrolled_window_kid : {kid:Widget,  session:Session,  window:Widget} -> Void;
    add_table_kid : {bottom:Int,  kid:Widget,  left:Int,  right:Int, 
                     session:Session,  table:Widget,  top:Int}
                    -> Void;
    add_table_kid' : {bottom:Int,  kid:Widget,  left:Int,  right:Int, 
                      session:Session,  table:Widget,  top:Int, 
                      xoptions:List(Table_Attach_Option ),  xpadding:Int, 
                      yoptions:List(Table_Attach_Option ),  ypadding:Int}
                     -> Void;
    get_viewport_vertical_adjustment : (Session , Widget) -> Widget;
    get_viewport_horizontal_adjustment : (Session , Widget) -> Widget;
    set_table_row_spacing : {row:Int,  session:Session,  spacing:Int, 
                             table:Widget}
                            -> Void;
    set_table_col_spacing : {col:Int,  session:Session,  spacing:Int, 
                             table:Widget}
                            -> Void;
    set_table_row_spacings : (Session , Widget , Int) -> Void;
    set_table_col_spacings : (Session , Widget , Int) -> Void;
    set_clicked_callback : Session -> Widget -> Void_Callback -> Void;
    set_pressed_callback : Session -> Widget -> Void_Callback -> Void;
    set_release_callback : Session -> Widget -> Void_Callback -> Void;
    set_enter_callback : Session -> Widget -> Void_Callback -> Void;
    set_leave_callback : Session -> Widget -> Void_Callback -> Void;
    set_activate_callback : Session -> Widget -> Void_Callback -> Void;
    set_destroy_callback : Session -> Widget -> Void_Callback -> Void;
    set_realize_callback : Session -> Widget -> Void_Callback -> Void;
    set_button_press_event_callback : Session -> Widget -> Button_Event_Callback -> Void;
    set_button_release_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_scroll_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_motion_notify_event_callback : Session -> Widget -> Motion_Event_Callback -> Void;
    set_delete_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_expose_event_callback : Session -> Widget -> Expose_Event_Callback -> Void;
    set_key_press_event_callback : Session -> Widget -> Key_Event_Callback -> Void;
    set_key_release_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_enter_notify_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_leave_notify_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_configure_event_callback : Session -> Widget -> Configure_Event_Callback -> Void;
    set_focus_in_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_focus_out_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_map_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_unmap_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_property_notify_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_selection_clear_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_selection_request_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_selection_notify_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_proximity_in_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_proximity_out_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_client_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_no_expose_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_window_state_event_callback : Session -> Widget -> Void_Callback -> Void;
    set_toggled_callback : Session -> Widget -> Bool_Callback -> Void;
    set_value_changed_callback : Session -> Widget -> Float_Callback -> Void;
    clamp : {max:Float,  min:Float,  value:Float} -> Float;
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext