15. Graphic User Interface |
Module GTK |
GTK wrapper module.
This is a convenience module that is identical to either either the GTK2 or the GTK1 module depending on which (if any) of them is available.
GTK1, GTK2
inherit GTK1 : GTK1
inherit GTK2 : GTK2
Module GTK1 |
constant GTK1.ACCEL_LOCKED
constant GTK1.ACCEL_SIGNAL_VISIBLE
constant GTK1.ACCEL_VISIBLE
constant GTK1.ANCHOR_CENTER
constant GTK1.ANCHOR_E
constant GTK1.ANCHOR_EAST
constant GTK1.ANCHOR_N
constant GTK1.ANCHOR_NE
constant GTK1.ANCHOR_NORTH
constant GTK1.ANCHOR_NORTH_EAST
constant GTK1.ANCHOR_NORTH_WEST
constant GTK1.ANCHOR_NW
constant GTK1.ANCHOR_S
constant GTK1.ANCHOR_SE
constant GTK1.ANCHOR_SOUTH
constant GTK1.ANCHOR_SOUTH_EAST
constant GTK1.ANCHOR_SOUTH_WEST
constant GTK1.ANCHOR_SW
constant GTK1.ANCHOR_W
constant GTK1.ANCHOR_WEST
constant GTK1.APP_PAINTABLE
constant GTK1.ARROW_DOWN
constant GTK1.ARROW_LEFT
constant GTK1.ARROW_RIGHT
constant GTK1.ARROW_UP
constant GTK1.BUTTONBOX_DEFAULT_STYLE
constant GTK1.BUTTONBOX_EDGE
constant GTK1.BUTTONBOX_END
constant GTK1.BUTTONBOX_SPREAD
constant GTK1.BUTTONBOX_START
constant GTK1.BUTTON_DRAGS
constant GTK1.BUTTON_EXPANDS
constant GTK1.BUTTON_IGNORED
constant GTK1.BUTTON_SELECTS
constant GTK1.CALENDAR_NO_MONTH_CHANGE
constant GTK1.CALENDAR_SHOW_DAY_NAMES
constant GTK1.CALENDAR_SHOW_HEADING
constant GTK1.CALENDAR_SHOW_WEEK_NUMBERS
constant GTK1.CALENDAR_WEEK_START_MONDAY
constant GTK1.CAN_DEFAULT
constant GTK1.CAN_FOCUS
constant GTK1.CELL_EMPTY
constant GTK1.CELL_PIXMAP
constant GTK1.CELL_PIXTEXT
constant GTK1.CELL_TEXT
constant GTK1.CELL_WIDGET
constant GTK1.CENTIMETERS
constant GTK1.CLIST_ADD_MODE
constant GTK1.CLIST_AUTO_RESIZE_BLOCKED
constant GTK1.CLIST_AUTO_SORT
constant GTK1.CLIST_DRAW_DRAG_LINE
constant GTK1.CLIST_DRAW_DRAG_RECT
constant GTK1.CLIST_IN_DRAG
constant GTK1.CLIST_REORDERABLE
constant GTK1.CLIST_ROW_HEIGHT_SET
constant GTK1.CLIST_SHOW_TITLES
constant GTK1.CLIST_USE_DRAG_ICONS
constant GTK1.CLOCK_DECREASING
constant GTK1.CLOCK_INCREASING
constant GTK1.CLOCK_REALTIME
constant GTK1.COMPOSITE_CHILD
constant GTK1.CORNER_BOTTOM_LEFT
constant GTK1.CORNER_BOTTOM_RIGHT
constant GTK1.CORNER_TOP_LEFT
constant GTK1.CORNER_TOP_RIGHT
constant GTK1.CTREE_EXPANDER_CIRCULAR
constant GTK1.CTREE_EXPANDER_NONE
constant GTK1.CTREE_EXPANDER_SQUARE
constant GTK1.CTREE_EXPANDER_TRIANGLE
constant GTK1.CTREE_EXPANSION_COLLAPSE
constant GTK1.CTREE_EXPANSION_COLLAPSE_RECURSIVE
constant GTK1.CTREE_EXPANSION_EXPAND
constant GTK1.CTREE_EXPANSION_EXPAND_RECURSIVE
constant GTK1.CTREE_EXPANSION_TOGGLE
constant GTK1.CTREE_EXPANSION_TOGGLE_RECURSIVE
constant GTK1.CTREE_LINES_DOTTED
constant GTK1.CTREE_LINES_NONE
constant GTK1.CTREE_LINES_SOLID
constant GTK1.CTREE_LINES_TABBED
constant GTK1.CTREE_POS_AFTER
constant GTK1.CTREE_POS_AS_CHILD
constant GTK1.CTREE_POS_BEFORE
constant GTK1.CURVE_TYPE_FREE
constant GTK1.CURVE_TYPE_LINEAR
constant GTK1.CURVE_TYPE_SPLINE
constant GTK1.DATABOX_BARS
constant GTK1.DATABOX_LINES
constant GTK1.DATABOX_NOT_DISPLAYED
constant GTK1.DATABOX_POINTS
constant GTK1.DEST_DEFAULT_ALL
constant GTK1.DEST_DEFAULT_DROP
constant GTK1.DEST_DEFAULT_HIGHLIGHT
constant GTK1.DEST_DEFAULT_MOTION
constant GTK1.DIRECTION_LEFT
constant GTK1.DIRECTION_RIGHT
constant GTK1.DIR_DOWN
constant GTK1.DIR_LEFT
constant GTK1.DIR_RIGHT
constant GTK1.DIR_TAB_BACKWARD
constant GTK1.DIR_TAB_FORWARD
constant GTK1.DIR_UP
constant GTK1.EXPAND
constant GTK1.FALSE
constant GTK1.FILL
constant GTK1.FILL_X
constant GTK1.FILL_Y
constant GTK1.GDK_ACTION_ASK
constant GTK1.GDK_ACTION_COPY
constant GTK1.GDK_ACTION_DEFAULT
constant GTK1.GDK_ACTION_LINK
constant GTK1.GDK_ACTION_MOVE
constant GTK1.GDK_ACTION_PRIVATE
constant GTK1.GDK_ALL_EVENTS_MASK
constant GTK1.GDK_AND
constant GTK1.GDK_AND_INVERT
constant GTK1.GDK_AND_REVERSE
constant GTK1.GDK_ARROW
constant GTK1.GDK_BASED_ARROW_DOWN
constant GTK1.GDK_BASED_ARROW_UP
constant GTK1.GDK_BOAT
constant GTK1.GDK_BOGOSITY
constant GTK1.GDK_BOTTOM_LEFT_CORNER
constant GTK1.GDK_BOTTOM_RIGHT_CORNER
constant GTK1.GDK_BOTTOM_SIDE
constant GTK1.GDK_BOTTOM_TEE
constant GTK1.GDK_BOX_SPIRAL
constant GTK1.GDK_BUTTON1_MASK
constant GTK1.GDK_BUTTON1_MOTION_MASK
constant GTK1.GDK_BUTTON2_MASK
constant GTK1.GDK_BUTTON2_MOTION_MASK
constant GTK1.GDK_BUTTON3_MASK
constant GTK1.GDK_BUTTON3_MOTION_MASK
constant GTK1.GDK_BUTTON_MOTION_MASK
constant GTK1.GDK_BUTTON_PRESS_MASK
constant GTK1.GDK_BUTTON_RELEASE_MASK
constant GTK1.GDK_CAP_BUTT
constant GTK1.GDK_CAP_NOT_LAST
constant GTK1.GDK_CAP_PROJECTING
constant GTK1.GDK_CAP_ROUND
constant GTK1.GDK_CENTER_PTR
constant GTK1.GDK_CIRCLE
constant GTK1.GDK_CLEAR
constant GTK1.GDK_CLOCK
constant GTK1.GDK_COFFEE_MUG
constant GTK1.GDK_CONTROL_MASK
constant GTK1.GDK_COPY
constant GTK1.GDK_COPY_INVERT
constant GTK1.GDK_CROSS
constant GTK1.GDK_CROSSHAIR
constant GTK1.GDK_CROSS_REVERSE
constant GTK1.GDK_DECOR_ALL
constant GTK1.GDK_DECOR_BORDER
constant GTK1.GDK_DECOR_MAXIMIZE
constant GTK1.GDK_DECOR_MENU
constant GTK1.GDK_DECOR_MINIMIZE
constant GTK1.GDK_DECOR_RESIZEH
constant GTK1.GDK_DECOR_TITLE
constant GTK1.GDK_DIAMOND_CROSS
constant GTK1.GDK_DOT
constant GTK1.GDK_DOTBOX
constant GTK1.GDK_DOUBLE_ARROW
constant GTK1.GDK_DRAFT_LARGE
constant GTK1.GDK_DRAFT_SMALL
constant GTK1.GDK_DRAG_PROTO_MOTIF
constant GTK1.GDK_DRAG_PROTO_ROOTWIN
constant GTK1.GDK_DRAG_PROTO_XDND
constant GTK1.GDK_DRAPED_BOX
constant GTK1.GDK_ENTER_NOTIFY_MASK
constant GTK1.GDK_EQUIV
constant GTK1.GDK_EVEN_ODD_RULE
constant GTK1.GDK_EXCHANGE
constant GTK1.GDK_EXPOSURE_MASK
constant GTK1.GDK_EXTENSION_EVENTS_ALL
constant GTK1.GDK_EXTENSION_EVENTS_CURSOR
constant GTK1.GDK_EXTENSION_EVENTS_NONE
constant GTK1.GDK_FLEUR
constant GTK1.GDK_FOCUS_CHANGE_MASK
constant GTK1.GDK_FUNC_ALL
constant GTK1.GDK_FUNC_CLOSE
constant GTK1.GDK_FUNC_MAXIMIZE
constant GTK1.GDK_FUNC_MINIMIZE
constant GTK1.GDK_FUNC_MOVE
constant GTK1.GDK_FUNC_RESIZE
constant GTK1.GDK_GL_ACCUM_ALPHA_SIZE
constant GTK1.GDK_GL_ACCUM_BLUE_SIZE
constant GTK1.GDK_GL_ACCUM_GREEN_SIZE
constant GTK1.GDK_GL_ACCUM_RED_SIZE
constant GTK1.GDK_GL_ALPHA_SIZE
constant GTK1.GDK_GL_AUX_BUFFERS
constant GTK1.GDK_GL_BLUE_SIZE
constant GTK1.GDK_GL_BUFFER_SIZE
constant GTK1.GDK_GL_DEPTH_SIZE
constant GTK1.GDK_GL_DOUBLEBUFFER
constant GTK1.GDK_GL_GREEN_SIZE
constant GTK1.GDK_GL_LEVEL
constant GTK1.GDK_GL_NONE
constant GTK1.GDK_GL_RED_SIZE
constant GTK1.GDK_GL_RGBA
constant GTK1.GDK_GL_STENCIL_SIZE
constant GTK1.GDK_GL_STEREO
constant GTK1.GDK_GL_TRANSPARENT_ALPHA_VALUE_EXT
constant GTK1.GDK_GL_TRANSPARENT_BLUE_VALUE_EXT
constant GTK1.GDK_GL_TRANSPARENT_GREEN_VALUE_EXT
constant GTK1.GDK_GL_TRANSPARENT_INDEX_VALUE_EXT
constant GTK1.GDK_GL_TRANSPARENT_RED_VALUE_EXT
constant GTK1.GDK_GL_TRANSPARENT_TYPE_EXT
constant GTK1.GDK_GL_USE_GL
constant GTK1.GDK_GL_X_VISUAL_TYPE_EXT
constant GTK1.GDK_GOBBLER
constant GTK1.GDK_GUMBY
constant GTK1.GDK_HAND1
constant GTK1.GDK_HAND2
constant GTK1.GDK_HEART
constant GTK1.GDK_ICON
constant GTK1.GDK_IM_PREEDIT_AREA
constant GTK1.GDK_IM_PREEDIT_CALLBACKS
constant GTK1.GDK_IM_PREEDIT_MASK
constant GTK1.GDK_IM_PREEDIT_NONE
constant GTK1.GDK_IM_PREEDIT_NOTHING
constant GTK1.GDK_IM_PREEDIT_POSITION
constant GTK1.GDK_IM_STATUS_AREA
constant GTK1.GDK_IM_STATUS_CALLBACKS
constant GTK1.GDK_IM_STATUS_MASK
constant GTK1.GDK_IM_STATUS_NONE
constant GTK1.GDK_IM_STATUS_NOTHING
constant GTK1.GDK_INVERT
constant GTK1.GDK_IRON_CROSS
constant GTK1.GDK_JOIN_BEVEL
constant GTK1.GDK_JOIN_MITER
constant GTK1.GDK_JOIN_ROUND
constant GTK1.GDK_KEY_PRESS_MASK
constant GTK1.GDK_KEY_RELEASE_MASK
constant GTK1.GDK_LEAVE_NOTIFY_MASK
constant GTK1.GDK_LEFTBUTTON
constant GTK1.GDK_LEFT_PTR
constant GTK1.GDK_LEFT_SIDE
constant GTK1.GDK_LEFT_TEE
constant GTK1.GDK_LINE_DOUBLE_DASH
constant GTK1.GDK_LINE_ON_OFF_DASH
constant GTK1.GDK_LINE_SOLID
constant GTK1.GDK_LL_ANGLE
constant GTK1.GDK_LOCK_MASK
constant GTK1.GDK_LR_ANGLE
constant GTK1.GDK_MAN
constant GTK1.GDK_MIDDLEBUTTON
constant GTK1.GDK_MOD1_MASK
constant GTK1.GDK_MOD2_MASK
constant GTK1.GDK_MOD3_MASK
constant GTK1.GDK_MOD4_MASK
constant GTK1.GDK_MOD5_MASK
constant GTK1.GDK_MOUSE
constant GTK1.GDK_NAND
constant GTK1.GDK_NOOP
constant GTK1.GDK_OPAQUE_STIPPLED
constant GTK1.GDK_OR
constant GTK1.GDK_OR_INVERT
constant GTK1.GDK_OR_REVERSE
constant GTK1.GDK_OVERLAP_RECTANGLE_IN
constant GTK1.GDK_OVERLAP_RECTANGLE_OUT
constant GTK1.GDK_OVERLAP_RECTANGLE_PART
constant GTK1.GDK_PENCIL
constant GTK1.GDK_PIRATE
constant GTK1.GDK_PLUS
constant GTK1.GDK_POINTER_MOTION_HINT_MASK
constant GTK1.GDK_POINTER_MOTION_MASK
constant GTK1.GDK_PROPERTY_CHANGE_MASK
constant GTK1.GDK_PROP_MODE_APPEND
constant GTK1.GDK_PROP_MODE_PREPEND
constant GTK1.GDK_PROP_MODE_REPLACE
constant GTK1.GDK_PROXIMITY_IN_MASK
constant GTK1.GDK_PROXIMITY_OUT_MASK
constant GTK1.GDK_QUESTION_ARROW
constant GTK1.GDK_RIGHTBUTTON
constant GTK1.GDK_RIGHT_PTR
constant GTK1.GDK_RIGHT_SIDE
constant GTK1.GDK_RIGHT_TEE
constant GTK1.GDK_RTL_LOGO
constant GTK1.GDK_SAILBOAT
constant GTK1.GDK_SB_DOWN_ARROW
constant GTK1.GDK_SB_H_DOUBLE_ARROW
constant GTK1.GDK_SB_LEFT_ARROW
constant GTK1.GDK_SB_RIGHT_ARROW
constant GTK1.GDK_SB_UP_ARROW
constant GTK1.GDK_SB_V_DOUBLE_ARROW
constant GTK1.GDK_SELECTION_TYPE_ATOM
constant GTK1.GDK_SELECTION_TYPE_BITMAP
constant GTK1.GDK_SELECTION_TYPE_COLORMAP
constant GTK1.GDK_SELECTION_TYPE_DRAWABLE
constant GTK1.GDK_SELECTION_TYPE_INTEGER
constant GTK1.GDK_SELECTION_TYPE_PIXMAP
constant GTK1.GDK_SELECTION_TYPE_STRING
constant GTK1.GDK_SELECTION_TYPE_WINDOW
constant GTK1.GDK_SET
constant GTK1.GDK_SHIFT_MASK
constant GTK1.GDK_SHUTTLE
constant GTK1.GDK_SIZING
constant GTK1.GDK_SOLID
constant GTK1.GDK_SPIDER
constant GTK1.GDK_SPRAYCAN
constant GTK1.GDK_STAR
constant GTK1.GDK_STIPPLED
constant GTK1.GDK_STRUCTURE_MASK
constant GTK1.GDK_TARGET
constant GTK1.GDK_TARGET_BITMAP
constant GTK1.GDK_TARGET_COLORMAP
constant GTK1.GDK_TARGET_DRAWABLE
constant GTK1.GDK_TARGET_PIXMAP
constant GTK1.GDK_TARGET_STRING
constant GTK1.GDK_TCROSS
constant GTK1.GDK_TILED
constant GTK1.GDK_TOP_LEFT_ARROW
constant GTK1.GDK_TOP_LEFT_CORNER
constant GTK1.GDK_TOP_RIGHT_CORNER
constant GTK1.GDK_TOP_SIDE
constant GTK1.GDK_TOP_TEE
constant GTK1.GDK_TREK
constant GTK1.GDK_UL_ANGLE
constant GTK1.GDK_UMBRELLA
constant GTK1.GDK_UR_ANGLE
constant GTK1.GDK_VISIBILITY_NOTIFY_MASK
constant GTK1.GDK_WATCH
constant GTK1.GDK_WINDING_RULE
constant GTK1.GDK_WINDOW_CHILD
constant GTK1.GDK_WINDOW_DIALOG
constant GTK1.GDK_WINDOW_FOREIGN
constant GTK1.GDK_WINDOW_ROOT
constant GTK1.GDK_WINDOW_TEMP
constant GTK1.GDK_WINDOW_TOPLEVEL
constant GTK1.GDK_XOR
constant GTK1.GDK_XTERM
constant GTK1.GNOME_DOCK_BOTTOM
constant GTK1.GNOME_DOCK_ITEM_BEH_EXCLUSIVE
constant GTK1.GNOME_DOCK_ITEM_BEH_LOCKED
constant GTK1.GNOME_DOCK_ITEM_BEH_NEVER_FLOATING
constant GTK1.GNOME_DOCK_ITEM_BEH_NEVER_HORIZONTAL
constant GTK1.GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL
constant GTK1.GNOME_DOCK_ITEM_BEH_NORMAL
constant GTK1.GNOME_DOCK_LEFT
constant GTK1.GNOME_DOCK_RIGHT
constant GTK1.GNOME_DOCK_TOP
constant GTK1.GNOME_FONT_PICKER_MODE_FONT_INFO
constant GTK1.GNOME_FONT_PICKER_MODE_PIXMAP
constant GTK1.GNOME_FONT_PICKER_MODE_UNKNOWN
constant GTK1.GNOME_FONT_PICKER_MODE_USER_WIDGET
constant GTK1.GNOME_ICON_LIST_ICONS
constant GTK1.GNOME_ICON_LIST_IS_EDITABLE
constant GTK1.GNOME_ICON_LIST_STATIC_TEXT
constant GTK1.GNOME_ICON_LIST_TEXT_BELOW
constant GTK1.GNOME_ICON_LIST_TEXT_RIGHT
constant GTK1.GNOME_MESSAGE_BOX_ERROR
constant GTK1.GNOME_MESSAGE_BOX_GENERIC
constant GTK1.GNOME_MESSAGE_BOX_INFO
constant GTK1.GNOME_MESSAGE_BOX_QUESTION
constant GTK1.GNOME_MESSAGE_BOX_WARNING
constant GTK1.GNOME_PREFERENCES_ALWAYS
constant GTK1.GNOME_PREFERENCES_NEVER
constant GTK1.GNOME_PREFERENCES_USER
constant GTK1.GNOME_Panel_ORIENT_DOWN
constant GTK1.GNOME_Panel_ORIENT_LEFT
constant GTK1.GNOME_Panel_ORIENT_RIGHT
constant GTK1.GNOME_Panel_ORIENT_UP
constant GTK1.GNOME_STOCK_BUTTON_APPLY
constant GTK1.GNOME_STOCK_BUTTON_CANCEL
constant GTK1.GNOME_STOCK_BUTTON_CLOSE
constant GTK1.GNOME_STOCK_BUTTON_DOWN
constant GTK1.GNOME_STOCK_BUTTON_FONT
constant GTK1.GNOME_STOCK_BUTTON_HELP
constant GTK1.GNOME_STOCK_BUTTON_NEXT
constant GTK1.GNOME_STOCK_BUTTON_NO
constant GTK1.GNOME_STOCK_BUTTON_OK
constant GTK1.GNOME_STOCK_BUTTON_PREV
constant GTK1.GNOME_STOCK_BUTTON_UP
constant GTK1.GNOME_STOCK_BUTTON_YES
constant GTK1.GNOME_STOCK_MENU_ABOUT
constant GTK1.GNOME_STOCK_MENU_ALIGN_CENTER
constant GTK1.GNOME_STOCK_MENU_ALIGN_JUSTIFY
constant GTK1.GNOME_STOCK_MENU_ALIGN_LEFT
constant GTK1.GNOME_STOCK_MENU_ALIGN_RIGHT
constant GTK1.GNOME_STOCK_MENU_ATTACH
constant GTK1.GNOME_STOCK_MENU_BACK
constant GTK1.GNOME_STOCK_MENU_BLANK
constant GTK1.GNOME_STOCK_MENU_BOOK_BLUE
constant GTK1.GNOME_STOCK_MENU_BOOK_GREEN
constant GTK1.GNOME_STOCK_MENU_BOOK_OPEN
constant GTK1.GNOME_STOCK_MENU_BOOK_RED
constant GTK1.GNOME_STOCK_MENU_BOOK_YELLOW
constant GTK1.GNOME_STOCK_MENU_BOTTOM
constant GTK1.GNOME_STOCK_MENU_CDROM
constant GTK1.GNOME_STOCK_MENU_CLOSE
constant GTK1.GNOME_STOCK_MENU_CONVERT
constant GTK1.GNOME_STOCK_MENU_COPY
constant GTK1.GNOME_STOCK_MENU_CUT
constant GTK1.GNOME_STOCK_MENU_DOWN
constant GTK1.GNOME_STOCK_MENU_EXEC
constant GTK1.GNOME_STOCK_MENU_EXIT
constant GTK1.GNOME_STOCK_MENU_FIRST
constant GTK1.GNOME_STOCK_MENU_FONT
constant GTK1.GNOME_STOCK_MENU_FORWARD
constant GTK1.GNOME_STOCK_MENU_HOME
constant GTK1.GNOME_STOCK_MENU_INDEX
constant GTK1.GNOME_STOCK_MENU_JUMP_TO
constant GTK1.GNOME_STOCK_MENU_LAST
constant GTK1.GNOME_STOCK_MENU_LINE_IN
constant GTK1.GNOME_STOCK_MENU_MAIL
constant GTK1.GNOME_STOCK_MENU_MAIL_FWD
constant GTK1.GNOME_STOCK_MENU_MAIL_NEW
constant GTK1.GNOME_STOCK_MENU_MAIL_RCV
constant GTK1.GNOME_STOCK_MENU_MAIL_RPL
constant GTK1.GNOME_STOCK_MENU_MAIL_SND
constant GTK1.GNOME_STOCK_MENU_MIC
constant GTK1.GNOME_STOCK_MENU_MIDI
constant GTK1.GNOME_STOCK_MENU_NEW
constant GTK1.GNOME_STOCK_MENU_OPEN
constant GTK1.GNOME_STOCK_MENU_PASTE
constant GTK1.GNOME_STOCK_MENU_PREF
constant GTK1.GNOME_STOCK_MENU_PRINT
constant GTK1.GNOME_STOCK_MENU_PROP
constant GTK1.GNOME_STOCK_MENU_QUIT
constant GTK1.GNOME_STOCK_MENU_REDO
constant GTK1.GNOME_STOCK_MENU_REFRESH
constant GTK1.GNOME_STOCK_MENU_REVERT
constant GTK1.GNOME_STOCK_MENU_SAVE
constant GTK1.GNOME_STOCK_MENU_SAVE_AS
constant GTK1.GNOME_STOCK_MENU_SCORES
constant GTK1.GNOME_STOCK_MENU_SEARCH
constant GTK1.GNOME_STOCK_MENU_SPELLCHECK
constant GTK1.GNOME_STOCK_MENU_SRCHRPL
constant GTK1.GNOME_STOCK_MENU_STOP
constant GTK1.GNOME_STOCK_MENU_TEXT_BOLD
constant GTK1.GNOME_STOCK_MENU_TEXT_ITALIC
constant GTK1.GNOME_STOCK_MENU_TEXT_STRIKEOUT
constant GTK1.GNOME_STOCK_MENU_TEXT_UNDERLINE
constant GTK1.GNOME_STOCK_MENU_TIMER
constant GTK1.GNOME_STOCK_MENU_TIMER_STOP
constant GTK1.GNOME_STOCK_MENU_TOP
constant GTK1.GNOME_STOCK_MENU_TRASH
constant GTK1.GNOME_STOCK_MENU_TRASH_FULL
constant GTK1.GNOME_STOCK_MENU_UNDELETE
constant GTK1.GNOME_STOCK_MENU_UNDO
constant GTK1.GNOME_STOCK_MENU_UP
constant GTK1.GNOME_STOCK_MENU_VOLUME
constant GTK1.GNOME_STOCK_PIXMAP_ABOUT
constant GTK1.GNOME_STOCK_PIXMAP_ADD
constant GTK1.GNOME_STOCK_PIXMAP_ALIGN_CENTER
constant GTK1.GNOME_STOCK_PIXMAP_ALIGN_JUSTIFY
constant GTK1.GNOME_STOCK_PIXMAP_ALIGN_LEFT
constant GTK1.GNOME_STOCK_PIXMAP_ALIGN_RIGHT
constant GTK1.GNOME_STOCK_PIXMAP_ATTACH
constant GTK1.GNOME_STOCK_PIXMAP_BACK
constant GTK1.GNOME_STOCK_PIXMAP_BOOK_BLUE
constant GTK1.GNOME_STOCK_PIXMAP_BOOK_GREEN
constant GTK1.GNOME_STOCK_PIXMAP_BOOK_OPEN
constant GTK1.GNOME_STOCK_PIXMAP_BOOK_RED
constant GTK1.GNOME_STOCK_PIXMAP_BOOK_YELLOW
constant GTK1.GNOME_STOCK_PIXMAP_BOTTOM
constant GTK1.GNOME_STOCK_PIXMAP_CDROM
constant GTK1.GNOME_STOCK_PIXMAP_CLEAR
constant GTK1.GNOME_STOCK_PIXMAP_CLOSE
constant GTK1.GNOME_STOCK_PIXMAP_COLORSELECTOR
constant GTK1.GNOME_STOCK_PIXMAP_CONVERT
constant GTK1.GNOME_STOCK_PIXMAP_COPY
constant GTK1.GNOME_STOCK_PIXMAP_CUT
constant GTK1.GNOME_STOCK_PIXMAP_DISABLED
constant GTK1.GNOME_STOCK_PIXMAP_DOWN
constant GTK1.GNOME_STOCK_PIXMAP_EXEC
constant GTK1.GNOME_STOCK_PIXMAP_EXIT
constant GTK1.GNOME_STOCK_PIXMAP_FIRST
constant GTK1.GNOME_STOCK_PIXMAP_FOCUSED
constant GTK1.GNOME_STOCK_PIXMAP_FONT
constant GTK1.GNOME_STOCK_PIXMAP_FORWARD
constant GTK1.GNOME_STOCK_PIXMAP_HELP
constant GTK1.GNOME_STOCK_PIXMAP_HOME
constant GTK1.GNOME_STOCK_PIXMAP_INDEX
constant GTK1.GNOME_STOCK_PIXMAP_JUMP_TO
constant GTK1.GNOME_STOCK_PIXMAP_LAST
constant GTK1.GNOME_STOCK_PIXMAP_LINE_IN
constant GTK1.GNOME_STOCK_PIXMAP_MAIL
constant GTK1.GNOME_STOCK_PIXMAP_MAIL_FWD
constant GTK1.GNOME_STOCK_PIXMAP_MAIL_NEW
constant GTK1.GNOME_STOCK_PIXMAP_MAIL_RCV
constant GTK1.GNOME_STOCK_PIXMAP_MAIL_RPL
constant GTK1.GNOME_STOCK_PIXMAP_MAIL_SND
constant GTK1.GNOME_STOCK_PIXMAP_MIC
constant GTK1.GNOME_STOCK_PIXMAP_MIDI
constant GTK1.GNOME_STOCK_PIXMAP_MULTIPLE
constant GTK1.GNOME_STOCK_PIXMAP_NEW
constant GTK1.GNOME_STOCK_PIXMAP_NOT
constant GTK1.GNOME_STOCK_PIXMAP_OPEN
constant GTK1.GNOME_STOCK_PIXMAP_PASTE
constant GTK1.GNOME_STOCK_PIXMAP_PREFERENCES
constant GTK1.GNOME_STOCK_PIXMAP_PRINT
constant GTK1.GNOME_STOCK_PIXMAP_PROPERTIES
constant GTK1.GNOME_STOCK_PIXMAP_QUIT
constant GTK1.GNOME_STOCK_PIXMAP_REDO
constant GTK1.GNOME_STOCK_PIXMAP_REFRESH
constant GTK1.GNOME_STOCK_PIXMAP_REGULAR
constant GTK1.GNOME_STOCK_PIXMAP_REMOVE
constant GTK1.GNOME_STOCK_PIXMAP_REVERT
constant GTK1.GNOME_STOCK_PIXMAP_SAVE
constant GTK1.GNOME_STOCK_PIXMAP_SAVE_AS
constant GTK1.GNOME_STOCK_PIXMAP_SCORES
constant GTK1.GNOME_STOCK_PIXMAP_SEARCH
constant GTK1.GNOME_STOCK_PIXMAP_SPELLCHECK
constant GTK1.GNOME_STOCK_PIXMAP_SRCHRPL
constant GTK1.GNOME_STOCK_PIXMAP_STOP
constant GTK1.GNOME_STOCK_PIXMAP_TABLE_BORDERS
constant GTK1.GNOME_STOCK_PIXMAP_TABLE_FILL
constant GTK1.GNOME_STOCK_PIXMAP_TEXT_BOLD
constant GTK1.GNOME_STOCK_PIXMAP_TEXT_BULLETED_LIST
constant GTK1.GNOME_STOCK_PIXMAP_TEXT_INDENT
constant GTK1.GNOME_STOCK_PIXMAP_TEXT_ITALIC
constant GTK1.GNOME_STOCK_PIXMAP_TEXT_NUMBERED_LIST
constant GTK1.GNOME_STOCK_PIXMAP_TEXT_STRIKEOUT
constant GTK1.GNOME_STOCK_PIXMAP_TEXT_UNDERLINE
constant GTK1.GNOME_STOCK_PIXMAP_TEXT_UNINDENT
constant GTK1.GNOME_STOCK_PIXMAP_TIMER
constant GTK1.GNOME_STOCK_PIXMAP_TIMER_STOP
constant GTK1.GNOME_STOCK_PIXMAP_TOP
constant GTK1.GNOME_STOCK_PIXMAP_TRASH
constant GTK1.GNOME_STOCK_PIXMAP_TRASH_FULL
constant GTK1.GNOME_STOCK_PIXMAP_TYPE_DATA
constant GTK1.GNOME_STOCK_PIXMAP_TYPE_FILE
constant GTK1.GNOME_STOCK_PIXMAP_TYPE_GPIXMAP
constant GTK1.GNOME_STOCK_PIXMAP_TYPE_IMLIB
constant GTK1.GNOME_STOCK_PIXMAP_TYPE_IMLIB_SCALED
constant GTK1.GNOME_STOCK_PIXMAP_TYPE_NONE
constant GTK1.GNOME_STOCK_PIXMAP_TYPE_PATH
constant GTK1.GNOME_STOCK_PIXMAP_TYPE_WIDGET
constant GTK1.GNOME_STOCK_PIXMAP_UNDELETE
constant GTK1.GNOME_STOCK_PIXMAP_UNDO
constant GTK1.GNOME_STOCK_PIXMAP_UP
constant GTK1.GNOME_STOCK_PIXMAP_VOLUME
constant GTK1.HAS_DEFAULT
constant GTK1.HAS_FOCUS
constant GTK1.HAS_GRAB
constant GTK1.INCHES
constant GTK1.JUSTIFY_CENTER
constant GTK1.JUSTIFY_FILL
constant GTK1.JUSTIFY_LEFT
constant GTK1.JUSTIFY_RIGHT
constant GTK1.LEFT_RIGHT
constant GTK1.MAPPED
constant GTK1.NO_REPARENT
constant GTK1.NO_WINDOW
constant GTK1.ORIENTATION_HORIZONTAL
constant GTK1.ORIENTATION_VERTICAL
constant GTK1.PACK_END
constant GTK1.PACK_EXPAND
constant GTK1.PACK_START
constant GTK1.PARENT_SENSITIVE
constant GTK1.PIXELS
constant GTK1.POLICY_ALWAYS
constant GTK1.POLICY_AUTOMATIC
constant GTK1.POLICY_NEVER
constant GTK1.POS_BOTTOM
constant GTK1.POS_LEFT
constant GTK1.POS_RIGHT
constant GTK1.POS_TOP
constant GTK1.PREVIEW_COLOR
constant GTK1.PREVIEW_GRAYSCALE
constant GTK1.PROGRESS_BOTTOM_TO_TOP
constant GTK1.PROGRESS_CONTINUOUS
constant GTK1.PROGRESS_DISCRETE
constant GTK1.PROGRESS_LEFT_TO_RIGHT
constant GTK1.PROGRESS_RIGHT_TO_LEFT
constant GTK1.PROGRESS_TOP_TO_BOTTOM
constant GTK1.RC_STYLE
constant GTK1.REALIZED
constant GTK1.RELIEF_HALF
constant GTK1.RELIEF_NONE
constant GTK1.RELIEF_NORMAL
constant GTK1.RESIZE_IMMEDIATE
constant GTK1.RESIZE_PARENT
constant GTK1.RESIZE_QUEUE
constant GTK1.RUN_BOTH
constant GTK1.RUN_FIRST
constant GTK1.RUN_LAST
constant GTK1.RUN_NO_RECURSE
constant GTK1.SCROLL_JUMP
constant GTK1.SCROLL_NONE
constant GTK1.SCROLL_PAGE_BACKWARD
constant GTK1.SCROLL_PAGE_FORWARD
constant GTK1.SCROLL_STEP_BACKWARD
constant GTK1.SCROLL_STEP_FORWARD
constant GTK1.SELECTION_BROWSE
constant GTK1.SELECTION_EXTENDED
constant GTK1.SELECTION_MULTIPLE
constant GTK1.SELECTION_SINGLE
constant GTK1.SENSITIVE
constant GTK1.SHADOW_ETCHED_IN
constant GTK1.SHADOW_ETCHED_OUT
constant GTK1.SHADOW_IN
constant GTK1.SHADOW_NONE
constant GTK1.SHADOW_OUT
constant GTK1.SHRINK
constant GTK1.SIDE_BOTTOM
constant GTK1.SIDE_LEFT
constant GTK1.SIDE_RIGHT
constant GTK1.SIDE_TOP
constant GTK1.SORT_ASCENDING
constant GTK1.SORT_DESCENDING
constant GTK1.SPIN_END
constant GTK1.SPIN_HOME
constant GTK1.SPIN_PAGE_BACKWARD
constant GTK1.SPIN_PAGE_FORWARD
constant GTK1.SPIN_STEP_BACKWARD
constant GTK1.SPIN_STEP_FORWARD
constant GTK1.SPIN_USER_DEFINED
constant GTK1.STATE_ACTIVE
constant GTK1.STATE_INSENSITIVE
constant GTK1.STATE_NORMAL
constant GTK1.STATE_PRELIGHT
constant GTK1.STATE_SELECTED
constant GTK1.TOOLBAR_BOTH
constant GTK1.TOOLBAR_ICONS
constant GTK1.TOOLBAR_TEXT
constant GTK1.TOPLEVEL
constant GTK1.TOP_BOTTOM
constant GTK1.TREE_VIEW_ITEM
constant GTK1.TREE_VIEW_LINE
constant GTK1.TROUGH_END
constant GTK1.TROUGH_JUMP
constant GTK1.TROUGH_NONE
constant GTK1.TROUGH_START
constant GTK1.TRUE
constant GTK1.UPDATE_ALWAYS
constant GTK1.UPDATE_CONTINUOUS
constant GTK1.UPDATE_DELAYED
constant GTK1.UPDATE_DISCONTINUOUS
constant GTK1.UPDATE_IF_VALID
constant GTK1.VISIBILITY_FULL
constant GTK1.VISIBILITY_NONE
constant GTK1.VISIBILITY_PARTIAL
constant GTK1.VISIBLE
constant GTK1.WINDOW_DIALOG
constant GTK1.WINDOW_POPUP
constant GTK1.WINDOW_TOPLEVEL
constant GTK1.WIN_POS_CENTER
constant GTK1.WIN_POS_MOUSE
constant GTK1.WIN_POS_NONE
void applet_widget_gtk_main()
Special corba main loop for gnome panel applets
void applet_widget_gtk_main_quit()
Exit from the applet_widget_gtk_main function on the next iteration.
int false()
Always returns false.
void flush()
Flush GDK1. Not normally needed, can be useful while doing calculations.
array gnome_init(string app_id, string app_version, array argv, int|void corba_init_flags)
Initializes the application. This sets up all of the GNOME internals and prepares them (imlib, gdk/gtk, session-management, triggers, sound, user preferences). If corba init flags are specified, corba initialization is done as well as gnome initialization. corba_init_flags is 0 or more of GNORBA_INIT_SERVER_FUNC (1), GNORBA_INIT_DISABLE_COOKIES (2) and GNORBA_INIT_CORBA_PRIO_HIGH (4)
void grab_add(GTK1.Widget widget)
void grab_remove(GTK1.Widget widget)
array gtk_init(array|void argc, int|void no_pgtkrc)
Low level GTK init function (used by setup_gtk). This function is more or less equivalent to the C-GTK+ function gtk_init. setup_gtk does some extra things (such as parsing ~/.pgtkrc).
inherit GTKSupport : GTKSupport
void low_flush()
Flush, but do not process events. Not normally needed.
void main()
Start GTK in blocking mode. Doing this disables asynchronous I/O in pike. You can return -1 from main in pike to run GTK (and the rest of pike) in asynchrounous mode.
int main_iteration_do(int block)
Run one iteration in the mainloop. If block is true, wait for an event before returning.
int main_level()
Return the current recursion depth.
void main_quit()
Exit from the gtk_main function on the next iteration.
void parse_rc(string rc)
Takes a string and reads it as a gtkrc file.
GDK1.Window root_window()
Returns the root window of the current display
int set_new_signal_convention(int n)
array setup_gtk(array|void argv, int|void do_not_parse_rc)
Initialize GTK, and all that comes with it. Also parses $HOME/.pgtkrc and $HOME/.gtkrc if they exists. The single argument, if supplied, is the argument array passed to the program. This is used to set default window titles etc. The second argument, if supplied, indicates that pike specific *rc files should not be parsed.
The most common usage is GTK1.setup_gtk(argv);
int true()
Always returns true.
CLASS GTK1.AccelGroup |
An AccelGroup stores keybindings. A group is automatically created by W(MenuFactory)
NOIMG
GTK1.AccelGroup add_accel(GTK1.Widget widget, string signal, int key, int modifiers, int flags)
the widget is the one in which the signal specified by 'signal' recides.
The key is the character code (such as 'a' for the a key and '@' for the @ key), and modifiers is a bitmap of one or more bits, the bits are . Flags is one or more of ACCEL_LOCKED, ACCEL_SIGNAL_VISIBLE and ACCEL_VISIBLE
GTK1.AccelGroup GTK1.AccelGroup()
Create a new accelerator group
GTK1.AccelGroup destroy()
inherit GTK1.Data : Data
GTK1.AccelGroup remove(GTK1.Widget widget, int key, int modifiers)
Remove all bindings for the specified key/mask in the specified object.
CLASS GTK1.AccelLabel |
A label for accelerators.
GTK1.AccelLabel GTK1.AccelLabel(string text)
int get_accel_width()
inherit GTK1.Label : Label
int refetch()
GTK1.AccelLabel set_accel_widget(GTK1.Widget accel_widget)
CLASS GTK1.Adjustment |
The GTK1.Adjustment object represents a value which has an associated lower and upper bound, together with step and page increments, and a page size. It is used within several GTK+ widgets, including GtkSpinButton, GtkViewport, and GtkRange (which is a base class for GtkHScrollbar, GtkVScrollbar, GtkHScale, and GtkVScale).
The GtkAdjustment object does not update the value itself. Instead it is left up to the owner of the GtkAdjustment to control the value.
The owner of the GtkAdjustment typically calls the value_changed() and changed() functions after changing the value or its bounds. This results in the emission of the "value_changed" or "changed" signal respectively.
Signals: changed The adjustment changed in some way
value_changed The value changed
GTK1.Adjustment changed()
Call this when you have modified anything except the value member of the adjustment.
GTK1.Adjustment clamp_page(float lower, float upper)
Updates the GTK1.Adjustment value to ensure that the range between lower and upper is in the current page (i.e. between value and value + page_size). If the range is larger than the page size, then only the start of it will be in the current page. A "value_changed" signal will be emitted if the value is changed.
GTK1.Adjustment GTK1.Adjustment(float|void value, float|void lower, float|void upper, float|void step_increment, float|void page_increment, float|void page_size)
The value argument is the initial value you want to give to the adjustment, usually corresponding to the topmost or leftmost position of an adjustable widget. The lower argument specifies the lowest value which the adjustment can hold. The step_increment argument specifies the "smaller" of the two increments by which the user can change the value, while the page_increment is the "larger" one. The page_size argument usually corresponds somehow to the visible area of a panning widget. The upper argument is used to represent the bottom most or right most coordinate in a panning widget's child. Therefore it is not always the largest number that value can take, since the page_size of such widgets is usually non-zero.
All values are optional, they default to 0.0. For most widgets the unit is pixels.
float get_lower()
Get the lower limit
float get_page_increment()
Get the page increment (page down or through click)
float get_page_size()
Get the page size (the actual size of a page)
float get_step_increment()
Get the step increment (arrow click)
float get_upper()
get the upper limit.
float get_value()
Get the value component.
inherit GTK1.Data : Data
float set_set_lower()
Set the lower limit.
float set_set_page_increment()
Set the page increment (page down or through click)
float set_set_page_size()
Set the page size (the actual size of a page)
float set_set_step_increment()
Set the step increment (arrow click)
float set_set_upper()
Set the upper limit.
GTK1.Adjustment set_value(float to)
Set the value component.
CLASS GTK1.Alignment |
The W(Alignment) widget controls the alignment and size of its child widget. It has four settings: xscale, yscale, xalign, and yalign.
The scale settings are used to specify how much the child widget should expand to fill the space allocated to the W(Alignment). The values can range from 0 (meaning the child doesn't expand at all) to 1 (meaning the child expands to fill all of the available space).
The align settings are used to place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect.
NOIMG
GTK1.Alignment GTK1.Alignment(float xalign, float yalign, float xscale, float yscale)
|
float get_xalign()
the horizontal alignment of the child widget, from 0 (left) to 1 (right).
float get_xscale()
the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the GTK1.Alignment.
float get_yalign()
the vertical alignment of the child widget, from 0 (top) to 1 (bottom).
float get_yscale()
the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.
inherit GTK1.Bin : Bin
GTK1.Alignment set(float xalign, float yalign, float xscale, float yscale)
|
CLASS GTK1.Arrow |
An arrow pointing in one of four directions. The 'etched' shadow
types does not work.
GTK1.Arrow(GTK1.ARROW_UP, GTK1.SHADOW_OUT)
GTK1.Arrow(GTK1.ARROW_LEFT, GTK1.SHADOW_IN)
GTK1.Arrow(GTK1.ARROW_RIGHT, GTK1.SHADOW_IN)
GTK1.Arrow(GTK1.ARROW_DOWN, GTK1.SHADOW_OUT)
GTK1.Arrow GTK1.Arrow(int arrow_type, int shadow_type)
First argument is one of ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT and ARROW_UP, second one of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT.
int get_arrow_type()
Return the arrow type. One of ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT and ARROW_UP.
int get_shadow_type()
Return the shadow type. One of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT.
inherit GTK1.Misc : Misc
GTK1.Arrow set(int arrow_type, int shadow_type)
First argument is one of ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT and ARROW_UP, second one of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT.
CLASS GTK1.AspectFrame |
A W(Frame) widget that always maintain a specified ratio between width and height. width/height == ratio
GTK1.AspectFrame("Title",0.5,0.5,0.4,0)->add( GTK1.Label("Wrong aspect"))->set_usize(200,200)
GTK1.AspectFrame GTK1.AspectFrame(string label, float xalign, float yalign, float ratio, int obey_child)
Create a new frame. Arguments are label, xalign, yalign, ratio, obey_child xalign is floats between 0 and 1, 0.0 is upper (or leftmost), 1.0 is lower (or rightmost). If 'obey_child' is true, the frame will use the aspect ratio of it's (one and only) child widget instead of 'ratio'.
inherit GTK1.Frame : Frame
GTK1.AspectFrame set(float xalign, float yalign, float ratio, int obey_child)
Set the aspec values. Arguments are xalign, yalign, ratio, obey_child xalign is floats between 0 and 1, 0.0 is upper (or leftmost), 1.0 is lower (or rightmost). If 'obey_child' is true, the frame will use the aspect ratio of it's (one and only) child widget instead of 'ratio'.
CLASS GTK1.Bin |
A container that can only contain one child.
GTK1.Widget get_child()
Returns the (one and only) child of this container.
inherit GTK1.Container : Container
CLASS GTK1.Box |
A box is a container that can contain more than one child. The basic 'Box' class cannot be instantiated, it is a virtual class that only defines some common 'Box' functions shared with all other Box widgets.
inherit GTK1.Container : Container
GTK1.Box pack_end(GTK1.Widget widget, int expandp, int fillp, int padding)
Pack from the right (or bottom) of the box. Arguments are widget, expand, fill, paddingb widget, expand, fill, padding
GTK1.Box pack_end_defaults(GTK1.Widget widget)
The argument is the widget to add.
GTK1.Box pack_start(GTK1.Widget widget, int expandp, int fillp, int padding)
Pack from the left (or top) of the box. Argument are widget, expand, fill, padding pack(widget,1,1,0) is equivalent to 'add' or 'pack_start_defaults'
GTK1.Box pack_start_defaults(GTK1.Widget widget)
The argument is the widget to add. This function is equivalent to 'add'
mapping query_child_packing(GTK1.Widget child)
Return a mapping: ([ "expand":expandp, "fill":fillp, "padding":paddingp, "type":type ])
GTK1.Box reorder_child(GTK1.Widget child, int new_position)
Move widget to pos, pos is an integer, between 0 and sizeof(box->children())-1
GTK1.Box set_child_packing(GTK1.Widget child_widget, int expandp, int fillp, int padding, int pack_type)
widget, expand, fill, padding, pack_type. If exand is true, the widget will be expanded when the box is resized. If 'fill' is true, the widget will be resized to fill up all available space. Padding is the amount of padding to use, and pack_type is one of PACK_END, PACK_EXPAND and PACK_START.
You can emulate pack_start and pack_end with add and set_child_packing.
GTK1.Box set_homogeneous(int homogeneousp)
If true, all widgets in the box will get exactly the same amount of space
GTK1.Box set_spacing(int spacing)
This is the amount of spacing (in pixels) inserted beween all widgets
CLASS GTK1.Button |
A container that can only contain one child, and accepts events.
draws a bevelbox around itself.
GTK1.Button("A button")
GTK1.Button("A button\nwith multiple lines\nof text")
GTK1.Button()->add(GTK1.Image(GDK1.Image(0)->set(Image.Image(100,40)->test())))
Signals: clicked Called when the button is pressed, and then released
enter Called when the mouse enters the button
leave Called when the mouse leaves the button
pressed Called when the button is pressed
released Called when the button is released
GTK1.Button clicked()
Emulate a 'clicked' event (press followed by release).
GTK1.Button GTK1.Button(string|void label_text)
If a string is supplied, a W(Label) is created and added to the button.
GTK1.Button enter()
Emulate a 'enter' event.
GTK1.Widget get_child()
The (one and only) child of this container.
int get_relief()
One of RELIEF_HALF, RELIEF_NONE and RELIEF_NORMAL, set with set_relief()
inherit GTK1.Container : Container
GTK1.Button leave()
Emulate a 'leave' event.
GTK1.Button pressed()
Emulate a 'press' event.
GTK1.Button released()
Emulate a 'release' event.
GTK1.Button set_relief(int newstyle)
One of RELIEF_HALF, RELIEF_NONE and RELIEF_NORMAL
CLASS GTK1.ButtonBox |
More or less equivalent to a normal box, but you can set a few layout schemes that are not available for normal boxes. See the hbox and vbox documentation for examples.
mapping get_child_ipadding()
Return the default inter-child padding ([ "x":xpadding, "y":ypadding ])
mapping get_child_size()
Return the child size as ([ "x":xsize, "y":ysize ])
int get_layout()
Returns the currently configured layout. One of BUTTONBOX_DEFAULT_STYLE, BUTTONBOX_EDGE, BUTTONBOX_END, BUTTONBOX_SPREAD and BUTTONBOX_START
int get_spacing()
Return the spacing that is added between the buttons
inherit GTK1.Box : Box
GTK1.ButtonBox set_child_ipadding(int child_number, int child_padding)
Set the padding for a specific child.
GTK1.ButtonBox set_child_size(int child_number, int child_size)
Set the size of a specified child
GTK1.ButtonBox set_layout(int layout)
layout is one of BUTTONBOX_DEFAULT_STYLE, BUTTONBOX_EDGE, BUTTONBOX_END, BUTTONBOX_SPREAD and BUTTONBOX_START
GTK1.ButtonBox set_spacing(int spacing)
in pixels
CLASS GTK1.CTreeNode |
This is one of the nodes (branch or leaf) of the CTree. They are the equivalent of row numbers in a normal CList.
CTreeNode child()
Returns the first child node
int get_expanded()
Returns the previous sibling (the next on the same level)
int get_is_leaf()
Returns the previous sibling (the next on the same level)
int get_level()
Returns the previous sibling (the next on the same level)
CTreeNode next()
Returns the next sibling (the next on the same level)
GTK1.CTreeNode parent()
Returns the parent node
CTreeNode prev()
Returns the previous sibling (the next on the same level)
GTK1.CTreeRow row()
Returns the CTreeRow associated with this CTreeNode. DEPRECATED, all CTreeRow functions are also available directly in this object.
CLASS GTK1.CTreeRow |
This class is deprecated.
GTK1.CTreeNode get_children()
Return the first child
int get_expanded()
Return 1 if the node is expanded
int get_is_leaf()
Return 1 if the node is a leaf node
int get_level()
Return the level of this node (0 for root, 1 for a child of the root, etc)
GTK1.CTreeNode get_parent()
Return the parent node of this node
CLASS GTK1.Calendar |
A calendar widget.
GTK1.Calendar();
GTK1.Calendar()->select_day( 16 );
Signals: day_selected
day_selected_double_click
month_changed
next_month
next_year
prev_month
prev_year
GTK1.Calendar clear_marks()
Remove all day markers
GTK1.Calendar GTK1.Calendar()
Create a new calendar widget
GTK1.Calendar display_options(int options)
Bitwise or of one or more of CALENDAR_NO_MONTH_CHANGE, CALENDAR_SHOW_DAY_NAMES, CALENDAR_SHOW_HEADING, CALENDAR_SHOW_WEEK_NUMBERS and CALENDAR_WEEK_START_MONDAY.
GTK1.Calendar freeze()
Suspend all dynamic updating of the widget
mapping get_date()
returns a mapping: ([ "year":year, "month":month, "day":day ])
array get_day()
Return an array of 6x7 days, representing the cells in the currently viewed calendar month.
array get_day_month()
Return an array of 6x7 days, representing the cells in the currently viewed calendar month. The value is the day of month.
int get_focus_col()
The currently focused column
int get_focus_row()
The currently focused row
int get_highlight_col()
The currently highlighted column
int get_highlight_row()
The currently highlighted row
array get_marked_dates()
Returns an array (with 31 elements) with 1es and 0es.
int get_month()
The current month
int get_num_marked_dates()
The number of days that are marked
int get_selected_day()
The currently selected day
int get_year()
The current year
inherit GTK1.Widget : Widget
GTK1.Calendar mark_day(int day_of_month)
Mark a day
GTK1.Calendar select_day(int day_of_month)
Select a certain day of the currently selected month
int select_month(int month, int year)
Select the month to be viewed.
GTK1.Calendar set_marked_date_color(int index, GDK1.Color color)
Set the color to use to mark dates
GTK1.Calendar thaw()
Resume dynamic updating of the widget
GTK1.Calendar unmark_day(int day_of_month)
Unmark a day
CLASS GTK1.CheckButton |
Check buttons inherent many properties and functions from the the
toggle buttons, but look a little different. Rather than
being buttons with text inside them, they are small squares with
the text to the right of them. These are often used for toggling
options on and off in applications.
GTK1.CheckButton( "title" )
GTK1.CheckButton GTK1.CheckButton(string|void label)
The argument, if specified, is the label of the item. If no label is specified, use object->add() to add some other widget (such as an pixmap or image widget)
inherit GTK1.ToggleButton : ToggleButton
CLASS GTK1.CheckMenuItem |
A check menu item is more or less identical to a check button, but it
should be used in menus.
GTK1.CheckMenuItem("Hi there")
GTK1.CheckMenuItem("Hi there")->set_active(1)
Signals: toggled Called when the state of the menu item is changed
GTK1.CheckMenuItem GTK1.CheckMenuItem(string|void label)
The argument, if specified, is the label of the item. If no label is specified, use object->add() to add some other widget (such as an pixmap or image widget)
inherit GTK1.MenuItem : MenuItem
GTK1.CheckMenuItem set_active(int new_state)
State is either 1 or 0. If 1, the button will be 'pressed'.
GTK1.CheckMenuItem set_show_toggle(int togglep)
If true, the toggle indicator will be shown
GTK1.CheckMenuItem toggled()
Emulate a toggled event
CLASS GTK1.Clist |
The GtkCList widget is a multi-column list widget that is capable
of handling literally thousands of rows of information. Each column
can optionally have a title, which itself is optionally active,
allowing us to bind a function to it's selection.
GTK1.Clist(2)->set_column_title(0,"Col 1")->set_column_title(1,"Col 2")->column_titles_show()->set_column_width(0,50)->set_usize(150,70)
Signals: abort_column_resize
click_column Called when a column is clicked
end_selection
extend_selection
resize_column Called when a column is resized
scroll_horizontal
scroll_vertical
select_all
select_row Called when a row is selected
start_selection
toggle_add_mode
toggle_focus_row
undo_selection
unselect_all
unselect_row Called when a row is deselected
int append(array columns)
The return value of indicates the index of the row that was just added.
'columns' are the texts we want to put in the columns. The size of the array should equal the number of columns in the list.
GTK1.Clist clear()
remove all rows
GTK1.Clist column_title_active(int column)
Make a specific column title active
GTK1.Clist column_title_passive(int column)
Make a specific column title passive
GTK1.Clist column_titles_active()
The column titles can be pressed
GTK1.Clist column_titles_hide()
Hide the column titles
GTK1.Clist column_titles_passive()
The column titles can't be pressed
GTK1.Clist column_titles_show()
Show the column titles.
int columns_autosize()
Resize all columns according to their contents
GTK1.Clist GTK1.Clist(int columns)
Create a new empty clist, columns columns wide.
Not all columns have to be visible, some can be used to store data that is related to a certain cell in the list.
int find_row_from_data(object data)
Find a row in the list that has the given user data. If no node is found, -1 is returned.
GTK1.Clist freeze()
freeze all visual updates of the list, and then thaw the list after you have made a number of changes and the updates wil occure in a more efficent mannor than if you made them on a unfrozen list
GDK1.Color get_background(int row)
Return the background color of a specified row
GTK1.Style get_cell_style(int row, int col)
return the W(Style) associated with a specific cell
int get_cell_type(int row, int column)
Return value is one of CELL_EMPTY, CELL_PIXMAP, CELL_PIXTEXT, CELL_TEXT and CELL_WIDGET
string get_column_title(int column)
Returns the title of a specified column.
GTK1.Widget get_column_widget(int column)
Return the widget for the specified column title
int get_columns()
Return the number of columns in this clist
int get_drag_button()
Return the button used to drag items (by default 1)
int get_flags()
Return the flags. A bitwise or of CLIST_ADD_MODE, CLIST_AUTO_RESIZE_BLOCKED, CLIST_AUTO_SORT, CLIST_DRAW_DRAG_LINE, CLIST_DRAW_DRAG_RECT, CLIST_IN_DRAG, CLIST_REORDERABLE, CLIST_ROW_HEIGHT_SET, CLIST_SHOW_TITLES and CLIST_USE_DRAG_ICONS
int get_focus_row()
The currently focused row
GDK1.Color get_foreground(int row)
Return the foregroun color for the specified row
GTK1.Adjustment get_hadjustment()
Return the W(Adjustment) object used for horizontal scrolling
GTK1.Clist get_pixmap(int row, int column)
Return the pixmap for the specified cell
mapping get_pixtext(int row, int col)
Return the pixmap and text for the specified cell as a mapping: ([ "spacing":spacing, "text":text, "pixmap":pixmap ])
object get_row_data(int row)
Return the data associated with a row, or 0.
int get_row_height()
Return the height of the row
GTK1.Style get_row_style(int row)
Return the W(style) object associated with the specified row
int get_rows()
Return the number of rows
int get_selectable(int row)
Return 1 if the specified row can be selected by the user.
array get_selection()
Return an array with all selected rows.
mapping get_selection_info(int x, int y)
Return the row column corresponding to the x and y coordinates, the returned values are only valid if the x and y coordinates are relative to the clist window coordinates
int get_selection_mode()
Return the selection mode. One of SELECTION_BROWSE, SELECTION_EXTENDED, SELECTION_MULTIPLE and SELECTION_SINGLE
int get_shadow_type()
Return the curreent shadow type. One of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
int get_sort_column()
The column that will be used to sort the rows
int get_sort_type()
The sort method, one of SORT_ASCENDING and SORT_DESCENDING
GTK1.Clist get_text(int row, int col)
Return the text associated with a specific cell.
GTK1.Adjustment get_vadjustment()
Return the W(Adjustment) object used for vertical scrolling
inherit GTK1.Container : Container
int insert(int row, array columns)
Insert a row after a specified row. The return value of indicates the index of the row that was just added, please note that this is not nessasarily the same row as the specified one, if autosort is activated, the row will be inserted so that the list is sill sorted.
'columns' are the texts we want to put in the columns. The size of the array should equal the number of columns in the list.
GTK1.Clist moveto(int row, int column, float xpos, float ypos)
Make the specified row and column visible, and place it relative to xpos and ypos in the area the Clist occupies. xpos and ypos are relative, 0.0 == top, 1.0 == bottom
int optimal_column_width(int column)
Return the optimal width of the specified column
int prepend(array columns)
The return value of indicates the index of the row that was just added.
'columns' are the texts we want to put in the columns. The size of the array should equal the number of columns in the list.
GTK1.Clist remove(int row)
Delete a specified row. If you want to remove all rows in a Clist, use 'clear()' instead of calling remove multiple times.
GTK1.Clist row_move(int from_row, int to_row)
Move the specified row to just before the specified destination row.
GTK1.Clist select_all()
Select all rows
GTK1.Clist select_row(int row, int column)
Select the given row. The column is sent to the signal handler, but ignored for all other purposes.
GTK1.Clist set_auto_sort(int sortp)
If true, the clist will automatically be re-sorted when new rows are inserted. Please note that it will not be resorted if the text in cells are changed, use 'sort()' to force a reorder. The sort function is stable.
GTK1.Clist set_background(int row, GDK1.Color color)
Set the background color of the specified row the the specified color
GTK1.Clist set_button_actions(int button, int action)
Action is a bitwise or of BUTTONBOX_DEFAULT_STYLE, BUTTONBOX_EDGE, BUTTONBOX_END, BUTTONBOX_SPREAD, BUTTONBOX_START, BUTTON_DRAGS, BUTTON_EXPANDS, BUTTON_IGNORED and BUTTON_SELECTS Button is the mouse button (normally 1-3, 4 and 5 sometimes beeing scroll wheel up and scroll wheel down)
GTK1.Clist set_cell_style(int row, int column, GTK1.Style style)
Set a W(Style) for a specific cell
GTK1.Clist set_column_auto_resize(int column, int autoresizep)
Automatically resize a column to the width of it's widest contents.
GTK1.Clist set_column_justification(int column, int justification)
justification is one of JUSTIFY_CENTER, JUSTIFY_FILL, JUSTIFY_LEFT and JUSTIFY_RIGHT
GTK1.Clist set_column_max_width(int column, int width)
if width 6lt; 0 , there is no restriction
GTK1.Clist set_column_min_width(int column, int width)
Width in pixels
GTK1.Clist set_column_resizeable(int column, int resizeablep)
Make a column resizable, or remove it's the resizability.
GTK1.Clist set_column_title(int column, string title)
Set the column title of a specified column. It is a good idea to set the titles before the column title buttons are shown.
GTK1.Clist set_column_visibility(int column, int visiblep)
Hide or show a column
GTK1.Clist set_column_widget(int column, GTK1.Widget widget)
Put a widget as a column title. The widget will be added to a W(Button).
GTK1.Clist set_column_width(int column, int width)
Width in pixels
GTK1.Clist set_compare_func(function(:void) cmpfun)
Set the compare function. The function will be called with a
mapping as it's only argument, like this:
([
"clist":the clist widget,
"sort_column":the column to sort on,
"row1_data":The user data pointer for the first row,
"row2_data":The user data pointer for the second row,
"row1_text":The text in the sort cell in the first row
"row2_text":The text in the sort cell in the second row
])
The return value is one of:
1: Row 1 is more than row 2
0: The rows are equal
-1: Row 1 is lesser than row 2
To remove the comparefunction, use 0 as the argument.
GTK1.Clist set_foreground(int row, GDK1.Color color)
Set the foreground color of the specified row to the specified color
GTK1.Clist set_hadjustment(GTK1.Adjustment adjustment)
Set the W(Adjustment) object used for horizontal scrolling
GTK1.Clist set_pixmap(int row, int col, GDK1.Pixmap image, GDK1.Bitmap mask)
Set the pixmap of the specified cell. The mask is optional
GTK1.Clist set_pixtext(int row, int column, string text, int spacing, GDK1.Pixmap image, GDK1.Bitmap mask)
Set the pixmap and text of the specified cell. The mask is optional The spacing is the number of pixels between the pixmap and the text.
GTK1.Clist set_reorderable(int reorderablep)
If true, the user can drag around the rows in the list.
GTK1.Clist set_row_data(int row, object data)
Set the user data associated with the specified row. This data can be used to find rows, and when a row is selected it can be easily retrieved using node_get_row_data.
You can only use objects as row data right now
GTK1.Clist set_row_height(int pixels)
in pixels
GTK1.Clist set_row_style(int row, GTK1.Style style)
GTK1.Clist set_selectable(int row, int selectablep)
If true, the row can be selected by the user, otherwise it cannot be selected, only focused.
GTK1.Clist set_selection_mode(int mode)
One of SELECTION_BROWSE, SELECTION_EXTENDED, SELECTION_MULTIPLE and SELECTION_SINGLE
GTK1.Clist set_shadow_type(int shadowtype)
One of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK1.Clist set_shift(int row, int column, int yshift, int xshift)
The contents of the specified cell will be drawn shifted (indented) the specifid number of pixels.
This can be useful to generate a tree-like layout when you do not want to make a W(Ctree)
GTK1.Clist set_sort_column(int column)
GTK1.Clist set_sort_type(int direction)
Ascending or descending (One of SORT_ASCENDING and SORT_DESCENDING)
GTK1.Clist set_text(int row, int column, string text)
Set the text for the specified cell. Please note that even if auto sorting is enabled, the row will not be resorted. Use the 'sort()' function.
GTK1.Clist set_use_drag_icons(int dragiconsp)
If true, hard coded drag icons will be used.
GTK1.Clist set_vadjustment(GTK1.Adjustment adjustment)
Set the W(Adjustment) object used for vertical scrolling
GTK1.Clist sort()
Set the column on which all sorting will be performed
GTK1.Clist thaw()
freeze all visual updates of the list, and then thaw the list after you have made a number of changes and the updates wil occure in a more efficent mannor than if you made them on a unfrozen list
GTK1.Clist undo_selection()
Undo the previous selection
GTK1.Clist unselect_all()
Unselect all rows
GTK1.Clist unselect_row(int row, int column)
Unselect the given row. The column is sent to the signal handler, but ignored for all other purposes.
CLASS GTK1.Clock |
The GtkClock widget provides an easy way of providing a textual clock in your application. It supports realtime display, as well as count up and count down modes. The clock widget could conceivably be used in such applications as an application's status bar, or as the basis for a panel applet, etc.
Three modes of operation are supported. These are realtime - which displays the current time, count-up/increasing - which counts up from an initial value (like a stopwatch), and count-down/decreasing - which counts down from an initial value.
Note, however, that the accuracy of the gtkclock widget is limited
to 1 second.
GTK1.Clock( GTK1.ClockRealtime );
GTK1.Clock( GTK1.ClockDecreasing )->set_seconds(10000)->start();
GTK1.Clock GTK1.Clock(int type)
type is one of CLOCK_DECREASING, CLOCK_INCREASING and CLOCK_REALTIME;
inherit GTK1.Label : Label
GTK1.Clock set_format(string fmt)
Set the format of a GtkClock widget. The syntax of the format string is identical to that of the function strftime(3). Further information about time format strings can be found on this man page. The widget defaults to a format string of "%H:%M" in realtime mode, or "%H:%M:%S" in count-up or count-down modes.
GTK1.Clock set_seconds(int seconds)
Set the current time as displayed by the clock in count-up and count-down modes. This function has no effect in realtime mode, as the clock time is determined by the system clock in realtime mode.
GTK1.Clock set_update_interval(int seconds)
Set the interval at which the GtkClock widget is updated. The seconds parameter is used to determine how often the time shown on the widget is updated. The default value is to update every second, but you may wish to increase this value. If you set the update interval to 0, the clock is never updated.
GTK1.Clock start()
Start the clock counting in count-up or count-down modes. The clock will begin counting up or down from the time when this function is called, until gtk_clock_stop is called. This function has no effect in the realtime mode (you can't start and stop real time! :-).
GTK1.Clock stop()
Stop the clock counting in count-up or count-down modes. The clock ceases counting up or down, and the last time reached remains on the display. This function has no effect in the realtime mode (you can't start and stop real time! :-).
CLASS GTK1.ColorSelection |
The color selection widget is, not surprisingly, a widget for interactive selection of colors. This composite widget lets the user select a color by manipulating RGB (Red, Green, Blue) and HSV (Hue, Saturation, Value) triples. This is done either by adjusting single values with sliders or entries, or by picking the desired color from a hue-saturation wheel/value bar. Optionally, the opacity of the color can also be set.
The color selection widget currently emits only one signal, "color_changed", which is emitted whenever the current color in the widget changes, either when the user changes it or if it's set explicitly through set_color().
GTK1.ColorSelection()
GTK1.ColorSelection GTK1.ColorSelection()
Create a new color selection.
array get_color()
When you need to query the current color, typically when you've received a "color_changed" signal, you use this function. The return value is an array of floats, See the set_color() function for the description of this array.
inherit GTK1.Vbox : Vbox
GTK1.ColorSelection set_color(array color)
You can set the current color explicitly by calling this function with an array of colors (floats). The length of the array depends on whether opacity is enabled or not. Position 0 contains the red component, 1 is green, 2 is blue and opacity is at position 3 (only if opacity is enabled, see set_opacity()) All values are between 0.0 and 1.0
GTK1.ColorSelection set_update_policy(int policy)
one of UPDATE_ALWAYS, UPDATE_CONTINUOUS, UPDATE_DELAYED, UPDATE_DISCONTINUOUS and UPDATE_IF_VALID.
The default policy is GTK1.UpdateContinuous which means that the current color is updated continuously when the user drags the sliders or presses the mouse and drags in the hue-saturation wheel or value bar. If you experience performance problems, you may want to set the policy to GTK1.UpdateDiscontinuous or GTK1.UpdateDelayed.
CLASS GTK1.ColorSelectionDialog |
The color selection dialog widget is, not surprisingly, a color selection widget in a dialog window. Use the subwidget functions below to access the different subwidgets directly.
GTK1.ColorSelectionDialog("Select color")
Signals: color_changed Called when the color is changed
GTK1.ColorSelectionDialog GTK1.ColorSelectionDialog(string title)
Create a new color selection dialog with the specified title.
GTK1.Button get_cancel_button()
Return the cancel button widget.
GTK1.ColorSelection get_colorsel()
Return the color selection widget
GTK1.Button get_help_button()
Return the help button
GTK1.Button get_ok_button()
Return the ok button
inherit GTK1.Window : Window
CLASS GTK1.Combo |
Thee combo box is another fairly simple widget that is really just a collection of other widgets. From the user's point of view, the widget consists of a text entry box and a pull down menu from which the user can select one of a set of predefined entries. Alternatively, the user can type a different option directly into the text box.
The combo box has two principal parts that you as the programmer really care about: The W(entry) and the W(list).
GTK1.Combo()
GTK1.Combo GTK1.Combo()
Create a new combo box
GTK1.Combo disable_activate()
This will disable the 'activate' signal for the entry widget in the combo box.
GTK1.Entry get_entry()
The entry widget
inherit GTK1.Hbox : Hbox
GTK1.Combo set_case_sensitive(int sensitivep)
set_case_sensitive() toggles whether or not GTK searches for entries in a case sensitive manner. This is used when the Combo widget is asked to find a value from the list using the current entry in the text box. This completion can be performed in either a case sensitive or insensitive manner, depending upon the use of this function. The Combo widget can also simply complete the current entry if the user presses the key combination MOD-1 and "Tab". MOD-1 is often mapped to the "Alt" key, by the xmodmap utility. Note, however that some window managers also use this key combination, which will override its use within GTK1.
GTK1.Combo set_item_string(GTK1.Item item, string text)
The item is one of the ones in the list subwidget.
GTK1.Combo set_popdown_strings(array strings)
Set the values in the popdown list.
GTK1.Combo set_use_arrows(int use_arrows)
set_use_arrows() lets the user change the value in the entry using the up/down arrow keys. This doesn't bring up the list, but rather replaces the current text in the entry with the next list entry (up or down, as your key choice indicates). It does this by searching in the list for the item corresponding to the current value in the entry and selecting the previous/next item accordingly. Usually in an entry the arrow keys are used to change focus (you can do that anyway using TAB). Note that when the current item is the last of the list and you press arrow-down it changes the focus (the same applies with the first item and arrow-up).
GTK1.Combo set_use_arrows_always(int always_arrows)
set_use_arrows_always() allows the use the the up/down arrow keys to cycle through the choices in the dropdown list, just as with set_use_arrows, but it wraps around the values in the list, completely disabling the use of the up and down arrow keys for changing focus.
GTK1.Combo set_value_in_list(int value_must_be_in_list, int ok_if_empty)
If value_must_be_in_list is true, the user will not be able to enter any value that is not in the list. If ok_if_empty is true, empty values are possible as well as the values in the list.
CLASS GTK1.Container |
The basic container class.
Signals: add Called when a new object is added to the container. (used internally)
focus Called when the container gets focus (used internally)
need_resize Called when the container needs resizing (used internally)
remove Called when a object is removed from the container (used internally)
set_focus_child
GTK1.Container add(GTK1.Widget widget)
Add a subwidget to the container. Don't forget to call show() in the subwidget. Some (even most) containers can only contain one child. Calling this function might result in a resize of the container.
GTK1.Container border_width(int width)
Compatibility alias for set_border_width. Do not use this function in new code!
array children()
This function returns all children of the container as an array.
GTK1.Container focus(int focus_direction)
Emulate a focus event. direction is one of DIR_DOWN, DIR_LEFT, DIR_RIGHT, DIR_TAB_BACKWARD, DIR_TAB_FORWARD and DIR_UP.
inherit GTK1.Widget : Widget
GTK1.Container remove(GTK1.Widget widget)
Remove a child from the container. The argument is the child to remove. Calling this function might result in a resize of the container.
GTK1.Container set_border_width(int external_border_width)
Set the border width. The border width is the size of the padding around the container. Calling this function might result in a resize of the container.
GTK1.Container set_focus_child(GTK1.Widget child)
Emulate a set_focus_child signal. Focus on the specified child.
GTK1.Container set_focus_hadjustment(GTK1.Adjustment adj)
Set the hadjustment used to focus children.
GTK1.Container set_focus_vadjustment(GTK1.Adjustment adj)
Set the vadjustment used to focus children.
GTK1.Container set_resize_mode(int mode)
One of RESIZE_IMMEDIATE, RESIZE_PARENT and RESIZE_QUEUE
CLASS GTK1.Ctree |
The GtkCTree widget is used for showing a hierarchical tree to the user, for example a directory tree.
The tree is internally represented as a set of GtkCTreeNode structures.
The interface has much in common with the GtkCList widget: rows (nodes) can be selected by the user etc.
Positions in the tree are often indicated by two arguments, a parent and a sibling, both GtkCTreeNode pointers. If the parent is NULL, the position is at the root of the tree and if the sibling is NULL, it will be the last child of parent, otherwise it will be inserted just before the sibling.
Signals: change_focus_row_expansion Changed when the focused row is either expanded or collapsed
tree_collapse Called when a node is collapsed
tree_expand Called when a node is expanded
tree_move Called when a node is moved (using DND, as an example)
tree_select_row Called when a node is selected.
tree_unselect_row Called when a node is unselected.
GTK1.Ctree collapse(GTK1.CTreeNode node)
Collapse the node, hiding it's children. If no node is given, expand the toplevel of the tree
GTK1.Ctree collapse_recursive(GTK1.CTreeNode node)
Collapse the node, showing it's children, it's childrens children, etc. If no node is given, collapse the whole tree
GTK1.Ctree collapse_to_depth(GTK1.CTreeNode node, int depth)
Collapse depth levels of the tree, starting with the specified node. If no node is given, start with the toplevel node.
GTK1.Ctree GTK1.Ctree(int columns, int tree_column)
tree_column is the column that has the tree graphics (lines and expander buttons).
GTK1.Ctree expand(GTK1.CTreeNode node)
Expand the node, showing it's children. If no node is given, expand the toplevel of the tree
GTK1.Ctree expand_recursive(GTK1.CTreeNode node)
Expand the node, showing it's children, it's childrens children, etc. If no node is given, expand the whole tree
GTK1.Ctree expand_to_depth(GTK1.CTreeNode node, int depth)
Expand depth levels of the tree, starting with the specified node. If no node is given, start with the toplevel node.
int find(GTK1.CTreeNode node, GTK1.CTreeNode start)
Returns true if the node is a child of the start node.
If you omit the starting node, the tree will be searched from the root.
GTK1.Ctree find_by_row_data(object data, CTreeNode|void root)
Find a node in the tree starting with root, that has the given user data. If no node is found, 0 is returned.
GTK1.CTreeNode find_node_ptr(GTK1.CTreeRow node)
Given a W(CTreeRow) (deprectated structure in PiGTK), return the W(CTreeNode) associated with the row.
int get_expander_style()
The style of the expander buttons, one of CTREE_EXPANDER_CIRCULAR, CTREE_EXPANDER_NONE, CTREE_EXPANDER_SQUARE and CTREE_EXPANDER_TRIANGLE
int get_line_style()
The style of the lines, one of CTREE_LINES_DOTTED, CTREE_LINES_NONE, CTREE_LINES_SOLID and CTREE_LINES_TABBED
int get_show_stub()
Will stubs be shows?
int get_tree_column()
The column that is the tree column (the one with the expand/collapse icons)
int get_tree_indent()
The number of pixels to indent the tree levels.
int get_tree_spacing()
The number of pixels between the tree and the columns
inherit GTK1.Clist : Clist
GTK1.Ctree insert_node(GTK1.CTreeNode parent, GTK1.CTreeNode sibling, array text, int is_leaf, int expanded)
At least one of parent or sibling must be specified. If both are specified, sibling->parent() must be equal to parent.
If the parent and sibling is 0, the position is at the root of the tree, if the sibling is NULL, it will be the last child of parent, otherwise it will be inserted just before the sibling.
int is_ancestor(GTK1.CTreeNode node, GTK1.CTreeNode child)
Returns true if node is an ancestor of child
int is_hot_spot(int x, int y)
Returns true if the given coordinates lie on an expander button
int is_viewable(GTK1.CTreeNode node)
Returns 1 if a certain node can be viewed (with or without scrolling of the tree). Returns 0 if the node is in a folded part of the tree.
GTK1.CTreeNode last(GTK1.CTreeNode node)
Returns the last child of the last child of the last child... of the given node.
GTK1.Ctree move(GTK1.CTreeNode node, GTK1.CTreeNode new_parent, GTK1.CTreeNode new_sibling)
Move a node. Coordinates work as for insert.
GTK1.Style node_get_cell_style(GTK1.CTreeNode node, int col)
Return the style of a cell
int node_get_cell_type(GTK1.CTreeNode node, int column)
Return the celltype of this node.
mapping node_get_pixmap(CTreeNode node, int column)
Returns the pixmap and mask of this node in a mapping: ([ "pixmap":the_pixmap, "mask":the_bitmap ])
mapping node_get_pixtext(GTK1.CTreeNode n, int columne)
Returns the pixmap, mask and text of this node in a mapping: ([ "pixmap":the_pixmap, "mask":the_bitmap, "text":the_text ])
object node_get_row_data(GTK1.CTreeNode n)
Return the data associated with a node, or 0.
GTK1.Style node_get_row_style(GTK1.CTreeNode node)
Return the style of a row
int node_get_selectable(GTK1.CTreeNode node)
Return whether or not this node can be selcted by the user
string node_get_text(GTK1.CTreeNode node, int column)
Returns the text of the specified node
int node_is_visible(GTK1.CTreeNode node)
Return 1 if the node is currently visible
GTK1.Ctree node_moveto(GTK1.CTreeNode row, int column, float row_align, float col_align)
Scroll the tree so a specified node (and column) is visible. If the node is folded, it's first visible parent will be shown.
GTK1.CTreeNode node_nth(int row)
Return the node that is currently visible on the specified row.
GTK1.Ctree node_set_background(GTK1.CTreeNode node, GDK1.Color color)
Set the background of a row
GTK1.Ctree node_set_cell_style(GTK1.CTreeNode node, int col, GTK1.Style style)
Set the style of a cell
GTK1.Ctree node_set_foreground(GTK1.CTreeNode node, GDK1.Color col)
Set the foreground of a row
GTK1.Ctree node_set_pixmap(GTK1.CTreeNode node, int column, GDK1.Pixmap pixmap, GDK1.Bitmap mask)
Set the pixmap in a cell
GTK1.Ctree node_set_pixtext(GTK1.CTreeNode node, int column, string text, int spacing, GDK1.Pixmap pixmap, GDK1.Bitmap mask)
Set the pixmap and text in a cell
GTK1.Ctree node_set_row_data(GTK1.CTreeNode node, object data)
Set the user data associated with the specified node. This data can be used to find nodes, and when a node is selected it can be easily retrieved using node_get_row_data.
You can only use objects as row data right now
GTK1.Ctree node_set_row_style(GTK1.CTreeNode node, GTK1.Style style)
Set the style of a row
GTK1.Ctree node_set_selectable(GTK1.CTreeNode node, int selectablep)
Whether this node can be selected by the user.
GTK1.Ctree node_set_shift(GTK1.CTreeNode node, int column, int vertical, int horizontal)
Shift the given cell the given amounts in pixels.
GTK1.Ctree node_set_text(GTK1.CTreeNode node, int column, string text)
Set the text in a cell
GTK1.Ctree remove_node(GTK1.CTreeNode node)
Remove a node and it's subnodes from the tree. The nodes will be destroyed, so you cannot add them again.
GTK1.Ctree select(GTK1.CTreeNode node)
Select a node.
GTK1.Ctree select_recursive(GTK1.CTreeNode node)
Select a node and it's children.
GTK1.Ctree set_expander_style(int style)
Set the expander style, one of CTREE_EXPANDER_CIRCULAR, CTREE_EXPANDER_NONE, CTREE_EXPANDER_SQUARE and CTREE_EXPANDER_TRIANGLE
GTK1.Ctree set_indent(int npixels)
Set the indentation level
GTK1.Ctree set_line_style(int style)
Set the line style, one of CTREE_LINES_DOTTED, CTREE_LINES_NONE, CTREE_LINES_SOLID and CTREE_LINES_TABBED
GTK1.Ctree set_node_info(GTK1.CTreeNode node, string text, int spacing, GDK1.Pixmap pixmap_closed, GDK1.Bitmap mask_closed, GDK1.Pixmap pixmap_opened, GDK1.Bitmap mask_opened, int is_leaf, int expanded)
|
GTK1.Ctree set_show_stub(int stubp)
If true, the 'stub' will be shown. The stub is the small line that goes horizontally from the expand or collapse button to the actual contents of the tree
GTK1.Ctree set_spacing(int npixels)
Set the spacing between the tree column and the other columns
GTK1.Ctree sort_node(GTK1.CTreeNode node)
Sort the specified node.
GTK1.Ctree sort_recursive(GTK1.CTreeNode node)
Sort the specified node and it's children.
GTK1.Ctree toggle_expansion(GTK1.CTreeNode node)
If the node is expanded, collapse it, and if it's collapsed, expand it.
GTK1.Ctree toggle_expansion_recursive(GTK1.CTreeNode node)
Toggle the expansion of the whole subtree, starting with node.
GTK1.Ctree unselect(GTK1.CTreeNode node)
Unselect a node.
GTK1.Ctree unselect_recursive(GTK1.CTreeNode node)
Unselect a node and it's children.
CLASS GTK1.Curve |
GTK1.Curve()
GTK1.Curve GTK1.Curve()
array get_vector(int num_points)
inherit GTK1.DrawingArea : DrawingArea
GTK1.Curve reset()
GTK1.Curve set_curve_type(int type)
One of CURVE_TYPE_FREE, CURVE_TYPE_LINEAR and CURVE_TYPE_SPLINE;
GTK1.Curve set_gamma(float gamma)
GTK1.Curve set_range(float min_x, float max_x, float min_y, float max_y)
GTK1.Curve set_vector(int nelems, array curve)
CLASS GTK1.Data |
A class inherited by all objects used to store data (they are not widgets)
Signals: disconnect
inherit GTK1.Object : Object
CLASS GTK1.Databox |
GtkDatabox is designed to display large amounts of numerical data fast and easy. Thousands of data points (X and Y coordinate) may be displayed without any problems, zooming and scrolling as well as optional rulers are already included.
The widget may be used as display for oscilloscopes or other applications that need to display fast changes in their data.
GTK1.Databox x=GTK1.Databox(); x->data_add_x_y(3, ({ 1.0, 0.5, 0.0 }), ({1.0, -1.0, 0.0}),GDK1.Color(Image.Color.red), GTK1.DataboxLines,2); x->rescale(); x->set_usize(300,300); return x;
Signals: marked
selection_canceled
selection_changed
selection_started
selection_stopped
zoomed
GTK1.Databox GTK1.Databox()
Create a new databox widget
int data_add_x(int nelems, array x, int shared_Y_index, GDK1.Color color, int type, int dot_size)
Type is one of DATABOX_BARS, DATABOX_LINES, DATABOX_NOT_DISPLAYED and DATABOX_POINTS
int data_add_x_y(int nelems, array x, array y, GDK1.Color color, int type, int dot_size)
Type is one of DATABOX_BARS, DATABOX_LINES, DATABOX_NOT_DISPLAYED and DATABOX_POINTS
int data_add_y(int nelems, array y, int shared_X_index, GDK1.Color color, int type, int dot_size)
Type is one of DATABOX_BARS, DATABOX_LINES, DATABOX_NOT_DISPLAYED and DATABOX_POINTS
int data_destroy(int index)
int data_destroy_all()
array data_get_extrema()
mapping data_get_value(int x, int y)
array data_get_visible_extrema()
GTK1.Databox disable_zoom()
GTK1.Databox enable_zoom()
GTK1.Databox hide_cross()
GTK1.Databox hide_rulers()
GTK1.Databox hide_scrollbars()
inherit GTK1.Vbox : Vbox
GTK1.Databox rescale()
GTK1.Databox rescale_with_values(float minx, float miny, float maxx, float maxy)
int set_color(int index, GDK1.Color color)
int set_data_type(int index, int type, int dot_size)
Type is one of DATABOX_BARS, DATABOX_LINES, DATABOX_NOT_DISPLAYED and DATABOX_POINTS
GTK1.Databox show_cross()
GTK1.Databox show_rulers()
GTK1.Databox show_scrollbars()
CLASS GTK1.Dial |
This widget provides an analog dial widget, similar to, for
example, a physical volume control on a stereo. Dial values can be
changable or read-only for value reporting.
GTK1.Dial( GTK1.Adjustment() );
GTK1.Dial( GTK1.Adjustment(10.0) )->set_percentage(0.4);
GTK1.Dial GTK1.Dial(GTK1.Adjustment adjustment)
GTK1.Adjustment get_adjustment()
float get_percentage()
Retrieves the current percentage held in the dial widget.
float get_value()
Retrieves the current value helt in the dial widget.
inherit GTK1.Widget : Widget
GTK1.Dial set_adjustment(GTK1.Adjustment pos)
set_adjustment() does absolutely nothing if you pass it the adjustment that range is already using, regardless of whether you changed any of its fields or not. If you pass it a new Adjustment, it will unreference the old one if it exists (possibly destroying it), connect the appropriate signals to the new one, and call the private function gtk_range_adjustment_changed(), which will (or at least, is supposed to...) recalculate the size and/or position of the slider and redraw if necessary.
GTK1.Dial set_percentage(float percent)
Sets the GTK1.Dial's value to percent of dial->adjustment->upper. The upper value is set when the GtkAdjustment is created.
GTK1.Dial set_update_policy(int when)
The "update policy" of a range widget defines at what points during user interaction it will change the value field of its Adjustment and emit the "value_changed" signal on this Adjustment. The update policies are:
This is the default. The "value_changed" signal is emitted continuously, i.e., whenever the slider is moved by even the tiniest amount.
The "value_changed" signal is only emitted once the slider has stopped moving and the user has released the mouse button.
The "value_changed" signal is emitted when the user releases the mouse button, or if the slider stops moving for a short period of time.
float set_value(float to)
Sets the current value held in the GtkDial's adjustment object to value. Returns the new percentage of value to the adjustment's upper limit.
GTK1.Dial set_view_only(int view_only)
Specifies whether or not the user is to be able to edit the value represented by the dial widget. If view_only is TRUE, the dial will be set to view-only mode, and the user will not be able to edit it. If view_only is FALSE, the user will be able to change the valuerepresented.
CLASS GTK1.Dialog |
A dialog is a window with a few default widgets added. The 'vbox' is the main content area of the widget. The 'action_area' is allocated for buttons (ok, cancel etc)
GTK1.Dialog GTK1.Dialog()
Create a new dialog widget.
GTK1.HbuttonBox get_action_area()
The action area, this is where the buttons (ok, cancel etc) go
GTK1.Vbox get_vbox()
The vertical box that should contain the contents of the dialog
inherit GTK1.Window : Window
CLASS GTK1.DrawingArea |
The drawing area is a window you can draw in.
Please note that you must handle refresh and resize events
on your own. Use W(pDrawingArea) for a drawingarea with automatic
refresh/resize handling.
GTK1.DrawingArea()->set_usize(100,100)
GTK1.DrawingArea clear(int|void x, int|void y, int|void width, int|void height)
Either clears the rectangle defined by the arguments, of if no arguments are specified, the whole drawable.
GTK1.DrawingArea copy_area(GDK1.GC gc, int xdest, int ydest, GTK1.Widget source, int xsource, int ysource, int width, int height)
Copies the rectangle defined by xsource,ysource and width,height from the source drawable, and places the results at xdest,ydest in the drawable in which this function is called.
GTK1.DrawingArea GTK1.DrawingArea()
GTK1.DrawingArea draw_arc(GDK1.GC gc, int filledp, int x1, int y1, int x2, int y2, int angle1, int angle2)
Draws a single circular or elliptical arc. Each arc is specified by a rectangle and two angles. The center of the circle or ellipse is the center of the rectangle, and the major and minor axes are specified by the width and height. Positive angles indicate counterclockwise motion, and negative angles indicate clockwise motion. If the magnitude of angle2 is greater than 360 degrees, it is truncated to 360 degrees.
GTK1.DrawingArea draw_bitmap(GDK1.GC gc, GDK1.Bitmap bitmap, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw a GDK(Bitmap) in this drawable. NOTE: This drawable must be a bitmap as well. This will be fixed in GTK 1.3
GTK1.DrawingArea draw_image(GDK1.GC gc, GDK1.Image image, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw the rectangle specified by xsrc,ysrc+width,height from the GDK(Image) at xdest,ydest in the destination drawable
GTK1.DrawingArea draw_line(GDK1.GC gc, int x1, int y1, int x2, int y2)
img_begin w = GTK1.DrawingArea()->set_usize(100,100); delay: g = GDK1.GC(w)->set_foreground( GDK1.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_line(g,x*10,0,100-x*10,99); img_end
GTK1.DrawingArea draw_pixmap(GDK1.GC gc, GDK1.Pixmap pixmap, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw the rectangle specified by xsrc,ysrc+width,height from the GDK(Pixmap) at xdest,ydest in the destination drawable
GTK1.DrawingArea draw_point(GDK1.GC gc, int x, int y)
img_begin w = GTK1.DrawingArea()->set_usize(10,10); delay: g = GDK1.GC(w)->set_foreground( GDK1.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_point(g, x, x); img_end
GTK1.DrawingArea draw_rectangle(GDK1.GC gc, int filledp, int x1, int y1, int x2, int y2)
img_begin w = GTK1.DrawingArea()->set_usize(100,100); delay: g = GDK1.GC(w)->set_foreground( GDK1.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_rectangle(g,0,x*10,0,100-x*10,99); img_end img_begin w = GTK1.DrawingArea()->set_usize(100,100); delay: g = GDK1.GC(w); delay: for(int x = 0; x<30; x++) { delay: g->set_foreground(GDK1.Color(random(255),random(255),random(255)) ); delay: w->draw_rectangle(g,1,x*10,0,100-x*10,99); delay: } img_end
GTK1.DrawingArea draw_text(GDK1.GC gc, GDK1.Font font, int x, int y, string text, int forcewide)
y is used as the baseline for the text. If forcewide is true, the string will be expanded to a wide string even if it is not already one. This is useful when writing text using either unicode or some other 16 bit font.
inherit GTK1.Widget : Widget
GTK1.DrawingArea size(int width, int height)
This function is OBSOLETE
CLASS GTK1.Editable |
The GTK1.Editable class is a base class for widgets for editing text, such as W(Entry) and W(Text). It cannot be instantiated by itself. The editable class contains functions for generically manipulating an editable widget, a large number of action signals used for key bindings, and several signals that an application can connect to to modify the behavior of a widget.
Signals: activate Indicates that the user has activated the widget in some fashion. Generally, this will be done with a keystroke. (The default binding for this action is Return for GTK1.Entry and Control-Return for GTK1.Text.
changed Called when the text in the edit area is changed
copy_clipboard An action signal. Causes the characters in the current selection to be copied to the clipboard.
cut_clipboard An action signal. Causes the characters in the current selection to be copied to the clipboard and then deleted from the widget.
delete_text This signal is emitted when text is deleted from the widget by the user. The default handler for this signal will normally be responsible for inserting the text, so by connecting to this signal and then stopping the signal with signal_emit_stop(), it is possible to modify the inserted text, or prevent it from being inserted entirely. The start_pos and end_pos parameters are interpreted as for delete_text()
insert_text This signal is emitted when text is inserted into the widget by the user. The default handler for this signal will normally be responsible for inserting the text, so by connecting to this signal and then stopping the signal with signal_emit_stop(), it is possible to modify the inserted text, or prevent it from being inserted entirely.
kill_char An action signal. Delete a single character.
kill_line An action signal. Delete a single line.
kill_word n action signal. Delete a single word.
move_cursor An action signal. Move the cursor position.
move_page An action signal. Move the cursor by pages.
move_to_column An action signal. Move the cursor to the given column.
move_to_row An action signal. Move the cursor to the given row.
move_word An action signal. Move the cursor by words.
paste_clipboard An action signal. Causes the contents of the clipboard to be pasted into the editable widget at the current cursor position.
set_editable Determines if the user can edit the text in the editable widget or not. This is meant to be overriden by child classes and should not generally be useful to applications.
GTK1.Editable copy_clipboard()
Causes the characters in the current selection to be copied to the clipboard.
GTK1.Editable cut_clipboard()
Causes the characters in the current selection to be copied to the clipboard and then deleted from the widget.
GTK1.Editable delete_selection()
Deletes the current contents of the widgets selection and disclaims the selection.
GTK1.Editable delete_text(int start_pos, int end_pos)
Delete a sequence of characters. The characters that are deleted are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the the characters deleted will be those characters from start_pos to the end of the text.
string get_chars(int start_pos, int end_pos)
Retrieves a sequence of characters. The characters that are retrieved are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the the characters retrieved will be those characters from start_pos to the end of the text.
int get_position()
Returns the cursor position
inherit GTK1.Widget : Widget
GTK1.Editable insert_text(string text, int num_chars, int where)
Insert 'num_chars' characters from the text at the position 'where'.
GTK1.Editable paste_clipboard()
Causes the contents of the clipboard to be pasted into the given widget at the current cursor position.
GTK1.Editable select_region(int start_pos, int end_pos)
Selects a region of text. The characters that are selected are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the the characters selected will be those characters from start_pos to the end of the text. are
GTK1.Editable set_editable(int editablep)
Determines if the user can edit the text in the editable widget or not.
GTK1.Editable set_position(int pos)
Sets the cursor position.
CLASS GTK1.Entry |
Use this widget when you want the user to input a single line of text.
GTK1.Entry()->set_text("Hello world")->set_editable(1)
GTK1.Entry append_text(string text)
Append the specified string at the end of the entry
GTK1.Entry GTK1.Entry()
string get_text()
Returns the contents of the entry widget.
inherit GTK1.Editable : Editable
GTK1.Entry prepend_text(string text)
Prepend the specified string to the start of the entry
GTK1.Entry set_max_length(int maxlen)
text is truncated if needed
GTK1.Entry set_text(string text)
Set the text to the specified string. The old text is dropped.
GTK1.Entry set_visibility(int visiblep)
0 indicates invisible text (password boxes, as an example)
CLASS GTK1.EventBox |
Some gtk widgets don't have associated X windows, so they just draw on their parents. Because of this, they cannot receive events and if they are incorrectly sized, they don't clip so you can get messy overwritting etc. If you require more from these widgets, the EventBox is for you.
At first glance, the EventBox widget might appear to be totally useless. It draws nothing on the screen and responds to no events. However, it does serve a function - it provides an X window for its child widget. This is important as many GTK widgets do not have an associated X window. Not having an X window saves memory and improves performance, but also has some drawbacks. A widget without an X window cannot receive events, and does not perform any clipping on it's contents. Although the name EventBox emphasizes the event-handling function, the widget can also be used for clipping.
The primary use for this widget is when you want to receive events for a widget without a window. Examples of such widgets are labels and images.
GTK1.EventBox()->set_usize(100,100)
GTK1.EventBox GTK1.EventBox()
Create a new event box widget
inherit GTK1.Bin : Bin
CLASS GTK1.FileSelection |
GtkFileSelection should be used to retrieve file or directory names from the user. It will create a new dialog window containing a directory list, and a file list corresponding to the current working directory. The filesystem can be navigated using the directory list, the drop-down history menu, or the TAB key can be used to navigate using filename completion common in text based editors such as emacs and jed.
The default filename can be set using set_filename() and the selected filename retrieved using get_filename().
Use complete() to display files that match a given pattern. This can be used for example, to show only *.txt files, or only files beginning with gtk*.
Simple file operations; create directory, delete file, and rename file, are available from buttons at the top of the dialog. These can be hidden using hide_fileop_buttons() and shown again using show_fileop_buttons().
GTK1.FileSelection("File selector")
GTK1.FileSelection complete(string pattern)
Will attempt to match pattern to a valid filename in the current directory. If a match can be made, the matched filename will appear in the text entry field of the file selection dialog. If a partial match can be made, the "Files" list will contain those file names which have been partially matched.
GTK1.FileSelection GTK1.FileSelection(string window_title)
Creates a new file selection dialog box. By default it will list the files in the current working directory. Operation buttons allowing the user to create a directory, delete files, and rename files will also be present by default.
GTK1.Button get_cancel_button()
The cancel button
GTK1.Clist get_dir_list()
The list of directories
GTK1.Clist get_file_list()
The list of files
string get_filename()
Returns the currently entered filename as a string
GTK1.Button get_fileop_c_dir()
The create directory button in the file operation button group
GTK1.Button get_fileop_del_file()
The delete file button in the file operation button group
GTK1.Button get_fileop_ren_file()
The rename file button in the file operation button group
GTK1.Button get_help_button()
The help button
GTK1.OptionMenu get_history_pulldown()
Used to create the drop-down directory histor
GTK1.Button get_ok_button()
The ok button
GTK1.FileSelection hide_fileop_buttons()
Hides the file operation buttons that normally appear at the top of the dialog. Useful if you wish to create a custom file selector, based on GTK1.FileSelection.
inherit GTK1.Window : Window
GTK1.FileSelection set_filename(string fname)
Sets a default path for the file requestor. If filename includes a directory path, then the requestor will open with that path as its current working directory.
GTK1.FileSelection show_fileop_buttons()
Shows the file operation buttons, if they have previously been hidden. The rest of the widgets in the dialog will be resized accordingly.
CLASS GTK1.Fixed |
A fixed container is a container that keeps it's children at fixed locations and give them fixed sizes, both given in pixels.
Example:
GTK1.Fixed()->put(GTK1.Label("100,100"), 100, 100)->put(GTK1.Label("0,0"), 0, 0)->set_usize(150,115)
GTK1.Fixed GTK1.Fixed()
Create a new fixed widget
inherit GTK1.Container : Container
GTK1.Fixed move(GTK1.Widget widget, int new_xpos, int new_ypos)
Move the widget to new_xpos,new_ypos from it's old location.
GTK1.Fixed put(GTK1.Widget widget, int x, int y)
Place the widget at xpos,ypos.
CLASS GTK1.FontSelection |
GTK1.FontSelection()
GTK1.FontSelection GTK1.FontSelection()
GDK1.Font get_font()
string get_font_name()
string get_preview_text()
inherit GTK1.Notebook : Notebook
GTK1.FontSelection set_font_name(string xlfd)
This sets the currently displayed font. It should be a valid X Logical Font Description font name (anything else will be ignored), e.g. "-adobe-courier-bold-o-normal--25-*-*-*-*-*-*-*"
GTK1.FontSelection set_preview_text(string text)
CLASS GTK1.FontSelectionDialog |
The GtkFontSelectionDialog widget is a dialog box for selecting a font.
To set the font which is initially selected, use set_font_name().
To get the selected font use get_font() or get_font_name().
To change the text which is shown in the preview area, use set_preview_text().
The base filter is not yet implemented in Pike GTK1.
Filters can be used to limit the fonts shown. There are 2 filters in
the GtkFontSelectionDialog - a base filter and a user filter. The
base filter can not be changed by the user, so this can be used when
the user must choose from the restricted set of fonts (e.g. for a
terminal-type application you may want to force the user to select a
fixed-width font). The user filter can be changed or reset by the
user, by using the 'Reset Filter' button or changing the options on
the 'Filter' page of the dialog.
GTK1.FontSelectionDialog("Select a font")
GTK1.FontSelectionDialog GTK1.FontSelectionDialog(string title)
Create a new font selection dialog with the specified window title
GTK1.Button get_apply_button()
The apply button
GTK1.Button get_cancel_button()
The cancel button
GTK1.FontSelection get_fontsel()
The W(FontSelection) widget
GTK1.Button get_ok_button()
The ok button
inherit GTK1.Window : Window
CLASS GTK1.Frame |
The frame widget is a Bin that surrounds its child with a decorative frame and an optional label. If present, the label is drawn in a gap in the top side of the frame. The position of the label can be controlled with set_label_align().
Used to visually group objects.
GTK1.Frame("Title")->add(GTK1.Label("Contents"))
GTK1.Frame()->add(GTK1.Label("Contents"))
GTK1.Frame()->add(GTK1.Label("Contents"))->set_shadow_type(GTK1.SHADOW_IN)
GTK1.Frame GTK1.Frame(string|void label_text)
Create a new W(Frame) widget.
inherit GTK1.Container : Container
GTK1.Frame set_label(string|void label_text)
Set the text of the label.
GTK1.Frame set_label_align(float xalign, float yalign)
Arguments are xalignment and yalignment. 0.0 is left or topmost, 1.0 is right or bottommost. The default value for a newly created Frame is 0.0.
GTK1.Frame set_shadow_type(int shadow_type)
Set the shadow type for the Frame widget. The type is one of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
CLASS GTK1.GLArea |
GTK1.GLArea GTK1.GLArea(array gloptions)
inherit GTK1.DrawingArea : DrawingArea
GTK1.GLArea make_current()
GTK1.GLArea swap_buffers()
GTK1.GLArea wait_gdk()
GTK1.GLArea wait_gl()
CLASS GTK1.GammaCurve |
A gamma curve widget.. Rather complex.
Lets the user edit a gamma curve (a one-to-one mapping usually used to adjust the intensity of an image to the physical characteristics of the output device). You can set the minimum and maximum values for input and output. You can set the initial vector as well. You are guaranteed that every input value will have a (not necessarily unique) output value specified.
GTK1.GammaCurve()->set_usize(210,130)
GTK1.GammaCurve GTK1.GammaCurve()
Create a new gamma curve
GTK1.Curve get_curve()
The actual curve
float get_gamma()
The current gamma value
inherit GTK1.Vbox : Vbox
CLASS GTK1.GladeXML |
Glade is a free GUI builder for GTK+ and Gnome. It's normally used to create C-code, but can also produce code for other languages. Libglade is a utility library that builds the GUI from the Glade XML save files. This module uses libglade and allows you to easily make GUI designs to be used with your Pike applications. Since PiGTK doesn't support Gnome yet, you can only use the normal GTK widgets.
GTK1.Widget get_widget(string name)
This function is used to get get the widget corresponding to name in the interface description. You would use this if you have to do anything to the widget after loading.
GTK1.Widget get_widget_by_long_name(string long_name)
This function is used to get the widget corresponding to long_name in the interface description. You would use this if you have to do anything to the widget after loading. This function differs from GladeXML->get_widget, in that you have to give the long form of the widget name, with all its parent widget names, separated by periods.
string get_widget_long_name(GTK1.Widget widget)
Used to get the long name of a widget that was generated by a GladeXML object.
string get_widget_name(GTK1.Widget widget)
Used to get the name of a widget that was generated by a GladeXML object.
GTK1.GladeXML new(string filename, string|void root, string|void domain)
Creates a new GladeXML object (and the corresponding widgets) from the XML file filename. Optionally it will only build the interface from the widget node root. This feature is useful if you only want to build say a toolbar or menu from the XML file, but not the window it is embedded in. Note also that the XML parse tree is cached to speed up creating another GladeXML object for the same file. The third optional argument is used to specify a different translation domain from the default to be used.
GTK1.GladeXML new_from_memory(string data, string|void root, string|void domain)
Creates a new GladeXML object (and the corresponding widgets) from the string data. Optionally it will only build the interface from the widget node root. This feature is useful if you only want to build say a toolbar or menu from the XML document, but not the window it is embedded in. The third optional argument is used to specify a different translation domain from the default to be used.
GTK1.GladeXML signal_autoconnect(mapping callbacks, mixed data)
Try to connect functions to all signals in the interface. The mapping should consist of handler name : function pairs. The data argument will be saved and sent as the first argument to all callback functions.
GTK1.GladeXML signal_autoconnect_new(mapping callbacks, mixed data)
Try to connect functions to all signals in the interface. The mapping should consist of handler name : function pairs. This function differs from the signal_connect function in how it calls the callback function.
The old interface:
void signal_handler( mixed data, GTK1.Object object,
mixed ... signal_arguments )
The new interface:
void signal_handler( mixed ... signal_arguments,
mixed data, GTK1.Object object )
CLASS GTK1.HandleBox |
The contents of a handle box can be 'dragged' out of the box by the user.
The contents will then be placed in a separate window.
GTK1.HandleBox()->add(GTK1.Label("The contents"))
Signals: child_attached Called when a new child is added to the box
child_detached Called when a child is removed from the box
GTK1.HandleBox GTK1.HandleBox()
Create a new handle box widget.
int get_child_detached()
Is the child detatched?
int get_float_window_mapped()
Is the floating window mapped?
int get_handle_position()
The position of the handle. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP
int get_in_drag()
1 if the window is beeing dragged around right now.
int get_shrink_on_detach()
True if the container should shrink when the child is detatched
int get_snap_edge()
The edge to snap to. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP, or -1 for unset.
inherit GTK1.Bin : Bin
GTK1.HandleBox set_handle_position(int pos)
The position of the handle. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP
int set_set_shrink_on_detach()
True if the container should shrink when the child is detatched
GTK1.HandleBox set_shadow_type(int shadow_type)
One of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK1.HandleBox set_snap_edge(int pos)
The edge to snap to. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP, or -1 for unset.
CLASS GTK1.Hbox |
Most packing is done by creating boxes. These are invisible widget containers that we can pack our widgets into which come in two forms, a horizontal box, and a vertical box. This is the horizontal one. When packing widgets into a horizontal box, the objects are inserted horizontally from left to right or right to left depending on the call used.
GTK1.Hbox(0,0)->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->pack_end_defaults(GTK1.Button("From right"))->pack_start_defaults(GTK1.Button("From left"))
GTK1.Hbox(1,0)->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->pack_end_defaults(GTK1.Button("From right"))->pack_start_defaults(GTK1.Button("From left"))
GTK1.Hbox(1,40)->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->pack_end_defaults(GTK1.Button("From right"))->pack_start_defaults(GTK1.Button("From left"))
GTK1.Hbox GTK1.Hbox(int all_same_size, int hpadding)
Create a new horizontal box widget. If all_same_size is true, all widgets will have exactly the same size. hpadding is added to the left and right of the children.
inherit GTK1.Box : Box
CLASS GTK1.HbuttonBox |
A HbuttonBox is very similar to a Hbox. The major diffference is that the button box is made to pack buttons in, and has a few convenience function for normal button layouts.
GTK1.HbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_usize(400,30)
GTK1.HbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_layout(GTK1.BUTTONBOX_SPREAD)->set_usize(400,30)
GTK1.HbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_layout(GTK1.BUTTONBOX_EDGE)->set_usize(400,30)
GTK1.HbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_layout(GTK1.BUTTONBOX_START)->set_usize(400,30)
GTK1.HbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_layout(GTK1.BUTTONBOX_END)->set_usize(400,30)
GTK1.HbuttonBox GTK1.HbuttonBox()
Create a new horizontal button box
inherit GTK1.ButtonBox : ButtonBox
CLASS GTK1.Hpaned |
The paned window widgets are useful when you want to divide an area into two parts, with the relative size of the two parts controlled by the user. A groove is drawn between the two portions with a handle that the user can drag to change the ratio. This widgets makes a horizontal division
See W(Paned) for details.
GTK1.Hpaned()->add1(GTK1.Label("Left\nSide\nOf\nPane"))->add2(GTK1.Label("Right\nSide\nOf\nPane"))->set_usize(100,100)
GTK1.Hpaned GTK1.Hpaned()
inherit GTK1.Paned : Paned
CLASS GTK1.Hruler |
Ruler widgets are used to indicate the location of the mouse pointer in a given window. A window can have a vertical ruler spanning across the width and a horizontal ruler spanning down the height. A small triangular indicator on the ruler shows the exact location of the pointer relative to the ruler.
GTK1.Hruler()->set_metric(GTK1.PIXELS)->set_range(0.0,100.0,50.0,100.0)->draw_ticks()->draw_pos()->set_usize(300,30)
GTK1.Hruler()->set_metric(GTK1.CENTIMETERS)->set_range(0.0,100.0,50.0,100.0)->draw_ticks()->draw_pos()->set_usize(300,30)
GTK1.Hruler()->set_usize(300,30)
GTK1.Hruler GTK1.Hruler()
Used to create a new hruler widget.
inherit GTK1.Ruler : Ruler
CLASS GTK1.Hscale |
The GTK1.HScale widget is used to allow the user to select a value using a horizontal slider. A GTK1.Adjustment is used to set the initial value, the lower and upper bounds, and the step and page increments.
See W(Scale) for details
The position to show the current value, and the number of decimal places shown can be set using the parent W(Scale) class's functions.
GTK1.Hscale(GTK1.Adjustment())->set_usize(300,30)
GTK1.Hscale GTK1.Hscale(GTK1.Adjustment settings)
Used to create a new hscale widget. The adjustment argument can either be an existing W(Adjustment), or 0, in which case one will be created for you.
inherit GTK1.Scale : Scale
CLASS GTK1.Hscrollbar |
A horizontal scrollbar.
General documentation: See W(Scrollbar)
GTK1.Hscrollbar(GTK1.Adjustment())->set_usize(300,15)
GTK1.Hscrollbar GTK1.Hscrollbar(GTK1.Adjustment adjustment)
Used to create a new vscale widget. The adjustment argument can either be an existing W(Adjustment), or 0, in which case one will be created for you. Specifying 0 might actually be useful in this case, if you wish to pass the newly automatically created adjustment to the constructor function of some other widget which will configure it for you, such as a text widget.
inherit GTK1.Scrollbar : Scrollbar
CLASS GTK1.Hseparator |
Simply creates a horizontal separator. No bells or whistles.
GTK1.Hseparator()->set_usize(300,3)
GTK1.Hseparator GTK1.Hseparator()
Used to create a new hseparator widget.
inherit GTK1.Separator : Separator
CLASS GTK1.Image |
An image is a image object stored in client, not X server, memory. A pixmap, on the other hand, is a image object stored in the X-server. See GDK1.Image and GDK1.Pixmap.
GTK1.Image( GDK1.Image(0)->set(Image.Image(200,200)->test() ) );
GTK1.Image GTK1.Image(GDK1.Image image, GDK1.Bitmap mask)
You can skip the mask. The mask is used to mask the drawing of the image on it's background. It will not make the container transparent, though. Use shape_combine_mask on the container with the mask for that.
mapping get()
Returns ([ "image":GDK1.Image img, "mask":GDK1.Bitmap mask ])
inherit GTK1.Misc : Misc
GTK1.Image set(GDK1.Image image, GDK1.Bitmap mask)
Args: GDK1.Image and GDK1.Bitmap, respectively. You can skip the mask. The mask is used to mask the drawing of the image on it's background. It will not make the container transparent, though. Use shape_combine_mask on the container with the mask for that.
There is no need to call 'set' with the same GDK1.Image again if you have modified the image. You must, however, use ->queue_draw() to redraw the image. Otherwise the old contens will be shown until an refresh of the widget is done for any other reason.
CLASS GTK1.InputDialog |
This dialog is used to enable XInput devices. By default, no extension devices are enabled. We need a mechanism to allow users to enable and configure their extension devices. GTK provides the InputDialog widget to automate this process. The following procedure manages an InputDialog widget. It creates the dialog if it isn't present, and shows it otherwise.
GTK1.InputDialog inputd;
void create_input_dialog ()
{
if (!inputd)
{
inputd = GTK1.InputDialog();
inputd->close_button()->signal_connect("clicked",inputd->hide, 0);
inputd->save_button()->hide();
inputd->show();
}
else
inputd->show();
}
GTK1.InputDialog()
Signals: disable_device his signal is emitted when the user changes the mode of a device from a GDK_MODE_SCREEN or GDK_MODE_WINDOW to GDK_MODE_ENABLED
enable_device This signal is emitted when the user changes the mode of a device from GDK_MODE_DISABLED to a GDK_MODE_SCREEN or GDK_MODE_WINDOW.
GTK1.InputDialog GTK1.InputDialog()
Create a new input dialog window.
GTK1.Button get_close_button()
The 'close' button of the dialog.
GTK1.Button get_save_button()
The 'save' button of the dialog.
inherit GTK1.Dialog : Dialog
CLASS GTK1.Invisible |
An invisible container, useful, eh? :)
GTK1.Invisible GTK1.Invisible()
Create a new invisible widget
inherit GTK1.Bin : Bin
CLASS GTK1.Item |
This class is inherited by all 'item' type of widgets.
Signals: deselect
select
toggle
GTK1.Item deselect()
Emulate a 'deselect' event.
inherit GTK1.Bin : Bin
GTK1.Item select()
Emulate a 'select' event.
GTK1.Item toggle()
Emulate a 'toggle' event.
CLASS GTK1.Label |
A simple text label.
GTK1.Label("A simple text label")
GTK1.Label("Multi\nline text\nlabel here")
GTK1.Label("Multi\nline text\nlabel here")->set_justify(GTK1.JUSTIFY_LEFT)
GTK1.Label("Multi\nline text\nlabel here")->set_justify(GTK1.JUSTIFY_RIGHT)
GTK1.Label GTK1.Label(string text)
Creates a new label.
inherit GTK1.Misc : Misc
int parse_uline(string uline_string)
Convenience function to set the text and pattern by parsing a string with embedded underscores, returns the appropriate key symbol for the accelerator.
GTK1.Label set(string text)
DEPRECATED Compatibility function to set the text in the label. Use set_text. This function can dissapear in the future.
GTK1.Label set_justify(int justify)
one of JUSTIFY_CENTER, JUSTIFY_FILL, JUSTIFY_LEFT and JUSTIFY_RIGHT
GTK1.Label set_line_wrap(int wrapp)
Should the label autolinewrap?
GTK1.Label set_pattern(string pattern_string)
A string with either spaces or underscores. It should be of the same length as the text.
When a character in the text has a matching _ in the pattern, the character in the label will be underlined.
GTK1.Label set_text(string text)
Set the text in the label
CLASS GTK1.Layout |
GTK1.Layout GTK1.Layout(GTK1.Adjustment hadjustment, GTK1.Adjustment vadjustment)
GTK1.Layout freeze()
GTK1.Adjustment get_hadjustment()
int get_height()
GTK1.Adjustment get_vadjustment()
int get_width()
int get_xoffset()
int get_yoffset()
inherit GTK1.Container : Container
GTK1.Layout move(GTK1.Widget widget, int x, int y)
GTK1.Layout put(GTK1.Widget widget, int x, int y)
GTK1.Layout set_hadjustment(GTK1.Adjustment adj)
GTK1.Layout set_size(int xsize, int ysize)
GTK1.Layout set_vadjustment(GTK1.Adjustment adj)
GTK1.Layout thaw()
CLASS GTK1.Menu |
A GTK1.Menu is a W(MenuShell) that implements a drop down menu consisting of a list of W(MenuItem) objects which can be navigated and activated by the user to perform application functions.
A GTK1.Menu is most commonly dropped down by activating a W(MenuItem) in a W(MenuBar) or popped up by activating a W(MenuItem) in another GTK1.Menu.
A GTK1.Menu can also be popped up by activating a W(OptionMenu). Other composite widgets such as the W(Notebook) can pop up a GTK1.Menu as well.
Applications can display a GTK1.Menu as a popup menu by calling the popup() function. The example below shows how an application can pop up a menu when the 3rd mouse button is pressed.
GTK1.Menu menu = create_menu();
GTK1.Window window = create_window();
window->signal_connect( "button_press_event", lambda(GTK1.Menu m,
GTK1.Window w,
mapping e ) {
if( e->button == 3 )
menu->popup();
}, menu );
GTK1.Menu append(GTK1.Widget widget)
Adds a new W(MenuItem) to the end of the menu's item list.
GTK1.Menu attach_to_widget(GTK1.Widget widget)
Attach the menu to a widget
GTK1.Menu GTK1.Menu()
Create a new GTK1.Menu widget.
GTK1.Menu detach()
Detaches the menu from the widget to which it had been attached.
GTK1.Widget get_active()
Returns the selected menu item from the menu. This is used by the W(OptionMenu).
GTK1.Widget get_attach_widget()
Returns the W(Widget) that the menu is attached to.
int get_torn_off()
return 1 if the menu is torn off.
inherit GTK1.MenuShell : MenuShell
GTK1.Menu insert(GTK1.Widget widget, int position)
Adds a new W(MenuItem) to the menu's item list at the position indicated by position.
GTK1.Menu popdown()
Removes the menu from the screen.
GTK1.Menu popup(int|void button_pressed_to_show_menu)
The default button is 3.
GTK1.Menu prepend(GTK1.Widget widget)
Adds a new W(MenuItem) to the start of the menu's item list.
GTK1.Menu reorder_child(GTK1.Widget menuitem, int pos)
Moves a W(MenuItem) to a new position within the GTK1.Menu.
GTK1.Menu reposition()
Repositions the menu according to its position function.
GTK1.Menu set_accel_group(GTK1.AccelGroup accelerators)
Set the W(AccelGroup) which holds global accelerators for the menu.
GTK1.Menu set_active(int activep)
Selects the specified menu item within the menu. This is used by the W(OptionMenu).
GTK1.Menu set_tearoff_state(int torn_off)
Changes the tearoff state of the menu. A menu is normally displayed as drop down menu which persists as long as the menu is active. It can also be displayed as a tearoff menu which persists until it is closed or reattached.
GTK1.Menu set_title(string new_title)
Sets the title string for the menu. The title is displayed when the menu is shown as a tearoff menu.
CLASS GTK1.MenuBar |
Basically a horizontal W(Menu).
The menu image cannot be
grabbed automatically, but this is how you would create a menu all
in one line. This is not the recommended coding style.
GTK1.MenuBar()->add(GTK1.MenuItem("Menu")->set_submenu(GTK1.Menu()->add(GTK1.MenuItem("Sub")))->select()->activate())->add(GTK1.MenuItem("Bar"))
GTK1.MenuBar append(GTK1.Widget menu)
GTK1.MenuBar GTK1.MenuBar()
inherit GTK1.MenuShell : MenuShell
GTK1.MenuBar insert(GTK1.Widget menu, int position)
GTK1.MenuBar prepend(GTK1.Widget menu)
GTK1.MenuBar set_shadow_type(int int)
CLASS GTK1.MenuItem |
Menu items, to be added to menues.
GTK1.MenuItem activate()
Emulate an activate signal
GTK1.MenuItem configure(int toggle_indicator, int submenu_indicator)
First argument is 'show_toggle_indicator', second is 'show_submenu_indicator'.
GTK1.MenuItem GTK1.MenuItem(string|void label)
If a string is supplied, a W(Label) widget is created using that string and added to the item. Otherwise, you should add another widget to the list item with ->add().
GTK1.MenuItem deselect()
Emulate a deselect signal
int get_accelerator_width()
The width of the accelerator string, in pixels
int get_right_justify()
Is the widget right justified?
int get_show_submenu_indicator()
Should the submenu indicator be shown?
int get_show_toggle_indicator()
Should the toggle indicator be shown?
int get_submenu_direction()
The direction the submenu will be shown in. One of DIR_DOWN, DIR_LEFT, DIR_RIGHT, DIR_TAB_BACKWARD, DIR_TAB_FORWARD and DIR_UP
int get_submenu_placement()
The placement of the submenu.
int get_toggle_size()
The size of the toggle indicator
inherit GTK1.Item : Item
GTK1.MenuItem remove_submenu()
Remove the submenu for this menu button.
GTK1.MenuItem right_justify()
Make the menu item stick to the right edge of it's container.
GTK1.MenuItem select()
Emulate a select signal
GTK1.MenuItem set_placement(int dir)
(sub menu placement) One of DIRECTION_LEFT and DIRECTION_RIGHT
GTK1.MenuItem set_submenu(GTK1.Widget menu)
Set the submenu for this menu button.
CLASS GTK1.MenuShell |
A GTK1.MenuShell is the abstract base class used to derive the W(Menu) and W(MenuBar) subclasses.
A GTK1.MenuShell is a container of W(MenuItem) objects arranged in a list which can be navigated, selected, and activated by the user to perform application functions. A W(MenuItem) can have a submenu associated with it, allowing for nested hierarchical menus.
Signals: activate_current An action signal that activates the current menu item within the menu shell.
cancel An action signal which cancels the selection within the menu shell. Causes the selection_done signal to be emitted.
deactivate This signal is emitted when a menu shell is deactivated.
move_current An action signal which moves the current menu item in the direction specified by the third argument.
selection_done This signal is emitted when a selection has been completed within a menu shell.
GTK1.MenuShell activate_item(GTK1.Widget menu_item, int force_deactivate)
Activates the menu item within the menu shell.
GTK1.MenuShell append(GTK1.Widget what)
Adds a new W(MenuItem) to the end of the menu shell's item list. Same as 'add'.
array children()
This function returns all children of the menushell as an array.
GTK1.MenuShell deactivate()
Deactivates the menu shell. Typically this results in the menu shell being erased from the screen.
int get_active()
1 if the menu shell is currently active.
inherit GTK1.Container : Container
GTK1.MenuShell insert(GTK1.Widget what, int where)
Add a widget after the specified location
GTK1.MenuShell prepend(GTK1.Widget what)
Add a menu item to the start of the widget (for a menu: top, for a bar: left)
GTK1.MenuShell select_item(GTK1.Widget menuitem)
Selects the menu item from the menu shell.
CLASS GTK1.Misc |
The GTK1.Misc widget is an abstract widget which is not useful itself, but is used to derive subclasses which have alignment and padding attributes.
The horizontal and vertical padding attributes allows extra space to be added around the widget.
The horizontal and vertical alignment attributes enable the widget to be positioned within its allocated area. Note that if the widget is added to a container in such a way that it expands automatically to fill its allocated area, the alignment settings will not alter the widgets position.
GTK1.Vbox(0,0)->add(GTK1.Label("Label"))->set_usize(100,20)
GTK1.Vbox(0,0)->add(GTK1.Label("Label")->set_alignment(1.0,0.0))->set_usize(100,20)
GTK1.Vbox(0,0)->add(GTK1.Label("Label")->set_alignment(0.0,0.0))->set_usize(100,20)
float get_xalign()
The horizontal alignment, from 0 (left) to 1 (right).
int get_xpad()
The amount of space to add on the left and right of the widget, in pixels.
float get_yalign()
The vertical alignment, from 0 (top) to 1 (botton).
int get_ypad()
The amount of space to add on the top and bottom of the widget, in pixels.
inherit GTK1.Widget : Widget
GTK1.Misc set_alignment(float xalign, float yalign)
Sets the alignment of the widget. 0.0 is left or topmost, 1.0 is right or bottommost.
GTK1.Misc set_padding(int xpad, int ypad)
Sets the amount of space to add around the widget. xpand and ypad are specified in pixels.
CLASS GTK1.Notebook |
The NoteBook Widget is a collection of 'pages' that overlap each other, each page contains different information. This widget has become more common lately in GUI programming, and it is a good way to show blocks similar information that warrant separation in their display.
GTK1.Notebook( )->set_tab_pos( GTK1.POS_LEFT )->append_page( GTK1.Label("Page 1\nContents"), GTK1.Label("Page 1"))->append_page( GTK1.Label(""), GTK1.Label("Page 2"))->append_page(GTK1.Label("Page 3 contents\nare here!"), GTK1.Label("Page 3"))
GTK1.Notebook( )->set_tab_pos( GTK1.POS_TOP )->append_page( GTK1.Label("Page 1\nContents"), GTK1.Label("Page 1"))->append_page( GTK1.Label(""), GTK1.Label("Page 2"))->append_page(GTK1.Label("Page 3 contents\nare here!"), GTK1.Label("Page 3"))
GTK1.Notebook( )->set_tab_pos( GTK1.POS_RIGHT )->append_page( GTK1.Label("Page 1\nContents"), GTK1.Label("Page 1"))->append_page( GTK1.Label(""), GTK1.Label("Page 2"))->append_page(GTK1.Label("Page 3 contents\nare here!"), GTK1.Label("Page 3"))->next_page()->next_page()
Signals: switch_page Called when a different page is selected
GTK1.Notebook append_page(GTK1.Widget contents, GTK1.Widget label)
Add a new 'page' to the notebook. The first argument is the contents of the page, the second argument is the label.
GTK1.Notebook append_page_menu(GTK1.Widget contents, GTK1.Widget label, GTK1.Menu menu)
Add a new 'page' to the notebook. The first argument is the contents of the page, the second argument is the label, the third argument is a menu widget.
GTK1.Notebook GTK1.Notebook()
int get_current_page()
Returns the index of the currently selected page
GTK1.Widget get_menu_label(GTK1.Widget page)
GTK1.Widget get_nth_page(int index)
Returns the page for the specified index
GTK1.Widget get_tab_label(GTK1.Widget page)
inherit GTK1.Container : Container
GTK1.Notebook insert_page(GTK1.Widget contents, GTK1.Widget label, int pos)
Insert a page at the specified location, arguments as for append_page, but an aditional integer specifies the location.
GTK1.Notebook insert_page_menu(GTK1.Widget contents, GTK1.Widget label, GTK1.Menu menu, int pos)
Insert a page at the specified location, arguments as for append_page_menu, but an aditional integer specifies the location.
GTK1.Notebook next_page()
Go to the next page
int page_num(GTK1.Widget widget)
Returns the index for the specified page
GTK1.Notebook popup_disable()
Disable the popup menu (set with insert_page_menu)
GTK1.Notebook popup_enable()
Enable the popup menu (set with insert_page_menu)
GTK1.Notebook prepend_page(GTK1.Widget contents, GTK1.Widget label)
Add a page at the end of the list of pages. The first argument is the contents of the page, the second argument is the label.
GTK1.Notebook prepend_page_menu(GTK1.Widget contents, GTK1.Widget label, GTK1.Menu menu)
Add a new 'page' at the end of the list of pages. The first argument is the contents of the page, the second argument is the label, the third argument is a menu widget.
GTK1.Notebook prev_page()
Go to the previous page
mapping query_tab_label_packing(GTK1.Widget page)
Returns ([ "expand":expandp, "fill":fillp, "pack_type":type ])
GTK1.Notebook remove_page(int pos)
Remove a page.
GTK1.Notebook reorder_child(GTK1.Widget page, int new_index)
Move the specified page to the index new_index
GTK1.Notebook set_homogeneous_tabs(int homogeneousp)
If true, all tabs will have the same size
GTK1.Notebook set_menu_label(GTK1.Widget page, GTK1.Widget label)
GTK1.Notebook set_menu_label_text(GTK1.Widget page, string label)
GTK1.Notebook set_page(int pos)
Go to the specified page
GTK1.Notebook set_scrollable(int scrollablep)
If true, add scrollbars if nessesary.
GTK1.Notebook set_show_border(int showborderp)
If true, show the borders around the contents and tabs.
GTK1.Notebook set_show_tabs(int showtabsp)
If supplied with a true value, the tabs will be shown. Otherwise they will not be shown. The user will not be able to select the pages without them, but you can add 'next' and 'previous' buttons to create a wizard-line interface.
GTK1.Notebook set_tab_border(int border_width)
In pixels.
GTK1.Notebook set_tab_hborder(int border_width)
In pixels.
GTK1.Notebook set_tab_label(GTK1.Widget page, GTK1.Widget label)
GTK1.Notebook set_tab_label_packing(GTK1.Widget child, int expand, int fill, int type)
GTK1.Notebook set_tab_label_text(GTK1.Widget page, string title)
GTK1.Notebook set_tab_pos(int pos)
One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP
GTK1.Notebook set_tab_vborder(int border_width)
In pixels.
CLASS GTK1.Object |
The basic GTK class. All other GTK classes inherit this class. The only user-callable functions are the signal related ones.
Signals: destroy Called when the object is destroyed
GTK1.Object destroy()
GTK1.Object signal_block(mixed signal_id)
Temporarily block a signal handler. No signals will be received while the hander is blocked. See signal connect for more info.
mixed signal_connect(string signal, function(:void) callback, mixed|void callback_arg)
Connect a signal to a pike function. The function will be called with the last argument to this function as it's first argument (defaults to 0), the second argument is always the widget, any other arguments are the ones supplied by GTK1.
The return value of this function can be used to remove a signal with signal_disconnect, and block and unblock the signal will signal_block and signal_unblock.
mixed signal_connect_new(string signal, function(:void) callback, mixed|void callback_arg)
Connect a signal to a pike function.
This function differs from the signal_connect function in how it calls the callback function.
The old interface:
void signal_handler( mixed my_arg, GTK1.Object object,
mixed ... signal_arguments )
The new interface:
void signal_handler( mixed ... signal_arguments,
mixed my_arg, GTK1.Object object )
The return value of this function can be used to remove a signal with signal_disconnect, and block and unblock the signal will signal_block and signal_unblock.
GTK1.Object signal_disconnect(mixed signal_id)
Remove a signal formerly added by signal_connect. The argument is the return value of signal_connect(). See signal connect for more info.
GTK1.Object signal_emit(string signal_name)
Halt the emit of the current named signal. Useful in signal handlers when you want to override the behaviour of some default signal handler (key press events, as an example) See signal_connect.
GTK1.Object signal_unblock(mixed signal_id)
Unblock a formerly blocked signal handler. See signal_block and signal_connect for more info.
CLASS GTK1.OptionMenu |
A OptionMenu is a widget that allows the user to choose from a list of valid choices. The OptionMenu displays the selected choice. When activated the OptionMenu displays a popup W(Menu) which allows the user to make a new choice.
GTK1.OptionMenu()->set_menu(GTK1.Menu()->add( GTK1.MenuItem("Option 1") ));
GTK1.OptionMenu GTK1.OptionMenu()
Create a new option menu widget
GTK1.Menu get_menu()
Returns the W(Menu) associated with the OptionMenu.
inherit GTK1.Button : Button
GTK1.OptionMenu remove_menu()
Remove the menu.
GTK1.OptionMenu set_history(int index)
Selects the menu item specified by index making it the newly selected value for the option menu.
GTK1.OptionMenu set_menu(GTK1.Menu menu)
Provides the GtkMenu that is popped up to allow the user to choose a new value. You should provide a simple menu avoiding the use of tearoff menu items, submenus, and accelerators.
CLASS GTK1.Packer |
GTK1.Packer add(GTK1.Widget widget, int side, int anchor, int options, int border_width, int pad_x, int pad_y, int i_pad_x, int i_pad_y)
side is one of SIDE_BOTTOM, SIDE_LEFT, SIDE_RIGHT and SIDE_TOP, anchor is one of ANCHOR_CENTER, ANCHOR_E, ANCHOR_EAST, ANCHOR_N, ANCHOR_NE, ANCHOR_NORTH, ANCHOR_NORTH_EAST, ANCHOR_NORTH_WEST, ANCHOR_NW, ANCHOR_S, ANCHOR_SE, ANCHOR_SOUTH, ANCHOR_SOUTH_EAST, ANCHOR_SOUTH_WEST, ANCHOR_SW, ANCHOR_W and ANCHOR_WEST, options is a bitwise or of GTK1.PackExpand, GTK1.FillX and GTK1.FillY
GTK1.Packer add_defaults(GTK1.Widget widget, int side, int anchor, int options)
side is one of SIDE_BOTTOM, SIDE_LEFT, SIDE_RIGHT and SIDE_TOP, anchor is one of ANCHOR_CENTER, ANCHOR_E, ANCHOR_EAST, ANCHOR_N, ANCHOR_NE, ANCHOR_NORTH, ANCHOR_NORTH_EAST, ANCHOR_NORTH_WEST, ANCHOR_NW, ANCHOR_S, ANCHOR_SE, ANCHOR_SOUTH, ANCHOR_SOUTH_EAST, ANCHOR_SOUTH_WEST, ANCHOR_SW, ANCHOR_W and ANCHOR_WEST, options is a bitwise or of GTK1.PackExpand, GTK1.FillX and GTK1.FillY
GTK1.Packer GTK1.Packer()
int get_default_border_width()
int get_default_i_pad_x()
int get_default_i_pad_y()
int get_default_pad_x()
int get_default_pad_y()
int get_spacing()
inherit GTK1.Container : Container
GTK1.Packer reorder_child(GTK1.Widget child, int pos)
GTK1.Packer set_child_packing(GTK1.Widget child, int side, int anchor, int options, int border_width, int pad_x, int pad_y, int i_pad_x, int i_pad_y)
side is one of SIDE_BOTTOM, SIDE_LEFT, SIDE_RIGHT and SIDE_TOP, anchor is one of ANCHOR_CENTER, ANCHOR_E, ANCHOR_EAST, ANCHOR_N, ANCHOR_NE, ANCHOR_NORTH, ANCHOR_NORTH_EAST, ANCHOR_NORTH_WEST, ANCHOR_NW, ANCHOR_S, ANCHOR_SE, ANCHOR_SOUTH, ANCHOR_SOUTH_EAST, ANCHOR_SOUTH_WEST, ANCHOR_SW, ANCHOR_W and ANCHOR_WEST, options is a bitwise or of GTK1.PackExpand, GTK1.FillX and GTK1.FillY
GTK1.Packer set_default_border_width(int border)
GTK1.Packer set_default_ipad(int xpad, int ypad)
GTK1.Packer set_default_pad(int xpad, int ypad)
GTK1.Packer set_spacing(int new_spacing)
CLASS GTK1.Paned |
GTK1.Paned is the base class for widgets with two panes, arranged either horizontally (W(HPaned)) or vertically (W(VPaned)). Child widgets are added to the panes of the widget with pack1() and pack2(). The division beween the two children is set by default from the size requests of the children, but it can be adjusted by the user.
A paned widget draws a separator between the two child widgets and a small handle that the user can drag to adjust the division. It does not draw any relief around the children or around the separator. (The space in which the separator is called the gutter). Often, it is useful to put each child inside a W(Frame) with the shadow type set to GTK1.ShadowIn so that the gutter appears as a ridge.
Each child has two options that can be set, resize and shrink. If resize is true, then when the GTK1.Paned is resized, that child will expand or shrink along with the paned widget. If shrink is true, then when that child can be made smaller than it's requisition by the user. Setting shrink to 0 allows the application to set a minimum size. If resize is false for both children, then this is treated as if resize is true for both children.
The application can set the position of the slider as if it were set by the user, by calling set_position().
GTK1.Paned add1(GTK1.Widget left_or_top)
Set the left or topmost item. This is equivalent to pack1(left_or_top,0,1)
GTK1.Paned add2(GTK1.Widget right_or_bottom)
Set the right or bottommost item This is equivalent to pack2(left_or_top,0,1)
int get_handle_size()
The size of the handle, in pixels
int get_handle_xpos()
The xpos of the handle, in pixels
int get_handle_ypos()
The ypos of the handle, in pixels
int get_in_drag()
Return 1 if the user is dragging the handle
int get_max_position()
The maximum handle position possible.
int get_min_position()
The minimum handle position possible.
inherit GTK1.Container : Container
GTK1.Paned pack1(GTK1.Widget widget, int resize, int shrink)
Add a child to the top or left pane.
GTK1.Paned pack2(GTK1.Widget widget, int resize, int shrink)
Add a child to the bottom or right pane.
GTK1.Paned set_gutter_size(int gsize)
Set the width of the gutter. (The area between the two panes).
GTK1.Paned set_handle_size(int hsize)
The size of the handle in pixels
GTK1.Paned set_position(int position)
Set the position of the separator, as if set by the user. If position is negative, the remembered position is forgotten, and the division is recomputed from the the requisitions of the children.
CLASS GTK1.Pixmap |
Pixmaps are data structures that contain pictures. These pictures can be used in various places, but most visibly as icons on the X-Windows desktop, or as cursors. A bitmap is a 2-color pixmap.
To use pixmaps in GTK, you must first build a GDK1.Pixmap object using GDK1.Pixmap.
The pixels in a GTK1.Pixmap cannot be manipulated by the application after creation, since under the X Window system the pixel data is stored on the X server and so is not available to the client application. If you want to create graphical images which can be manipulated by the application, look at W(Image).
GTK1.Pixmap( GDK1.Pixmap( Image.Image(100,100)->test()) )
GTK1.Pixmap( GDK1.Pixmap( Image.Image(100,100)->test()), GDK1.Bitmap(Image.Image(100,100,255,255,255)->box(10,10,80,80, 0,0,0) ))
GTK1.Pixmap GTK1.Pixmap(GDK1.Pixmap pixmap, GDK1.Bitmap mask)
Create a new pixmap object, and sets the image and the mask.
mapping get()
Returns ([ "pixmap":pixmap, "mask":mask, "pixmap_insensitive":insensitive version of the pixmap ])
int get_build_insensitive()
inherit GTK1.Misc : Misc
GTK1.Pixmap set(GDK1.Pixmap pixmap, GDK1.Bitmap mask)
Sets the GDK1.Pixmap image and the optinal GDK1.Bitmap mask
GTK1.Pixmap set_build_insensitive(int buildp)
Set to TRUE if an extra pixmap should be automatically created to use when the pixmap is insensitive.
GTK1.Pixmap set_insensitive_pixmap(GDK1.Pixmap insensitive_pixmap)
Set the pixmap to use when the pixmap is insensitive.
CLASS GTK1.PixmapMenuItem |
GtkPixmapMenuItem works like a normal GTK menu item, but you can insert a arbitrary widget (most often a pixmap widget), which is displayed at the left side. The advantage is that indentation is handled the same way as GTK does (i.e if you create a menu with a gtk_check_menu_item, all normal menu items are automatically indented by GTK - so if you use a normal menu item to display pixmaps at the left side, the pixmaps will be indented, which is not what you want. This widget solves the problem).
GTK1.PixmapMenuItem GTK1.PixmapMenuItem()
Creates a new pixmap menu item.
inherit GTK1.MenuItem : MenuItem
GTK1.PixmapMenuItem set_pixmap(GTK1.Widget pixmap)
Set the pixmap of the menu item.
CLASS GTK1.Plug |
Together with W(Socket), GTK1.Plug provides the ability to embed widgets from one process into another process in a fashion that is transparent to the user. One process creates a W(Socket) widget and, passes the XID of that widgets window to the other process, which then creates a GTK1.Plug window with that XID. Any widgets contained in the GTK1.Plug then will appear inside the first applications window.
GTK1.Plug GTK1.Plug(int socket_id)
Create a new plug, the socket_id is the window into which this plug will be plugged.
int get_same_app()
returns 1 if the socket the plug is connected to is in this application.
inherit GTK1.Window : Window
CLASS GTK1.Progress |
GTK1.Progress configure(float value, float min, float max)
Sets the current value, the minimum value and the maximum value. The default min and max are 0.0 and 1.0 respectively.
int get_activity_mode()
The currently set activity mode.
float get_current_percentage()
Returns a float between 0.0 and 1.0
string get_current_text()
Return the current text (see set_format_string)
string get_format()
The format used to convert the value to a the text
float get_percentage_from_value(float value)
Returns a float between 0.0 and 1.0
int get_show_text()
1 if the text will be shown
string get_text_from_value(float value)
Formats 'value' and returns it as a text.
float get_value()
Return the current value
float get_x_align()
The text alignment, 0.0 is leftmost, 1.0 is rightmost
float get_y_align()
The text alignment, 0.0 is topmost, 1.0 is bottommost
inherit GTK1.Widget : Widget
GTK1.Progress set_activity_mode(int modep)
As well as indicating the amount of progress that has occurred, the progress bar may be set to just indicate that there is some activity. This can be useful in situations where progress cannot be measured against a value range. Mode is: 1: active 0: inactive
GTK1.Progress set_adjustment(GTK1.Adjustment adjustment)
Sets the adjustment to use. See the adjustment documentation for more info
GTK1.Progress set_format_string(string format)
More or less like sprintf.
%[field width][character]
0<=width>=2
Supported characters:
%: Insert a %
p or P: The percentage completed, with 'digits' number of decimals
v or V: The actual value, with digits decimals.
l or L: The lower value (from the adjustment)
u or U: The higer value (from the adjustment)
%: Insert a %
The default format is '%P%%'
GTK1.Progress set_percentage(float pct)
Sets the value (between 0.0 and 1.0). Uses the min and max values.
GTK1.Progress set_show_text(int textp)
If true, write a text in the progress bar.
GTK1.Progress set_text_alignment(float xalign, float yalign)
The location for the text in the progress bar. xalign is between 0.0 (leftmost) and 1.0 (rightmost) yalign is between 0.0 (topmost) and 1.0 (bottommost)
Default is xalign == yalign == 0.5
GTK1.Progress set_value(float value)
Set the value.
CLASS GTK1.ProgressBar |
A simple progress bar. Useful when you are doing things that take a long
time. Try to always have an 'abort' button whenever it makes sence.
GTK1.ProgressBar()->update(0.1)
GTK1.ProgressBar()->set_show_text(1)->update(0.3)
GTK1.ProgressBar()->update(0.6)
GTK1.ProgressBar()->update(1.0)
GTK1.ProgressBar GTK1.ProgressBar()
Create a new progress bar. The default values are: Min 0.0, max 1.0, current 0.0
int get_activity_blocks()
The number of blocks that are set.
int get_activity_dir()
The current direction of the progress meter. 1 is forward and 0 is backwards. Usefull if you for some strange reason would like to know in what direction the activity indicator is swinging right now...
int get_activity_pos()
The position of the progress meter in pixels.
int get_activity_step()
The step size of the activity indicator in pixels.
int get_bar_style()
The progress bar style. GTK_PROGRESS_CONTINUOUS or GTK_PROGRESS_DISCRETE.
int get_blocks()
The total number of blocks.
int get_orientation()
The current orientation. GTK_PROGRESS_LEFT_TO_RIGHT, GTK_PROGRESS_RIGHT_TO_LEFT, GTK_PROGRESS_BOTTOM_TO_TOP or GTK_PROGRESS_TOP_TO_BOTTOM.
inherit GTK1.Progress : Progress
GTK1.ProgressBar set_activity_blocks(int blocks)
The number of activity blocks
GTK1.ProgressBar set_activity_step(int stepp)
Include activity blocks (empty gaps in the progressbar, ala windows 98)
GTK1.ProgressBar set_bar_style(int style)
One of GTK1.ProgressContinuous or GTK1.ProgressDiscrete
GTK1.ProgressBar set_discrete_blocks(int blocks)
The number of discrete blocks in the progress bar
GTK1.ProgressBar set_orientation(int style)
One of GTK1.ProgressLeftToRight, GTK1.ProgressRightToLeft, GTK1.ProgressBottomToTop or GTK1.ProgressTopToBottom
GTK1.ProgressBar update(float fraction)
0.0 is the minimum value, 1.0 is the maximum value.
CLASS GTK1.RadioButton |
Radio buttons are similar to check buttons except they are grouped so that only one may be selected/depressed at a time. This is good for places in your application where you need to select from a short list of options. To connect the buttons, use another button in the desired group as the second argument to GTK1.RadioButton().
GTK1.RadioButton("Button");
GTK1.RadioButton GTK1.RadioButton(string|void title, GTK1.RadioButton groupmember)
Normal creation: object GTK1.RadioButton(string title) - First button (with label) object GTK1.RadioButton()->add(widget) - First button (with widget) object GTK1.RadioButton(title, another_radio_button) - Second to n:th button (with title) object GTK1.RadioButton(0,another_radio_button)->add(widget) - Second to n:th button (with widget)
inherit GTK1.CheckButton : CheckButton
GTK1.RadioButton set_group(GTK1.RadioButton groupmember)
the argument is another radio button to whose group this button should be added to. It is prefereable to use the second argument to the constructor instead, but if you for some reason want to move the button to another group, use this function.
CLASS GTK1.RadioMenuItem |
Exactly like W(RadioButton), but it is an menu item.
GTK1.RadioMenuItem("Menu item")
GTK1.RadioMenuItem GTK1.RadioMenuItem(string|void title, GTK1.RadioMenuItem groupmember)
object GTK1.RadioMenuItem(string title) - First button (with label) object GTK1.RadioMenuItem()->add(widget) - First button (with widget) object GTK1.RadioMenuItem(title, another_radio_button) - Second to n:th button (with title) object GTK1.RadioMenuItem(0,another_radio_button)->add(widget) - Second to n:th button (with widget)
inherit GTK1.MenuItem : MenuItem
GTK1.RadioMenuItem set_group(GTK1.RadioMenuItem groupmember)
the argument is another radio menu item to whose group this button should be added to. It is prefereable to use the second argument to the constructor instead, but if you for some reason want to move the button to another group, use this function.
CLASS GTK1.Range |
The category of range widgets includes the ubiquitous scrollbar widget and the less common "scale" widget. Though these two types of widgets are generally used for different purposes, they are quite similar in function and implementation. All range widgets share a set of common graphic elements, each of which has its own X window and receives events. They all contain a "trough" and a "slider" (what is sometimes called a "thumbwheel" in other GUI environments). Dragging the slider with the pointer moves it back and forth within the trough, while clicking in the trough advances the slider towards the location of the click, either completely, or by a designated amount, depending on which mouse button is used.
As mentioned in the W(Adjustment) page, all range widgets are associated with an adjustment object, from which they calculate the length of the slider and its position within the trough. When the user manipulates the slider, the range widget will change the value of the adjustment.
All of the GTK range widgets react to mouse clicks in more or less the same way. Clicking button-1 in the trough will cause its adjustment's page_increment to be added or subtracted from its value, and the slider to be moved accordingly. Clicking mouse button-2 in the trough will jump the slider to the point at which the button was clicked. Clicking any button on a scrollbar's arrows will cause its adjustment's value to change step_increment at a time.
It may take a little while to get used to, but by default, scrollbars as well as scale widgets can take the keyboard focus in GTK1. If you think your users will find this too confusing, you can always disable this by unsetting the GTK1.CanFocus flag on the scrollbar, like this:
scrollbar->unset_flag( GTK1.CanFocus );
The key bindings (which are, of course, only active when the widget has focus) are slightly different between horizontal and vertical range widgets, for obvious reasons. They are also not quite the same for scale widgets as they are for scrollbars, for somewhat less obvious reasons (possibly to avoid confusion between the keys for horizontal and vertical scrollbars in scrolled windows, where both operate on the same area).
GTK1.Adjustment get_adjustment()
int get_button()
int get_click_child()
int get_digits()
int get_in_child()
int get_need_timer()
float get_old_lower()
float get_old_page_size()
float get_old_upper()
float get_old_value()
int get_policy()
int get_scroll_type()
int get_timer()
int get_x_click_point()
int get_y_click_point()
inherit GTK1.Widget : Widget
GTK1.Range set_adjustment(GTK1.Adjustment pos)
set_adjustment() does absolutely nothing if you pass it the adjustment that range is already using, regardless of whether you changed any of its fields or not. If you pass it a new Adjustment, it will unreference the old one if it exists (possibly destroying it), connect the appropriate signals to the new one, and call the private function gtk_range_adjustment_changed(), which will (or at least, is supposed to...) recalculate the size and/or position of the slider and redraw if necessary.
GTK1.Range set_update_policy(int when)
The "update policy" of a range widget defines at what points during user interaction it will change the value field of its Adjustment and emit the "value_changed" signal on this Adjustment. The update policies are:
This is the default. The "value_changed" signal is emitted continuously, i.e., whenever the slider is moved by even the tiniest amount.
The "value_changed" signal is only emitted once the slider has stopped moving and the user has released the mouse button.
The "value_changed" signal is emitted when the user releases the mouse button, or if the slider stops moving for a short period of time.
GTK1.Range slider_update()
Update the slider values.
CLASS GTK1.Ruler |
Ruler widgets are used to indicate the location of the mouse pointer in a given window. A window can have a vertical ruler spanning across the width and a horizontal ruler spanning down the height. A small triangular indicator on the ruler shows the exact location of the pointer relative to the ruler.
GTK1.Ruler draw_pos()
draw the position
GTK1.Ruler draw_ticks()
draw the ticks
float get_lower()
The currently defined lower extent of the ruler.
float get_max_size()
The currently defined max_size of the ruler.
float get_position()
The currently defined initial position of the pointer indicator within the ruler.
float get_upper()
The currently defined upper extent of the ruler.
inherit GTK1.Widget : Widget
GTK1.Ruler set_metric(int unit)
Either GTK1.Pixels, GTK1.Centimers or GTK1.Inches. The default measure is GTK1.Pixels.
GTK1.Ruler set_range(float lower, float upper, float position, float max_size)
The lower and upper arguments define the extent of the ruler, and max_size is the largest possible number that will be displayed. Position defines the initial position of the pointer indicator within the ruler.
CLASS GTK1.Scale |
The GTK1.Scale widget is an abstract class, used only for deriving the subclasses GTK1.Hscale and GTK1.Vscale.
See W(Range) for generic range documentation
int get_draw_value()
non-zero if the scale's current value is displayed next to the slider.
int get_value_pos()
The position in which the textual value is displayed, selected from POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP
int get_value_width()
An internal function used to get the maximum width needed to display the value string. Not normaly used by applications.
inherit GTK1.Range : Range
GTK1.Scale set_digits(int precision)
Sets the number of decimal places that are displayed in the value.
GTK1.Scale set_draw_value(int drawp)
Specifies whether the current value is displayed as a string next to the slider.
GTK1.Scale set_value_pos(int where)
Sets the position in which the current value is displayed. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP
CLASS GTK1.Scrollbar |
These are your standard, run-of-the-mill scrollbars. These should be used only for scrolling some other widget, such as a list, a text box, or a viewport (and it's generally easier to use the scrolled window widget in most cases). For other purposes, you should use scale widgets, as they are friendlier and more featureful.
inherit GTK1.Range : Range
CLASS GTK1.ScrolledWindow |
Scrolled windows are used to create a scrollable area with another widget inside it. You may insert any type of widget into a scrolled window, and it will be accessible regardless of the size by using the scrollbars.
GTK1.ScrolledWindow(GTK1.Adjustment(),GTK1.Adjustment())->add(GTK1.Label("A small label"))->set_usize(100,80)->set_policy(GTK1.POLICY_AUTOMATIC,GTK1.POLICY_AUTOMATIC)
GTK1.ScrolledWindow(GTK1.Adjustment(),GTK1.Adjustment())->add(GTK1.Label("A small label"))->set_usize(70,80)->set_policy(GTK1.POLICY_AUTOMATIC,GTK1.POLICY_AUTOMATIC)
GTK1.ScrolledWindow(GTK1.Adjustment(),GTK1.Adjustment())->add(GTK1.Label("A small label"))->set_usize(80,80)
GTK1.ScrolledWindow(GTK1.Adjustment(),GTK1.Adjustment())->add(GTK1.Label("A very huge label")->set_usize(700,700))->set_usize(80,80)
GTK1.ScrolledWindow add(GTK1.Widget victim)
Add a widget to this container. This is equivalent to the C-GTK function gtk_scrolled_window_add_with_viewport or gtk_container_add, depeneding on whether or not the child supports the set_scroll_adjustments signal.
What this means in practice is that you do not have to care about this at all, it's all handled automatically.
GTK1.ScrolledWindow GTK1.ScrolledWindow(GTK1.Adjustment hadjustment, GTK1.Adjustment vadjustments)
The two adjustments are most commonly set to 0.
GTK1.Adjustment get_hadjustment()
Return the horizontal adjustment used to scroll the window
GTK1.Hscrollbar get_hscrollbar()
The horizontal scrollbar
int get_hscrollbar_policy()
One of POLICY_ALWAYS, POLICY_AUTOMATIC and POLICY_NEVER
int get_hscrollbar_visible()
1 if the horizontal scrollbar is currently visible
GTK1.Adjustment get_vadjustment()
Return the vertical adjustment used to scroll the window
GTK1.Vscrollbar get_vscrollbar()
The vertical scrollbar
int get_vscrollbar_policy()
One of POLICY_ALWAYS, POLICY_AUTOMATIC and POLICY_NEVER
int get_vscrollbar_visible()
1 if the vertical scrollbar is currently visible
int get_window_placement()
The location of the window relative to the scrollbars. One of CORNER_BOTTOM_LEFT, CORNER_BOTTOM_RIGHT, CORNER_TOP_LEFT and CORNER_TOP_RIGHT
inherit GTK1.Window : Window
GTK1.ScrolledWindow set_hadjustment(GTK1.Adjustment hadjustment)
Set the horizontal adjustment object
GTK1.ScrolledWindow set_placement(int window_corner_placement)
The location of the window relative to the scrollbars. One of CORNER_BOTTOM_LEFT, CORNER_BOTTOM_RIGHT, CORNER_TOP_LEFT and CORNER_TOP_RIGHT
GTK1.ScrolledWindow set_policy(int xpolicy, int ypolicy)
vertical and horiz policy. Both are one of POLICY_ALWAYS, POLICY_AUTOMATIC and POLICY_NEVER
GTK1.ScrolledWindow set_vadjustment(GTK1.Adjustment vadjustment)
Set the vertical adjustment object
CLASS GTK1.SelectionData |
The data associated with a selection.
string data()
Returns the selection in the data. The return value is always a string, but the width can vary (8, 16 or 32 bits per character).
int format()
Returns the selction format. The format is the number of bits per character.
int length()
Return the size of the selection data, in bytes.
The size of the data in characters (as returned by data()) is not necessarily the same.
GDK1.Atom selection()
The selection id, as a GDK(Atom).
GTK1.SelectionData set(string data)
Store new data into a GtkSelectionData object. Should _only_ by called from a selection handler callback.
GDK1.Atom target()
The target, as a GDK(Atom).
GDK1.Atom type()
The selection type, as a GDK(Atom).
CLASS GTK1.Separator |
A generic separator. Basicaly a line, like <hr> in HTML.
inherit GTK1.Widget : Widget
CLASS GTK1.Socket |
Together with W(Plug), GTK1.Socket provides the ability to embed widgets from one process into another process in a fashion that is transparent to the user. One process creates a GTK1.Socket widget and, passes the XID of that widget's window to the other process, which then creates a W(Plug) window with that XID. Any widgets contained in the W(Plug) then will appear inside the first applications window.
Note that if you pass the XID of the socket to another process that will create a plug in the socket, you must make sure that the socket widget is not destroyed until that plug is created. Violating this rule will cause unpredictable consequences, the most likely consequence being that the plug will appear as a separate toplevel window.
A socket can also be used to swallow arbitrary pre-existing top-level windows using steal(), though the integration when this is done will not be as close as between a W(Plug) and a GTK1.Socket.
GTK1.Socket GTK1.Socket()
int get_same_app()
return 1 if the widow contained in this socket comes from this process.
int has_plug()
Returns true if this socket is occupied
int id()
Returns the window id, to be sent to the application providing the plug. You must realize this widget before calling this function.
inherit GTK1.Container : Container
GTK1.Socket steal(int window_id)
Reparents a pre-existing toplevel window (not nessesarily a GTK window) into a socket.
CLASS GTK1.SpinButton |
The Spin Button widget is generally used to allow the user to select a value from a range of numeric values. It consists of a text entry box with up and down arrow buttons attached to the side. Selecting one of the buttons causes the value to "spin" up and down the range of possible values. The entry box may also be edited directly to enter a specific value.
The Spin Button allows the value to have zero or a number of decimal places and to be incremented/decremented in configurable steps. The action of holding down one of the buttons optionally results in an acceleration of change in the value according to how long it is depressed.
The Spin Button uses an W(Adjustment) object to hold information about the range of values that the spin button can take.
The attributes of an W(Adjustment) are used by the Spin Button in the following way: <ul><li>value: initial value for the Spin Button</li> <li>lower: lower range value</li> <li>upper: upper range value</li> <li>step_increment: value to increment/decrement when pressing mouse button 1 on a button</li> <li>page_increment: value to increment/decrement when pressing mouse button 2 on a button</li> <li>page_size: unused</li> </ul>
The argument order for the W(Adjustment) constructor is: value, lower, upper, step_increment, page_increment, page_size
GTK1.SpinButton( GTK1.Adjustment(),0.1, 1 )->set_usize(60,20)
GTK1.SpinButton configure(GTK1.Adjustment range, float climb_rate, int precision)
Adjustment (with the lower/upper/increse values), climb_rate and digits
GTK1.SpinButton GTK1.SpinButton(GTK1.Adjustment range, float climb_rate, int precision)
The climb_rate argument take a value between 0.0 and 1.0 and indicates the amount of acceleration that the Spin Button has. The digits argument specifies the number of decimal places to which the value will be displayed.
float get_climb_rate()
The amount of acceleration that the Spin Button has. 0.0 is no accelleration and 1.0 is highest accelleration.
int get_digits()
The number of decimal places to which the value will be displayed.
int get_numeric()
If != 0 the user can not enter anything but numeric values.
int get_snap_to_ticks()
If != 0 the Spin Button will round the value to the nearest step_increment.
int get_update_policy()
The update policy. GTK_UPDATE_ALWAYS or GTK_UPDATE_IF_VALID.
float get_value_as_float()
The current value of a Spin Button can be retrieved as a float.
int get_value_as_int()
The current value of a Spin Button can be retrieved as a int.
int get_wrap()
If != 0 the Spin Button will wrap around between the upper and lower range values.
inherit GTK1.Entry : Entry
GTK1.SpinButton set_adjustment(GTK1.Adjustment range)
Set a new adjustment.
GTK1.SpinButton set_digits(int precision)
Set the number of digits to show to the user.
GTK1.SpinButton set_numeric(int numericp)
If true, it is a numeric value. This prevents a user from typing anything other than numeric values into the text box of a Spin Button
GTK1.SpinButton set_shadow_type(int type)
Type is one of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK1.SpinButton set_snap_to_ticks(int snapp)
Set the Spin Button to round the value to the nearest step_increment, which is set within the Adjustment object used with the Spin Button
GTK1.SpinButton set_update_policy(int policy)
The possible values of policy are either GTK1.UpdateAlways or GTK1.UpdateIfValid.
These policies affect the behavior of a Spin Button when parsing inserted text and syncing its value with the values of the Adjustment.
In the case of GTK1.UpdateIfValid the Spin Button value only gets changed if the text input is a numeric value that is within the range specified by the Adjustment. Otherwise the text is reset to the current value.
In case of GTK1.UpdateAlways errors are ignored while converting text into a numeric value.
GTK1.SpinButton set_value(float to)
Set the value.
GTK1.SpinButton set_wrap(int wrapp)
If true, the spin button will wrap from the lowest to the highest value, and the highest to the lowest.
GTK1.SpinButton spin(int direction, float increment)
If you want to alter the value of a Spin Value relative to its current value, then this ffunction can be used.
The direction paramenter is one of SPIN_END, SPIN_HOME, SPIN_PAGE_BACKWARD, SPIN_PAGE_FORWARD, SPIN_STEP_BACKWARD, SPIN_STEP_FORWARD and SPIN_USER_DEFINED
GTK1.SpinStepForward and GTK1.SpinStepBackward change the value of the Spin Button by the amount specified by increment, unless increment is equal to 0, in which case the value is changed by the value of step_increment in theAdjustment.
GTK1.SpinPageForward and GTK1.SpinPageBackward simply alter the value of the Spin Button by increment.
GTK1.SpinHome sets the value of the Spin Button to the bottom of the Adjustments range.
GTK1.SpinEnd sets the value of the Spin Button to the top of the Adjustments range.
GTK1.SpinUserDefined simply alters the value of the Spin Button by the specified amount.
GTK1.SpinButton update()
Explicitly request that the Spin Button updates itself
CLASS GTK1.Statusbar |
Statusbars are simple widgets used to display a text message. They keep a stack of the messages pushed onto them, so that popping the current message will re-display the previous text message.
In order to allow different parts of an application to use the same statusbar to display messages, the statusbar widget issues Context Identifiers which are used to identify different 'users'. The message on top of the stack is the one displayed, no matter what context it is in. Messages are stacked in last-in-first-out order, not context identifier order.
lambda() {object sb = GTK1.Statusbar();int id = sb->get_context_id("test");sb->push(id,"A message");sb->push(id,"Another message");return sb;}()
lambda() {object sb = GTK1.Statusbar();int id = sb->get_context_id("test");sb->push(id,"A message");sb->push(id,"Another message");sb->pop(id);return sb;}()
Signals: text_poped
text_pushed
GTK1.Statusbar GTK1.Statusbar()
Create a new statusbar widget
int get_context_id(string context)
Create a new context id (or get the id of an old one). The argument is any string. The return value can be used for ->push() ->pop() and ->remove later on.
inherit GTK1.Hbox : Hbox
GTK1.Statusbar pop(int context)
Remove the topmost message.
int push(int context, string data)
Push a message onto the statusbar. The return value is an id that can be passed to remove later on.
GTK1.Statusbar remove(int context, int id)
Remove the specified message (the message id is the second argument).
CLASS GTK1.Style |
GTK1.Style apply_default_background(GDK1.Window window, int set_bgp, int state_type, GDK1.Rectangle area, int x, int y, int width, int height)
Set the background of the specified window (or the subarea indicated by the rectangle) to the default background for the state specified by state_type.
If set_bgp is true, the background of the widget will be set, otherwise it will only be drawn into the window.
GTK1.Style attach(GDK1.Window to)
Attach a style to a window; this process allocates the colors and creates the GC's for the style - it specializes it to a particular visual and colormap. The process may involve the creation of a new style if the style has already been attached to a window with a different style and colormap.
GTK1.Style copy()
Copy this style, and return the new style object
GTK1.Style destroy()
GTK1.Style detach()
Undo a previous attach
array get_base()
array get_base_gc()
array get_bg()
array get_bg_gc()
array get_bg_pixmap()
GDK1.Color get_black()
GDK1.GC get_black_gc()
array get_dark()
array get_dark_gc()
array get_fg()
array get_fg_gc()
GDK1.Font get_font()
array get_light()
array get_light_gc()
array get_mid()
array get_mid_gc()
array get_text()
array get_text_gc()
GDK1.Color get_white()
GDK1.GC get_white_gc()
CLASS GTK1.Table |
The Gtk.Table allow the programmer to arrange widgets in rows and columns, making it easy to align many widgets next to each other, horizontally and vertically.
GTK1.Table(2,2,0)->attach_defaults( GTK1.Label("0,0"), 0, 1, 0, 1)->attach_defaults( GTK1.Label("0,1"), 0, 1, 1, 2)->attach_defaults( GTK1.Label("1,0"), 1, 2, 0, 1)->attach_defaults( GTK1.Label("1,1"), 1, 2, 1, 2)->set_col_spacings(10)->set_row_spacings(10)
GTK1.Table(2,2,0)->attach_defaults( GTK1.Label("0,0-1,0"), 0, 2, 0, 1)->attach_defaults( GTK1.Label("0,1"), 0, 1, 1, 2)->attach_defaults( GTK1.Label("1,1"), 1, 2, 1, 2)->set_col_spacings(10)->set_row_spacings(10)
GTK1.Table attach(GTK1.Widget subwidget, int left, int right, int top, int bottom, int xoptions, int yoptions, int xpad, int ypad)
The left and right attach arguments specify where to place the widget, and how many boxes to use. If you want a button in the lower right table entry of our 2x2 table, and want it to fill that entry ONLY. left_attach would be = 1, right_attach = 2, top_attach = 1, bottom_attach = 2.
Now, if you wanted a widget to take up the whole top row of our 2x2 table, you'd use left_attach = 0, right_attach = 2, top_attach = 0, bottom_attach = 1.
The xoptions and yoptions are used to specify packing options and may be OR'ed together to allow multiple options.
These options are: <ul> <li> GTK1.Fill - If the table box is larger than the widget, and GTK_FILL is specified, the widget will expand to use all the room available.</li> <li> GTK1.Shrink - If the table widget was allocated less space then was requested (usually by the user resizing the window), then the widgets would normally just be pushed off the bottom of the window and disappear. If GTK_SHRINK is specified, the widgets will shrink with the table.</li> <li> GTK1.Expand - This will cause the table cell to expand to use up any remaining space in the window.</li> </ul>
Padding is just like in boxes, creating a clear area around the widget specified in pixels
GTK1.Table attach_defaults(GTK1.Widget subwidget, int left, int right, int top, int bottom)
As there are many options associated with attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options.
xoptions, yoptions, xpadding and ypadding are all set the their default values. For the options that is GTK1.Fill|GTK1.Expand. For the padding it is 0.
GTK1.Table GTK1.Table(int width, int height, int homogeneousp)
Used to create a new table widget. An initial size must be given by specifying how many rows and columns the table should have, although this can be changed later with resize().
There can never be more than 65535 colums nor more than 65535 rows.
setting homogeneousp to 1 forces the all tablecells to be exactly the same size.
int get_column_spacing()
The spacing between all columns, in pixels.
int get_homogeneous()
If 1, all cells have exactly the same size
int get_ncols()
The number of columns. Between 1 and 65535.
int get_nrows()
The number of rows. Between 1 and 65535.
int get_row_spacing()
The spacing between all rows, in pixels.
inherit GTK1.Container : Container
GTK1.Table resize(int rows, int columns)
If you need to change a table's size after it has been created, this function allows you to do so.
GTK1.Table set_col_spacing(int x, int spacing)
alters the amount of space between a given table column and the adjacent columns.
GTK1.Table set_col_spacings(int spacing)
Sets the space between every column in the table equal to spacing.
GTK1.Table set_homogeneous(int homogeneousp)
Set the homogeneous flag.
GTK1.Table set_row_spacing(int y, int spacing)
alters the amount of space between a given table row and the adjacent rows.
GTK1.Table set_row_spacings(int spacing)
Sets the space between every row in the table equal to spacing.
CLASS GTK1.TearoffMenuItem |
a GTK1.TearoffMenuItem is a special W(MenuItem) which is used to tear off and reattach its menu.
When its menu is shown normally, the GTK1.TearoffMenuItem is drawn as a dotted line indicating that the menu can be torn off. Activating it causes its menu to be torn off and displayed in its own window as a tearoff menu.
When its menu is shown as a tearoff menu, the GTK1.TearoffMenuItem
is drawn as a dotted line which has a left pointing arrow graphic
indicating that the tearoff menu can be reattached. Activating it
will erase the tearoff menu window.
GTK1.TearoffMenuItem()->set_usize( 100,0 )
GTK1.TearoffMenuItem GTK1.TearoffMenuItem()
Create a new tear of menu item
int get_torn_off()
Return 1 if the menu the menu item is connected to is currently torn off.
inherit GTK1.MenuItem : MenuItem
CLASS GTK1.Text |
The Text widget allows multiple lines of text to be displayed and edited. It supports both multi-colored and multi-font text, allowing them to be mixed in any way we wish. It also has a wide set of key based text editing commands, which are compatible with Emacs.
The text widget supports full cut-and-paste facilities, including the use of double- and triple-click to select a word and a whole line, respectively.
Bugs:<ul> <li> You cannot add text to the widget before it is realized.</li> </ul>
GTK1.Text(GTK1.Adjustment(),GTK1.Adjustment())
function_object(call_out(GTK1.Text(GTK1.Adjustment(),GTK1.Adjustment())->set_text, 0, "Some text")[0])
function_object(call_out(GTK1.Text(GTK1.Adjustment(),GTK1.Adjustment())->insert, 0, "Some text", 0, GDK1.Color(255,255,0), GDK1.Color(0,0,0))[0])
GTK1.Text backward_delete(int nchars)
Delete n characters backwards from the cursor position
GTK1.Text GTK1.Text(GTK1.Adjustment xadjustment, GTK1.Adjustment yadjustment)
Creates a new GTK1.Text widget, initialized with the given Gtk.Adjustments. These pointers can be used to track the viewing position of the GTK1.Text widget. Passing NULL to either or both of them will make the text widget create it's own. You can set these later with the function gtk_text_set_adjustment()
GTK1.Text forward_delete(int nchars)
Delete n characters forward from the cursor position
GTK1.Text freeze()
Freezes the widget which disallows redrawing of the widget until it is thawed. This is useful if a large number of changes are going to made to the text within the widget, reducing the amount of flicker seen by the user.
int get_length()
Returns the length of the all the text contained within the widget
int get_point()
Gets the current position of the cursor as the number of characters from the upper left corner of the GtkText widget.
string get_text()
Get the current contents of the text object.
inherit GTK1.Editable : Editable
GTK1.Text insert(string text, GDK1.Font font, GDK1.Color bg, GDK1.Color fg)
syntax: object insert(string what); OR object insert(string what, GDK1.Font font, GDK1.Color fg, GDK1.Color bg); OR object insert(string what, 0, GDK1.Color fg, GDK1.Color bg); OR object insert(string what, 0, GDK1.Color fg); OR object insert(string what, 0, 0, GDK1.Color bg);
Insert new text, optionally with colors.
GTK1.Text set_adjustments(GTK1.Adjustment xadjustment, GTK1.Adjustment yadjustment)
Change the adjustments (as supplied to the constructor) to other adjustments.
GTK1.Text set_editable(int editablep)
If true, the user can change the text in the widget.
GTK1.Text set_line_wrap(int linewrapp)
If true, the widget will automatically wrap the contents.
GTK1.Text set_point(int point)
Sets the cursor at the given point. In this case a point constitutes the number of characters from the extreme upper left corner of the widget.
GTK1.Text set_text(string to)
Set the text to the specified string.
GTK1.Text set_word_wrap(int wordwrapp)
If true, the widget will automatically wrap the contents.
GTK1.Text thaw()
unfreeze the widget.
CLASS GTK1.TipsQuery |
GTK1.TipsQuery GTK1.TipsQuery()
GTK1.Widget get_caller()
int get_in_query()
string get_label_inactive()
string get_label_no_tip()
GTK1.Widget get_last_crossed()
inherit GTK1.Label : Label
GTK1.TipsQuery set_caller(GTK1.Widget caller_widget)
GTK1.TipsQuery set_labels(string label_inactive, string label_no_tip)
GTK1.TipsQuery start_query()
GTK1.TipsQuery stop_query()
CLASS GTK1.ToggleButton |
Toggle buttons are derived from normal buttons and are very similar, except they will always be in one of two states, alternated by a click. They may be depressed, and when you click again, they will pop back up. Click again, and they will pop back down.
GTK1.ToggleButton("Toggle button")
GTK1.ToggleButton("Toggle button")->set_active( 1 )
Signals: toggled
GTK1.ToggleButton GTK1.ToggleButton(string|void label)
If you supply a string, a label will be created and inserted in the button. Otherwise, use ->add(widget) to create the contents of the button.
int get_active()
returns 1 if the button is pressed, 0 otherwise.
inherit GTK1.Button : Button
GTK1.ToggleButton set_active(int activep)
If activep is true, the toggle button will be activated.
GTK1.ToggleButton set_mode(int mode)
If true, draw indicator
GTK1.ToggleButton toggled()
emulate a 'toggle' of the button. This will emit a 'toggled' signal.
CLASS GTK1.Toolbar |
Toolbars are usually used to group some number of widgets in order to simplify customization of their look and layout. Typically a toolbar consists of buttons with icons, labels and tooltips, but any other widget can also be put inside a toolbar. Finally, items can be arranged horizontally or vertically and buttons can be displayed with icons, labels, or both.
Examples:
lambda(){object t=GTK1.Toolbar( GTK1.ORIENTATION_HORIZONTAL, GTK1.TOOLBAR_TEXT );t->append_item( "Button 1", "Tooltip 1", "", GTK1.Frame(), lambda(){},0);t->append_space();t->append_item( "Button 2", "Tooltip 2", "", GTK1.Frame(), lambda(){},0);t->append_item( "Button 3", "Tooltip 3", "", GTK1.Frame(), lambda(){},0);t->append_space();t->append_item( "Button 4", "Tooltip 4", "", GTK1.Frame(), lambda(){},0);t->append_item( "Button 5", "Tooltip 5", "", GTK1.Frame(), lambda(){},0);return t;}()
lambda(){object t=GTK1.Toolbar( GTK1.ORIENTATION_VERTICAL, GTK1.TOOLBAR_TEXT );t->append_item( "Button 1", "Tooltip 1", "", GTK1.Frame(), lambda(){},0);t->append_space();t->append_item( "Button 2", "Tooltip 2", "", GTK1.Frame(), lambda(){},0);t->append_item( "Button 3", "Tooltip 3", "", GTK1.Frame(), lambda(){},0);t->append_space();t->append_item( "Button 4", "Tooltip 4", "", GTK1.Frame(), lambda(){},0);t->append_item( "Button 5", "Tooltip 5", "", GTK1.Frame(), lambda(){},0);return t;}()
lambda(){object i=GDK1.Image()->set(Image.Image(20,20)->test());object t=GTK1.Toolbar( GTK1.ORIENTATION_HORIZONTAL, GTK1.TOOLBAR_BOTH );t->append_item( "Button 1", "Tooltip 1", "", GTK1.Image(i), lambda(){},0);t->append_space();t->append_item( "Button 2", "Tooltip 2", "", GTK1.Image(i), lambda(){},0);t->append_item( "Button 3", "Tooltip 3", "", GTK1.Image(i), lambda(){},0);t->append_space();t->append_item( "Button 4", "Tooltip 4", "", GTK1.Image(i), lambda(){},0);t->append_item( "Button 5", "Tooltip 5", "", GTK1.Image(i), lambda(){},0);return t;}()
Signals: orientation_changed
style_changed
GTK1.Toolbar append_item(string label, string tooltip, string prv, GTK1.Widget icon, function(:void) clicked_cb, mixed clicked_arg)
Adds a new button to the start of the toolbar.
GTK1.Toolbar append_space()
Adds a small space.
GTK1.Toolbar append_widget(GTK1.Widget widget, string tootip, string prv)
Append a custom widgets. Arguments are widget, tooltip, private
GTK1.Toolbar GTK1.Toolbar(int orientation, int style)
Orientation is one of ORIENTATION_HORIZONTAL and ORIENTATION_VERTICAL. Style is one of TOOLBAR_BOTH, TOOLBAR_ICONS and TOOLBAR_TEXT
int get_button_relief()
inherit GTK1.Container : Container
GTK1.Toolbar insert_item(string label, string tooltip, string prv, GTK1.Widget icon, function(:void) clicked_cb, mixed clicked_arg, int position)
Arguments as for append_item, but an extra position argument at the end. Adds a new button after the item at the specified position.
GTK1.Toolbar insert_space(int pixels)
Inserts a small space at the specified postion.
GTK1.Toolbar insert_widget(GTK1.Widget widget, string tootip, string prv, int pos)
Insert a custom widgets.
GTK1.Toolbar prepend_item(string label, string tooltip, string prv, GTK1.Widget icon, function(:void) clicked_cb, mixed clicked_arg)
Arguments as for append_item Adds a new button to the end of the toolbar.
GTK1.Toolbar prepend_space()
Adds a small space.
GTK1.Toolbar prepend_widget(GTK1.Widget widget, string tootip, string prv)
Prepend a custom widgets. Arguments are widget, tooltip, private
GTK1.Toolbar set_button_relief(int relief)
GTK1.Toolbar set_orientation(int orientation)
Set the orientation, one of ORIENTATION_HORIZONTAL and ORIENTATION_VERTICAL
GTK1.Toolbar set_space_size(int pixels)
Set the width (or height) of the space created by append_space.
GTK1.Toolbar set_space_style(int style)
GTK1.Toolbar set_style(int style)
Set the style, one of TOOLBAR_BOTH, TOOLBAR_ICONS and TOOLBAR_TEXT
GTK1.Toolbar set_tooltips(int tootipp)
If true, show the tooltips.
CLASS GTK1.Tooltips |
Tooltips are the messages that appear next to a widget when the mouse pointer is held over it for a short amount of time. They are especially helpful for adding more verbose descriptions of things such as buttons in a toolbar.
An individual tooltip belongs to a group of tooltips. A group is created with a call to GTK1.Tooltips(). Every tooltip in the group can then be turned off with a call to disable() and enabled with enable().
The length of time the user must keep the mouse over a widget before the tip is shown, can be altered with set_delay(). This is set on a 'per group of tooltips' basis.
To assign a tip to a particular W(Widget), set_tip() is used.
The default appearance of all tooltips in a program is determined by the current gtk theme that the user has selected. To change the tooltip appearance manually, use set_colors(). Again, this is per group of tooltips.
GTK1.Tooltips GTK1.Tooltips()
Creates an empty group of tooltips. This function initialises a GTK1.Tooltips structure. Without at least one such structure, you can not add tips to your application.
GTK1.Tooltips disable()
Disable this tooltip collection
GTK1.Tooltips enable()
Enable this tooltip collection
GTK1.Tooltips force_window()
Realize the tooltip window (as returned from get_gdkwindow())
inherit GTK1.Data : Data
GTK1.Tooltips set_colors(GDK1.Color foreground, GDK1.Color background)
Changes the foreground and background colors.
GTK1.Tooltips set_delay(int delay)
Set the delat (in seconds)
GTK1.Tooltips set_tip(GTK1.Widget in, string to)
Adds a tooltip containing the message tip_text to the specified W(Widget).
CLASS GTK1.Vbox |
Most packing is done by creating boxes. These are invisible widget containers that we can pack our widgets into which come in two forms, a horizontal box, and a vertical box. This is the vertical one. When packing widgets into a vertical box, the objects are inserted horizontally from top to bottom or bottom to top depending on the call used.
GTK1.Vbox(0,0)->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->pack_end_defaults(GTK1.Button("From right"))->pack_start_defaults(GTK1.Button("From left"))
GTK1.Vbox(1,0)->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->pack_end_defaults(GTK1.Button("From right"))->pack_start_defaults(GTK1.Button("From left"))
GTK1.Vbox(1,40)->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->pack_end_defaults(GTK1.Button("From right"))->pack_start_defaults(GTK1.Button("From left"))
GTK1.Vbox GTK1.Vbox(int uniformp, int padding)
Create a new horizontal box widget. If all_same_size is true, all widgets will have exactly the same size. padding is added to the top and bottom of the children.
inherit GTK1.Box : Box
CLASS GTK1.VbuttonBox |
A Vbutton_box is very similar to a Vbox. The major diffference is that the button box is made to pack buttons in, and has a few convenience function for normal button layouts.
GTK1.VbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_usize(100,300)
GTK1.VbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_layout(GTK1.BUTTONBOX_SPREAD)->set_usize(100,300)
GTK1.VbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_layout(GTK1.BUTTONBOX_EDGE)->set_usize(100,300)
GTK1.VbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_layout(GTK1.BUTTONBOX_START)->set_usize(100,300)
GTK1.VbuttonBox()->add(GTK1.Button("Hello"))->add(GTK1.Button("World"))->set_layout(GTK1.BUTTONBOX_END)->set_usize(100,300)
GTK1.VbuttonBox GTK1.VbuttonBox()
Create a new vertical button box
inherit GTK1.ButtonBox : ButtonBox
CLASS GTK1.Viewport |
This is a container that can be scrolled around, but it has no scrollbars.
You can connect scrollbars to it using the adjustment objects.
GTK1.Viewport(GTK1.Adjustment(),GTK1.Adjustment())->set_usize(100,100)
GTK1.Viewport(GTK1.Adjustment(),GTK1.Adjustment())->set_usize(100,100)->set_shadow_type(GTK1.SHADOW_ETCHED_IN)
GTK1.Viewport(GTK1.Adjustment(),GTK1.Adjustment())->set_usize(100,100)->add(GTK1.Label("A label with a very long text on it, it will not fit"))->set_shadow_type(GTK1.SHADOW_ETCHED_IN)
lambda(){ object a1;object v = GTK1.Viewport(a1=GTK1.Adjustment(),GTK1.Adjustment())->set_usize(100,100)->add(GTK1.Label("A label with a very long text on it, it will not fit"))->set_shadow_type(GTK1.SHADOW_ETCHED_IN);call_out(a1->set_value,0,100.0);return v;}()
GTK1.Viewport GTK1.Viewport(GTK1.Adjustment xscroll, GTK1.Adjustment yscroll)
Create a new viewport. The adjustments are used to select what part of the viewport to view to the user. They are normally connected to a scrollbar or something similar.
GTK1.Adjustment get_hadjustment()
Return the current horizontal adjustment object
GTK1.Adjustment get_vadjustment()
Return the current vertical adjustment object
inherit GTK1.Bin : Bin
GTK1.Viewport set_hadjustment(GTK1.Adjustment xscroll)
Set a new horizontal adjustment object.
GTK1.Viewport set_shadow_type(int type)
Set the shadow style. One of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK1.Viewport set_vadjustment(GTK1.Adjustment yscroll)
Set a new vertical adjustment object.
CLASS GTK1.Vpaned |
The paned window widgets are useful when you want to divide an area into two parts, with the relative size of the two parts controlled by the user. A groove is drawn between the two portions with a handle that the user can drag to change the ratio. This widgets makes a vertical division
GTK1.Vpaned()->add1(GTK1.Label("Top Side Of Pane"))->add2(GTK1.Label("Bottom"))->set_usize(100,100)
GTK1.Vpaned GTK1.Vpaned()
inherit GTK1.Paned : Paned
CLASS GTK1.Vruler |
Ruler widgets are used to indicate the location of the mouse pointer in a given window. A window can have a vertical ruler spanning across the width and a horizontal ruler spanning down the height. A small triangular indicator on the ruler shows the exact location of the pointer relative to the ruler.
GTK1.Vruler()->set_metric(GTK1.PIXELS)->set_range(0.0,100.0,50.0,100.0)->draw_ticks()->draw_pos()->set_usize(30,50)
GTK1.Vruler()->set_metric(GTK1.CENTIMETERS)->set_range(0.0,100.0,50.0,100.0)->draw_ticks()->draw_pos()->set_usize(30,50)
GTK1.Vruler()->set_usize(30,50)
GTK1.Vruler GTK1.Vruler()
Used to create a new vruler widget.
inherit GTK1.Ruler : Ruler
CLASS GTK1.Vscale |
The GTK1.VScale widget is used to allow the user to select a value using a vertical slider. A GtkAdjustment is used to set the initial value, the lower and upper bounds, and the step and page increments.
The position to show the current value, and the number of decimal places shown can be set using the parent W(Scale) class's functions.
GTK1.Vscale(GTK1.Adjustment())->set_usize(30,100)
GTK1.Vscale GTK1.Vscale(GTK1.Adjustment settings)
Used to create a new vscale widget. The adjustment argument can either be an existing W(Adjustment), or 0, in which case one will be created for you. Specifying 0 might actually be useful in this case, if you wish to pass the newly automatically created adjustment to the constructor function of some other widget which will configure it for you, such as a text widget.
inherit GTK1.Scale : Scale
CLASS GTK1.Vscrollbar |
General documentation: See W(Scrollbar)
GTK1.Vscrollbar(GTK1.Adjustment())->set_usize(15,60)
GTK1.Vscrollbar GTK1.Vscrollbar(GTK1.Adjustment pos)
Used to create a new vscrollbar widget. The adjustment argument can either be an existing W(Adjustment), or 0, in which case one will be created for you. Specifying 0 might actually be useful in this case, if you wish to pass the newly automatically created adjustment to the constructor function of some other widget which will configure it for you, such as a text widget.
inherit GTK1.Scrollbar : Scrollbar
CLASS GTK1.Vseparator |
Simply creates a vertical separator. No bells or whistles.
GTK1.Vseparator()->set_usize(3,50)
GTK1.Vseparator GTK1.Vseparator()
Used to create a new vseparator widget.
inherit GTK1.Separator : Separator
CLASS GTK1.Widget |
The basic widget, inherited (directly or indirectly) by all widgets. Thus, all functions and signals defined in this widget works on all widgets.
One of the most importat functions in this class is 'show', it lets GTK know that we are done setting the attributes of the widget, and it is ready to be displayed. You may also use hide to make it disappear again. The order in which you show the widgets is not important, but I suggest showing the toplevel window last so the whole window pops up at once rather than seeing the individual widgets come up on the screen as they're formed. The children of a widget (a window is a widget too) will not be displayed until the window itself is shown using the show() function.
Signals: add_accelerator Called when an accelarator (keyboard shortcut) is added to the widget
button_press_event Called when a mouse button is pressed
button_release_event Called when a mouse button is released
client_event An event sent by another client application
configure_event The size, position or stacking order of the widget has changed
debug_msg
delete_event Called when the user has requested that the widget should be closed
destroy_event Called when the widget is destroyed
drag_begin Called when the drag is initiated, on the sending side
drag_data_delete Called when the data can be safely deleted (there is no need to use this function in pigtk, it's all handled automatically)
drag_data_get Called on the sending side when the drop is initiated
drag_data_received Called on the receiving side when the drop is finished.
drag_drop Called on the receiving side when the drop is initiated
drag_end Called when the drag is finished, on the sending side
drag_leave Called when the mouse leaves the widget while the user is dragging something
drag_motion Called on the receiving side when the cursor is moved over the widget while dragging something
draw Called when the widget should draw itself.
draw_default Called when the widget should draw itself, and indicate that it's the default widget
draw_focus Called when the widget should draw itself, and a focus indicator around itself (or otherwise indicate that is has the keyboard focus)
enter_notify_event Called when the mouse enters the widget
event Called for all events
expose_event Called when the widget, or a part of the widget gets and expose event
focus_in_event The keyboard focus has entered the widget
focus_out_event The keyboard focus has left the widget
hide Called when the widget is hidden
key_press_event Called when a keyboard key is pressed
key_release_event Called when a keyboard key is released
leave_notify_event Called when the mouse leaves the widget
map Called when the window associated with the widget is mapped
map_event Called just before the 'map' signal
motion_notify_event Called when the mouse is moved inside the widget
no_expose_event
other_event
parent_set Called when the parent widget is changed
property_notify_event Called when a property of the GDK window associated with the widget is changed
proximity_in_event
proximity_out_event
realize Called when the widget is realized. Some methods cannot be used until the widget has been realized, if you get assertion errors related to 'w->window' or similar, this is probably the cause.
remove_accelerator Called when an accelerator (keyboard shortcut) is removed from the widget
selection_clear_event NYI
selection_notify_event NYI
selection_received NYI
selection_request_event NYI
show Called when the widget is shown
size_allocate Called when the widget gets the size it should be
size_request Called when the widget should calculate how big it wants to be
state_changed
style_set Called when the style is changed
unmap Called when the window associated with the widget is unmapped
unmap_event Called just before the 'unmap' signal
unrealize Called when the widget is unrealized.
visibility_notify_event The widget has been mapped, unmapped, hidden, or otherwise had its visibility modified
GTK1.Widget activate()
Activate the widget. This either activates the widget, if possible (as an example, buttons can be activated), or activates the default widget of its parent (or its parent, or its parents parent etc.)
GTK1.Widget add_accelerator(string signal, GTK1.AccelGroup group, int key, int modifiers, int flags)
Add an accelerator (keyboard shortcut).
Flag is one of ACCEL_LOCKED, ACCEL_SIGNAL_VISIBLE and ACCEL_VISIBLE
The signal is the signal to invoke when the accelerator key is pressed.
The modifiers is a bitwise or of one or more of GDK1.ShiftMask, GDK1.LockMask, GDK1.ControlMask, GDK_MOD1_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK, GDK_MOD4_MASK and GDK_MOD5_MASK.
The group is the accelerator group in which the accelerator should be added.
The key is the unicode code for the key to bind.
GTK1.Widget add_events(int events)
Events is one or more of: GDK1.ExposureMask, GDK1.PointerMotionMask, GDK1.PointerMotion_HINTMask, GDK1.ButtonMotionMask, GDK1.Button1MotionMask, GDK1.Button2MotionMask, GDK1.Button3MotionMask, GDK1.ButtonPressMask, GDK1.ButtonReleaseMask, GDK1.KeyPressMask, GDK1.KeyReleaseMask, GDK1.EnterNotifyMask, GDK1.LeaveNotifyMask, GDK1.FocusChangeMask, GDK1.StructureMask, GDK1.PropertyChangeMask, GDK1.VisibilityNotifyMask, GDK1.ProximityInMask, GDK1.ProximityOutMask and GDK1.AllEventsMask
mapping allocation()
Returns ([ "x":xoffset, "y":yoffset, "width":xsize, "height":ysize ])
string class_path()
Returns the class 'pathname' of this widget. Useful for rc-files and such.
GTK1.Widget copy_area(GDK1.GC gc, int xdest, int ydest, GTK1.Widget source, int xsource, int ysource, int width, int height)
Copies the rectangle defined by xsource,ysource and width,height from the source widget, and places the results at xdest,ydest in the widget in which this function is called. NOTE: The widget must be realized before this function can be used
GTK1.Widget drag_dest_set(int flags, array targets, int actions)
Register a drop site, and possibly add default behaviors. arguments: flags: Which types of default drag behavior to use (one of DEST_DEFAULT_ALL, DEST_DEFAULT_DROP, DEST_DEFAULT_HIGHLIGHT and DEST_DEFAULT_MOTION) targets: Table of targets that can be accepted ({ ({ content_type(string), flags(int(try 0)), id(int) }), ...}) The id will be received in the signal handlers. actions: one of GDK_ACTION_ASK, GDK_ACTION_COPY, GDK_ACTION_DEFAULT, GDK_ACTION_LINK, GDK_ACTION_MOVE and GDK_ACTION_PRIVATE results:
GTK1.Widget drag_dest_unset()
Removes the drop support from this widget (see drag_dest_set)
GTK1.Widget drag_get_data(GDK1.DragContext ctx, int time)
Get the data from a context and an integer timestamp (from an event), requesting it from the dropping client. This function should probably never be used directly.
Use the selection argument passed to the drag_data_received signal instead.
GTK1.Widget drag_highlight()
Highlight the widget. Not normaly used directly.
GTK1.Widget drag_source_set(int flags, array targets, int actions)
Register a drop site, and possibly add default behaviors. arguments: buttons: Which mouse buttons can be used to start the drag targets: Table of targets that can be accepted ({ ({ content_type(string), flags(int(try 0)), id(int) }), ...}) The id will be received in the signal handlers. actions: one of GDK_ACTION_ASK, GDK_ACTION_COPY, GDK_ACTION_DEFAULT, GDK_ACTION_LINK, GDK_ACTION_MOVE and GDK_ACTION_PRIVATE results:
GTK1.Widget drag_source_set_icon(GDK1.Pixmap pm, GDK1.Bitmap mask)
Set the icon that will be used (by default) for drags from this widget.
GTK1.Widget drag_source_unset()
Remove the drag support from this widget. See drag_source_set.
GTK1.Widget drag_unhighlight()
Unhighlight the widget. Not normaly used directly.
GTK1.Widget ensure_style()
Ensure that the widget has a style associated with it.
string get_composite_name()
Like set name, but it is inherited by the children of this widget.
int get_events()
Return the current event mask (see set_events and add_events)
int get_extension_events()
Returns one of GDK_EXTENSION_EVENTS_ALL, GDK_EXTENSION_EVENTS_CURSOR and GDK_EXTENSION_EVENTS_NONE
GDK1.Window get_gdkwindow()
Return the GDK1.Window associated with this widget, if any.
string get_name()
Returns the name set by set_name or the class name
GTK1.Widget get_parent()
Returns the parent of this widget, if any, if there is no parent 0 is returned.
GTK1.Style get_style()
Return the style associated with this widget
GTK1.Widget get_toplevel()
return the toplevel widget this widget is inside (or this widget if it is the toplevel widget)
GTK1.Widget grab_default()
Make this widget the default action for the parent widget
GTK1.Widget grab_focus()
Grab the focus.
int has_set_flags(int mask)
All possible flags are: GTK1.AppPaintable, GTK1.CanDefault, GTK1.CanFocus, GTK1.CompositeChild, GTK1.HasDefault, GTK1.HasFocus, GTK1.HasGrab, GTK1.Mapped, GTK1.NoReparent, GTK1.NoWindow, GTK1.ParentSensitive, GTK1.RcStyle, GTK1.Realized, GTK1.ReceivesDefault GTK1.Sensitive, GTK1.Toplevel and GTK1.Visible.
GTK1.Widget hide()
Hide this widget
GTK1.Widget hide_all()
Hide this widget and all its children
inherit GTK1.Object : Object
int intersect(GDK1.Rectangle area, GDK1.Rectangle intersection)
Do an intersection with the area and place the result in 'intersection'.
int is_ancestor(GTK1.Widget of)
Returns true if the specified widget is an ancestor of this widget.
GTK1.Widget lock_accelerators()
Make it impossible to add new accelerators, or remove old ones
GTK1.Widget map()
Map the widget. Should normally not be called directly.
string path()
Returns the 'pathname' of this widget. Useful for rc-files and such.
GTK1.Widget popup(int xpos, int ypos)
Map the widget at the specified coordinates.
GTK1.Widget queue_clear()
Force a clear (and subsequent redraw) of the widget
GTK1.Widget queue_clear_area(int x, int y, int width, int height)
Force a clear (and subsequent redraw) of part of the widget
GTK1.Widget queue_draw()
Force a redraw of the widget
GTK1.Widget queue_draw_area(int x, int y, int width, int height)
Force a redraw of part of the widget
GTK1.Widget queue_resize()
Force a allocation recalculation, followed by a redraw
GTK1.Widget realize()
Realize this widget, and its children, if nessesary
GTK1.Widget remove_accelerator(GTK1.AccelGroup group, int key, int modifiers)
Remove an accelerator (keyboard shortcut).
The modifiers is a bitwise or of one or more of GDK1.ShiftMask, GDK1.LockMask, GDK1.ControlMask, GDK_MOD1_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK, GDK_MOD4_MASK and GDK_MOD5_MASK.
The group is the accelerator group in which the accelerator should be added.
The key is the unicode code for the key to bind.
GTK1.Widget reparent(GTK1.Widget to)
Change the parent of the widget.
GTK1.Widget reset_rc_styles()
Reset all styles to their default value, recursively
GTK1.Widget restore_default_style()
Reset all styles to their default value
GTK1.Widget selection_add_target(GDK1.Atom|void selection, GDK1.Atom|void target, int|void info)
Supplying the selection is a bit more complicated than requesting it. You must register handlers that will be called when your selection is requested. For each selection/target pair you will handle, you make a call to this function.
selection, and target identify the requests this handler will manage. When a request for a selection is received, the "selection_get" signal will be called. info can be used as an enumerator to identify the specific target within the callback function.
Selection defaults to PRIMARY, and target defaults to STRING.
GTK1.Widget selection_owner_set(GDK1.Atom|void selection, int|void time)
When prompted by the user, you claim ownership of the selection by calling this function.
If another application claims ownership of the selection, you will receive a "selection_clear_event".
The selection defaults to the PRIMARY selection, and the time to GDK1.CurrentTime.
int selecton_convert(GDK1.Atom|void selection, GDK1.Atom|void target, int|void time)
Retrieving the selection is an asynchronous process. To start the process, you call this function.
This converts the selection into the form specified by target. If at all possible, the time field should be the time from the event that triggered the selection. This helps make sure that events occur in the order that the user requested them. However, if it is not available (for instance, if the conversion was triggered by a "clicked" signal), then you can omit it altogether. This will cause it to be set to GDK1.CurrentTime.
When the selection owner responds to the request, a "selection_received" signal is sent to your application. The handler for this signal receives a pointer to a GTK1.SelectionData object.
The special target TARGETS generates a list of all valid targets.
Selection defaults to PRIMARY, and target defaults to STRING.
GTK1.Widget set_app_paintable(int paintablep)
Make it possible to draw directly in the widget using the low-level drawing functions.
GTK1.Widget set_background(GDK1.Color background)
Set the background color or image. The argument is either a GDK1.Pixmap or a GDK1.Color object. NOTE: The widget must be realized before this function can be used
GTK1.Widget set_bitmap_cursor(GDK1.Bitmap source, GDK1.Bitmap mask, GDK1.Color fg, GDK1.Color bg, int xhot, int yhot)
xhot and yhot are the locations of the x and y hotspot relative to the upper left corner of the cursor image. Both the bitmaps and the colors must be specified.
GTK1.Widget set_composite_name(string name)
Like set name, but it is inherited by the children of this widget.
GTK1.Widget set_cursor(int|void cursor_type, GDK1.Color fg, GDK1.Color bg)
Change the widget cursor. If no arguments are passed, restore the default cursor. Both fg and bg must be specified if either one is. <table border="0" cellpadding="3" cellspacing="0"> CURS(GDK1.Arrow) CURS(GDK1.BasedArrowDown) CURS(GDK1.BasedArrowUp) CURS(GDK1.Boat) CURS(GDK1.Bogosity) CURS(GDK1.BottomLeftCorner) CURS(GDK1.BottomRightCorner) CURS(GDK1.BottomSide) CURS(GDK1.BottomTee) CURS(GDK1.BoxSpiral) CURS(GDK1.CenterPtr) CURS(GDK1.Circle) CURS(GDK1.Clock) CURS(GDK1.CoffeeMug) CURS(GDK1.Cross) CURS(GDK1.CrossReverse) CURS(GDK1.Crosshair) CURS(GDK1.DiamondCross) CURS(GDK1.Dot) CURS(GDK1.Dotbox) CURS(GDK1.DoubleArrow) CURS(GDK1.DraftLarge) CURS(GDK1.DraftSmall) CURS(GDK1.DrapedBox) CURS(GDK1.Exchange) CURS(GDK1.Fleur) CURS(GDK1.Gobbler) CURS(GDK1.Gumby) CURS(GDK1.Hand1) CURS(GDK1.Hand2) CURS(GDK1.Heart) CURS(GDK1.Icon) CURS(GDK1.IronCross) CURS(GDK1.LeftPtr) CURS(GDK1.LeftSide) CURS(GDK1.LeftTee) CURS(GDK1.Leftbutton) CURS(GDK1.LlAngle) CURS(GDK1.LrAngle) CURS(GDK1.Man) CURS(GDK1.Middlebutton) CURS(GDK1.Mouse) CURS(GDK1.Pencil) CURS(GDK1.Pirate) CURS(GDK1.Plus) CURS(GDK1.QuestionArrow) CURS(GDK1.RightPtr) CURS(GDK1.RightSide) CURS(GDK1.RightTee) CURS(GDK1.Rightbutton) CURS(GDK1.RtlLogo) CURS(GDK1.Sailboat) CURS(GDK1.SbDownArrow) CURS(GDK1.SbHDoubleArrow) CURS(GDK1.SbLeftArrow) CURS(GDK1.SbRightArrow) CURS(GDK1.SbUpArrow) CURS(GDK1.SbVDoubleArrow) CURS(GDK1.Shuttle) CURS(GDK1.Sizing) CURS(GDK1.Spider) CURS(GDK1.Spraycan) CURS(GDK1.Star) CURS(GDK1.Target) CURS(GDK1.Tcross) CURS(GDK1.TopLeftArrow) CURS(GDK1.TopLeftCorner) CURS(GDK1.TopRightCorner) CURS(GDK1.TopSide) CURS(GDK1.TopTee) CURS(GDK1.Trek) CURS(GDK1.UlAngle) CURS(GDK1.Umbrella) CURS(GDK1.UrAngle) CURS(GDK1.Watch) CURS(GDK1.Xterm) </table>
GTK1.Widget set_events(int events)
Events is one or more of: GDK1.ExposureMask, GDK1.PointerMotionMask, GDK1.PointerMotion_HINTMask, GDK1.ButtonMotionMask, GDK1.Button1MotionMask, GDK1.Button2MotionMask, GDK1.Button3MotionMask, GDK1.ButtonPressMask, GDK1.ButtonReleaseMask, GDK1.KeyPressMask, GDK1.KeyReleaseMask, GDK1.EnterNotifyMask, GDK1.LeaveNotifyMask, GDK1.FocusChangeMask, GDK1.StructureMask, GDK1.PropertyChangeMask, GDK1.VisibilityNotifyMask, GDK1.ProximityInMask, GDK1.ProximityOutMask and GDK1.AllEventsMask
GTK1.Widget set_extension_events(int events)
Events is one of GDK_EXTENSION_EVENTS_ALL, GDK_EXTENSION_EVENTS_CURSOR and GDK_EXTENSION_EVENTS_NONE
GTK1.Widget set_flags(int flags)
The flags that it makes sense to set are: GTK1.CanFocus and GTK1.CanDefault
GTK1.Widget set_name(string name)
Set the name of the widget. The name is used when the rc-file is parsed, you can also parse your own resources by calling GTK1.parse_rc() with a resource string. Example: TODO
GTK1.Widget set_rc_style()
Set the style from the .rc files
int set_scroll_adjustments(GTK1.Adjustment hadjustment, GTK1.Adjustment vadjustment)
Set the scrolling (panning) adjustment objects for this widget. Returns 1 if it is possible to do so, and 0 otherwise.
GTK1.Widget set_sensitive(int sensitivep)
True (1) or false (0). If true, the widget can receive events, otherwise the user cannot interact with the widget. Most widgets are drawn 'greyed' or more dim when they are unsensitive.
GTK1.Widget set_state(int state)
One of STATE_ACTIVE, STATE_INSENSITIVE, STATE_NORMAL, STATE_PRELIGHT and STATE_SELECTED. This function should normaly not be used directly.
GTK1.Widget set_style(GTK1.Style cf)
Set the style to be associated with this widget
GTK1.Widget set_uposition(int xpos, int ypos)
Set the absolute coordinates of the widget relative to its parent.
GTK1.Widget set_usize(int xsize, int ysize)
Set the absolute size of the widget. It might resize itself anyway, but this size is used as is in most widgets. Beware of this function, it might produce unexpected results. 0 for any size means 'keep old size'. When setting sizes of wtoplevel windows, it is preferable to use set_default_size
GTK1.Widget shape_combine_mask(GDK1.Bitmap shape, int xoffset, int yoffset)
Set the shape of the widget, or, rather, its window, to that of
the supplied bitmap. Notice how the window behind the example
window can be seen because of the rather odd shape the example window has.
GTK1.Window( GTK1.WINDOW_TOPLEVEL )->add(GTK1.Label("A rather Oddly shaped\n" "Window\n" "Indeed\n" "Or what do you\nthink?\n" "This text\n" "should\n" "be long enough"))->shape_combine_mask( GDK1.Bitmap(Image.Image(100,100,255,255,255)->rotate(10,0,0,0) ), 20,20)
NOTE: The widget must be realized before this function can be used
GTK1.Widget show()
Show the widget. Most (almost all) widgets must be shown to be visible on the screen.
GTK1.Widget show_all()
Show this widget and all its children
GTK1.Widget show_now()
Show this widget and do not return until it is visible.
int text_width(string text)
Returns the width, in pixels, the string would have if it was written with the default font in the style object assosiated with the widget.
GTK1.Widget unlock_accelerators()
Make it possible to add new accelerators, and remove old ones, again. Use this after lock_accelerators()
GTK1.Widget unmap()
Unmap the widget. Should normally not be called directly.
GTK1.Widget unparent()
Remove this widget from its parent
GTK1.Widget unrealize()
Unrealize this widget, and its children, if nessesary
GTK1.Widget unset_flags(int flags)
The flags that it makes sense to unset are: GTK1.CanFocus and GTK1.CanDefault
int xoffset()
Returns the x position of the upper left corner relative to the widgets window in pixels. For widgets that have their own window this will most likely be 0.
int xsize()
Returns the width of the widget in pixels.
int yoffset()
Returns the y position of the upper left corner relative to the widgets window in pixels. For widgets that have their own window this will most likely be 0.
int ysize()
Returns the height of the widget in pixels.
CLASS GTK1.Window |
The basic window. Nothing much to say about it. It can only contain one child widget. Show the main window last to avoid annoying flashes when the subwidget (and it's subwidgets) are added to it, this is done automatically by calling 'window->show_all' when you are done with your widget packing.
Signals: move_resize
set_focus
int activate_default()
Activate the default widget
int activate_focus()
Activate the focus widget
GTK1.Window add_accel_group(GTK1.AccelGroup group)
This function adds an accelerator group to the window. The shortcuts in the table will work in the window, it's child, and all children of it's child that do not select keyboard input.
GTK1.Window add_embedded_xid(int x_window_id)
Add an embedded X-window
GTK1.Window GTK1.Window(int window_type)
Argument is one of WINDOW_DIALOG, WINDOW_POPUP and WINDOW_TOPLEVEL
int get_allow_grow()
If true, the window can grow if nessesary
int get_allow_shrink()
If true, the window can be shrunk by the user
int get_auto_shrink()
If true, the window will shrink if possible
GTK1.Widget get_default_widget()
The default widget
GTK1.Widget get_focus_widget()
The focus widget
int get_modal()
If true, this is a modal dialog window
string get_title()
The title of the window
GTK1.Window get_transient_parent()
The parent window for this window if this is a transient window, 0 otherwise.
int get_type()
The window type, one of WINDOW_DIALOG, WINDOW_POPUP and WINDOW_TOPLEVEL
string get_wmclass_class()
The window manager class of this application.
string get_wmclass_name()
The window manager name of this application.
inherit GTK1.Bin : Bin
GTK1.Window lower()
Lower this window if the window manager allows that.
GTK1.Window raise()
Raise this window if the window manager allows that.
GTK1.Window remove_accel_group(GTK1.AccelGroup table)
Remove a previously installed table.
GTK1.Window remove_embedded_xid(int x_window_id)
Remove the embeded X window
GTK1.Window set_default(GTK1.Widget default_widget)
Set the default widget to the specified widget. The specified widget must have the GTK1.CanDefault flag set.
GTK1.Window set_default_size(int width, int height)
The following differs from set_usize, in that set_usize() overrides the requisition, and thus sets a minimum size, while this only sets the size requested from the WM.
GTK1.Window set_focus(GTK1.Widget child)
Set the focus widget to the specified child. Please note that this is normaly handled automatically.
GTK1.Window set_icon(GDK1.Pixmap p, GDK1.Bitmap b, GDK1.Window w)
Set the icon to the specified image (with mask) or the specified GDK1.Window. It is up to the window manager to display the icon. Most window manager handles window and pixmap icons, but only a few can handle the mask argument. If you want a shaped icon, the only safe bet is a shaped window.
GTK1.Window set_icon_name(string name)
Set the icon name to the specified string.
GTK1.Window set_modal(int modalp)
/ Is this a modal dialog?
GTK1.Window set_policy(int allow_shrink, int allow_grow, int auto_shrink)
If allow shrink is true, the user can resize the window to a smaller size. If allow_grow is true, the window can resize itself, and the user can resize the window, to a bigger size. It auto shrink is true, the window will resize itself to a smaller size when it's subwidget is resized.
GTK1.Window set_position(int pos)
one of WINDOW_DIALOG, WINDOW_POPUP, WINDOW_TOPLEVEL, WIN_POS_CENTER, WIN_POS_MOUSE and WIN_POS_NONE
GTK1.Window set_title(string title)
Set the window title. The default title is the value sent to setup_gtk, or if none is sent, Pike GTK1.
GTK1.Window set_transient_for(GTK1.Window parent)
Mark this window as a transient window for the parent window. Most window managers renders transient windows differently (different borders, sometimes no resize widgets etc)
Useful for short lived dialogs.
GTK1.Window set_wmclass(string name, string class)
Set the window manager application name and class.
Module GTK2 |
constant GTK2.ACCEL_LOCKED
constant GTK2.ACCEL_MASK
constant GTK2.ACCEL_VISIBLE
constant GTK2.ANCHOR_CENTER
constant GTK2.ANCHOR_E
constant GTK2.ANCHOR_EAST
constant GTK2.ANCHOR_N
constant GTK2.ANCHOR_NE
constant GTK2.ANCHOR_NORTH
constant GTK2.ANCHOR_NORTH_EAST
constant GTK2.ANCHOR_NORTH_WEST
constant GTK2.ANCHOR_NW
constant GTK2.ANCHOR_S
constant GTK2.ANCHOR_SE
constant GTK2.ANCHOR_SOUTH
constant GTK2.ANCHOR_SOUTH_EAST
constant GTK2.ANCHOR_SOUTH_WEST
constant GTK2.ANCHOR_SW
constant GTK2.ANCHOR_W
constant GTK2.ANCHOR_WEST
constant GTK2.APP_PAINTABLE
constant GTK2.ARROW_DOWN
constant GTK2.ARROW_LEFT
constant GTK2.ARROW_RIGHT
constant GTK2.ARROW_UP
constant GTK2.ASSISTANT_PAGE_CONFIRM
constant GTK2.ASSISTANT_PAGE_CONTENT
constant GTK2.ASSISTANT_PAGE_INTRO
constant GTK2.ASSISTANT_PAGE_PROGRESS
constant GTK2.ASSISTANT_PAGE_SUMMARY
constant GTK2.BUTTONBOX_DEFAULT_STYLE
constant GTK2.BUTTONBOX_EDGE
constant GTK2.BUTTONBOX_END
constant GTK2.BUTTONBOX_SPREAD
constant GTK2.BUTTONBOX_START
constant GTK2.BUTTONS_CANCEL
constant GTK2.BUTTONS_CLOSE
constant GTK2.BUTTONS_NONE
constant GTK2.BUTTONS_OK
constant GTK2.BUTTONS_OK_CANCEL
constant GTK2.BUTTONS_YES_NO
constant GTK2.CALENDAR_NO_MONTH_CHANGE
constant GTK2.CALENDAR_SHOW_DAY_NAMES
constant GTK2.CALENDAR_SHOW_HEADING
constant GTK2.CALENDAR_SHOW_WEEK_NUMBERS
constant GTK2.CALENDAR_WEEK_START_MONDAY
constant GTK2.CAN_DEFAULT
constant GTK2.CAN_FOCUS
constant GTK2.CELL_RENDERER_ACCEL_MODE_GTK
constant GTK2.CELL_RENDERER_ACCEL_MODE_OTHER
constant GTK2.CELL_RENDERER_FOCUSED
constant GTK2.CELL_RENDERER_INSENSITIVE
constant GTK2.CELL_RENDERER_MODE_ACTIVATABLE
constant GTK2.CELL_RENDERER_MODE_EDITABLE
constant GTK2.CELL_RENDERER_MODE_INERT
constant GTK2.CELL_RENDERER_PRELIT
constant GTK2.CELL_RENDERER_SELECTED
constant GTK2.CELL_RENDERER_SORTED
constant GTK2.CENTIMETERS
constant GTK2.COMPOSITE_CHILD
constant GTK2.CORNER_BOTTOM_LEFT
constant GTK2.CORNER_BOTTOM_RIGHT
constant GTK2.CORNER_TOP_LEFT
constant GTK2.CORNER_TOP_RIGHT
constant GTK2.CURVE_TYPE_FREE
constant GTK2.CURVE_TYPE_LINEAR
constant GTK2.CURVE_TYPE_SPLINE
constant GTK2.DATABOX_BARS
constant GTK2.DATABOX_CROSS_SIMPLE
constant GTK2.DATABOX_GRID
constant GTK2.DATABOX_LINES
constant GTK2.DATABOX_NOT_DISPLAYED
constant GTK2.DATABOX_POINTS
constant GTK2.DELETE_CHARS
constant GTK2.DELETE_DISPLAY_LINES
constant GTK2.DELETE_DISPLAY_LINE_ENDS
constant GTK2.DELETE_PARAGRAPHS
constant GTK2.DELETE_PARAGRAPH_ENDS
constant GTK2.DELETE_WHITESPACE
constant GTK2.DELETE_WORDS
constant GTK2.DELETE_WORD_ENDS
constant GTK2.DEST_DEFAULT_ALL
constant GTK2.DEST_DEFAULT_DROP
constant GTK2.DEST_DEFAULT_HIGHLIGHT
constant GTK2.DEST_DEFAULT_MOTION
constant GTK2.DIALOG_DESTROY_WITH_PARENT
constant GTK2.DIALOG_MODAL
constant GTK2.DIALOG_NO_SEPARATOR
constant GTK2.DIR_DOWN
constant GTK2.DIR_LEFT
constant GTK2.DIR_RIGHT
constant GTK2.DIR_TAB_BACKWARD
constant GTK2.DIR_TAB_FORWARD
constant GTK2.DIR_UP
constant GTK2.DOUBLE_BUFFERED
constant GTK2.ENTRY_ICON_PRIMARY
constant GTK2.ENTRY_ICON_SECONDARY
constant GTK2.EXPAND
constant GTK2.EXPANDER_COLLAPSED
constant GTK2.EXPANDER_EXPANDED
constant GTK2.EXPANDER_SEMI_COLLAPSED
constant GTK2.EXPANDER_SEMI_EXPANDED
constant GTK2.FALSE
constant GTK2.FILE_CHOOSER_ACTION_CREATE_FOLDER
constant GTK2.FILE_CHOOSER_ACTION_OPEN
constant GTK2.FILE_CHOOSER_ACTION_SAVE
constant GTK2.FILE_CHOOSER_ACTION_SELECT_FOLDER
constant GTK2.FILE_CHOOSER_ERROR_BAD_FILENAME
constant GTK2.FILE_CHOOSER_ERROR_NONEXISTENT
constant GTK2.FILE_FILTER_DISPLAY_NAME
constant GTK2.FILE_FILTER_FILENAME
constant GTK2.FILE_FILTER_MIME_TYPE
constant GTK2.FILE_FILTER_URI
constant GTK2.FILL
constant GTK2.FLOATING
constant GTK2.GDK_2BUTTON_PRESS
constant GTK2.GDK_3BUTTON_PRESS
constant GTK2.GDK_ACTION_ASK
constant GTK2.GDK_ACTION_COPY
constant GTK2.GDK_ACTION_DEFAULT
constant GTK2.GDK_ACTION_LINK
constant GTK2.GDK_ACTION_MOVE
constant GTK2.GDK_ACTION_PRIVATE
constant GTK2.GDK_ALL_EVENTS_MASK
constant GTK2.GDK_AND
constant GTK2.GDK_AND_INVERT
constant GTK2.GDK_AND_REVERSE
constant GTK2.GDK_ARROW
constant GTK2.GDK_AXIS_IGNORE
constant GTK2.GDK_AXIS_LAST
constant GTK2.GDK_AXIS_PRESSURE
constant GTK2.GDK_AXIS_WHEEL
constant GTK2.GDK_AXIS_X
constant GTK2.GDK_AXIS_XTILT
constant GTK2.GDK_AXIS_Y
constant GTK2.GDK_AXIS_YTILT
constant GTK2.GDK_BASED_ARROW_DOWN
constant GTK2.GDK_BASED_ARROW_UP
constant GTK2.GDK_BOAT
constant GTK2.GDK_BOGOSITY
constant GTK2.GDK_BOTTOM_LEFT_CORNER
constant GTK2.GDK_BOTTOM_RIGHT_CORNER
constant GTK2.GDK_BOTTOM_SIDE
constant GTK2.GDK_BOTTOM_TEE
constant GTK2.GDK_BOX_SPIRAL
constant GTK2.GDK_BUTTON1_MASK
constant GTK2.GDK_BUTTON1_MOTION_MASK
constant GTK2.GDK_BUTTON2_MASK
constant GTK2.GDK_BUTTON2_MOTION_MASK
constant GTK2.GDK_BUTTON3_MASK
constant GTK2.GDK_BUTTON3_MOTION_MASK
constant GTK2.GDK_BUTTON4_MASK
constant GTK2.GDK_BUTTON5_MASK
constant GTK2.GDK_BUTTON_MOTION_MASK
constant GTK2.GDK_BUTTON_PRESS
constant GTK2.GDK_BUTTON_PRESS_MASK
constant GTK2.GDK_BUTTON_RELEASE
constant GTK2.GDK_BUTTON_RELEASE_MASK
constant GTK2.GDK_CAP_BUTT
constant GTK2.GDK_CAP_NOT_LAST
constant GTK2.GDK_CAP_PROJECTING
constant GTK2.GDK_CAP_ROUND
constant GTK2.GDK_CENTER_PTR
constant GTK2.GDK_CIRCLE
constant GTK2.GDK_CLEAR
constant GTK2.GDK_CLIENT_EVENT
constant GTK2.GDK_CLIP_BY_CHILDREN
constant GTK2.GDK_CLOCK
constant GTK2.GDK_COFFEE_MUG
constant GTK2.GDK_COLORSPACE_RGB
constant GTK2.GDK_CONFIGURE
constant GTK2.GDK_CONTROL_MASK
constant GTK2.GDK_COPY
constant GTK2.GDK_COPY_INVERT
constant GTK2.GDK_CROSS
constant GTK2.GDK_CROSSHAIR
constant GTK2.GDK_CROSSING_GRAB
constant GTK2.GDK_CROSSING_NORMAL
constant GTK2.GDK_CROSSING_UNGRAB
constant GTK2.GDK_CROSS_REVERSE
constant GTK2.GDK_CURSOR_IS_PIXMAP
constant GTK2.GDK_DECOR_ALL
constant GTK2.GDK_DECOR_BORDER
constant GTK2.GDK_DECOR_MAXIMIZE
constant GTK2.GDK_DECOR_MENU
constant GTK2.GDK_DECOR_MINIMIZE
constant GTK2.GDK_DECOR_RESIZEH
constant GTK2.GDK_DECOR_TITLE
constant GTK2.GDK_DELETE
constant GTK2.GDK_DESTROY
constant GTK2.GDK_DIAMOND_CROSS
constant GTK2.GDK_DOT
constant GTK2.GDK_DOTBOX
constant GTK2.GDK_DOUBLE_ARROW
constant GTK2.GDK_DRAFT_LARGE
constant GTK2.GDK_DRAFT_SMALL
constant GTK2.GDK_DRAG_ENTER
constant GTK2.GDK_DRAG_LEAVE
constant GTK2.GDK_DRAG_MOTION
constant GTK2.GDK_DRAG_PROTO_LOCAL
constant GTK2.GDK_DRAG_PROTO_MOTIF
constant GTK2.GDK_DRAG_PROTO_NONE
constant GTK2.GDK_DRAG_PROTO_OLE2
constant GTK2.GDK_DRAG_PROTO_ROOTWIN
constant GTK2.GDK_DRAG_PROTO_WIN32_DROPFILES
constant GTK2.GDK_DRAG_PROTO_XDND
constant GTK2.GDK_DRAG_STATUS
constant GTK2.GDK_DRAPED_BOX
constant GTK2.GDK_DROP_FINISHED
constant GTK2.GDK_DROP_START
constant GTK2.GDK_ENTER_NOTIFY
constant GTK2.GDK_ENTER_NOTIFY_MASK
constant GTK2.GDK_EQUIV
constant GTK2.GDK_EVEN_ODD_RULE
constant GTK2.GDK_EXCHANGE
constant GTK2.GDK_EXPOSE
constant GTK2.GDK_EXPOSURE_MASK
constant GTK2.GDK_EXTENSION_EVENTS_ALL
constant GTK2.GDK_EXTENSION_EVENTS_CURSOR
constant GTK2.GDK_EXTENSION_EVENTS_NONE
constant GTK2.GDK_FILTER_CONTINUE
constant GTK2.GDK_FILTER_REMOVE
constant GTK2.GDK_FILTER_TRANSLATE
constant GTK2.GDK_FLEUR
constant GTK2.GDK_FOCUS_CHANGE
constant GTK2.GDK_FOCUS_CHANGE_MASK
constant GTK2.GDK_FUNC_ALL
constant GTK2.GDK_FUNC_CLOSE
constant GTK2.GDK_FUNC_MAXIMIZE
constant GTK2.GDK_FUNC_MINIMIZE
constant GTK2.GDK_FUNC_MOVE
constant GTK2.GDK_FUNC_RESIZE
constant GTK2.GDK_GC_BACKGROUND
constant GTK2.GDK_GC_CAP_STYLE
constant GTK2.GDK_GC_CLIP_MASK
constant GTK2.GDK_GC_CLIP_X_ORIGIN
constant GTK2.GDK_GC_CLIP_Y_ORIGIN
constant GTK2.GDK_GC_EXPOSURES
constant GTK2.GDK_GC_FILL
constant GTK2.GDK_GC_FONT
constant GTK2.GDK_GC_FOREGROUND
constant GTK2.GDK_GC_FUNCTION
constant GTK2.GDK_GC_JOIN_STYLE
constant GTK2.GDK_GC_LINE_STYLE
constant GTK2.GDK_GC_LINE_WIDTH
constant GTK2.GDK_GC_STIPPLE
constant GTK2.GDK_GC_SUBWINDOW
constant GTK2.GDK_GC_TILE
constant GTK2.GDK_GC_TS_X_ORIGIN
constant GTK2.GDK_GC_TS_Y_ORIGIN
constant GTK2.GDK_GOBBLER
constant GTK2.GDK_GRAB_ALREADY_GRABBED
constant GTK2.GDK_GRAB_FROZEN
constant GTK2.GDK_GRAB_INVALID_TIME
constant GTK2.GDK_GRAB_NOT_VIEWABLE
constant GTK2.GDK_GRAB_SUCCESS
constant GTK2.GDK_GRAVITY_CENTER
constant GTK2.GDK_GRAVITY_EAST
constant GTK2.GDK_GRAVITY_NORTH
constant GTK2.GDK_GRAVITY_NORTH_EAST
constant GTK2.GDK_GRAVITY_NORTH_WEST
constant GTK2.GDK_GRAVITY_SOUTH
constant GTK2.GDK_GRAVITY_SOUTH_EAST
constant GTK2.GDK_GRAVITY_SOUTH_WEST
constant GTK2.GDK_GRAVITY_STATIC
constant GTK2.GDK_GRAVITY_WEST
constant GTK2.GDK_GUMBY
constant GTK2.GDK_HAND1
constant GTK2.GDK_HAND2
constant GTK2.GDK_HEART
constant GTK2.GDK_HINT_ASPECT
constant GTK2.GDK_HINT_BASE_SIZE
constant GTK2.GDK_HINT_MAX_SIZE
constant GTK2.GDK_HINT_MIN_SIZE
constant GTK2.GDK_HINT_POS
constant GTK2.GDK_HINT_RESIZE_INC
constant GTK2.GDK_HINT_USER_POS
constant GTK2.GDK_HINT_USER_SIZE
constant GTK2.GDK_ICON
constant GTK2.GDK_IMAGE_FASTEST
constant GTK2.GDK_IMAGE_NORMAL
constant GTK2.GDK_IMAGE_SHARED
constant GTK2.GDK_INCLUDE_INFERIORS
constant GTK2.GDK_INPUT_EXCEPTION
constant GTK2.GDK_INPUT_ONLY
constant GTK2.GDK_INPUT_OUTPUT
constant GTK2.GDK_INPUT_READ
constant GTK2.GDK_INPUT_WRITE
constant GTK2.GDK_INTERP_BILINEAR
constant GTK2.GDK_INTERP_HYPER
constant GTK2.GDK_INTERP_NEAREST
constant GTK2.GDK_INTERP_TILES
constant GTK2.GDK_INVERT
constant GTK2.GDK_IRON_CROSS
constant GTK2.GDK_JOIN_BEVEL
constant GTK2.GDK_JOIN_MITER
constant GTK2.GDK_JOIN_ROUND
constant GTK2.GDK_KEY_PRESS
constant GTK2.GDK_KEY_PRESS_MASK
constant GTK2.GDK_KEY_RELEASE
constant GTK2.GDK_KEY_RELEASE_MASK
constant GTK2.GDK_LAST_CURSOR
constant GTK2.GDK_LEAVE_NOTIFY
constant GTK2.GDK_LEAVE_NOTIFY_MASK
constant GTK2.GDK_LEFTBUTTON
constant GTK2.GDK_LEFT_PTR
constant GTK2.GDK_LEFT_SIDE
constant GTK2.GDK_LEFT_TEE
constant GTK2.GDK_LINE_DOUBLE_DASH
constant GTK2.GDK_LINE_ON_OFF_DASH
constant GTK2.GDK_LINE_SOLID
constant GTK2.GDK_LL_ANGLE
constant GTK2.GDK_LOCK_MASK
constant GTK2.GDK_LR_ANGLE
constant GTK2.GDK_LSB_FIRST
constant GTK2.GDK_MAN
constant GTK2.GDK_MAP
constant GTK2.GDK_MIDDLEBUTTON
constant GTK2.GDK_MOD1_MASK
constant GTK2.GDK_MOD2_MASK
constant GTK2.GDK_MOD3_MASK
constant GTK2.GDK_MOD4_MASK
constant GTK2.GDK_MOD5_MASK
constant GTK2.GDK_MODE_DISABLED
constant GTK2.GDK_MODE_SCREEN
constant GTK2.GDK_MODE_WINDOW
constant GTK2.GDK_MODIFIER_MASK
constant GTK2.GDK_MOTION_NOTIFY
constant GTK2.GDK_MOUSE
constant GTK2.GDK_MSB_FIRST
constant GTK2.GDK_NAND
constant GTK2.GDK_NOOP
constant GTK2.GDK_NOR
constant GTK2.GDK_NOTHING
constant GTK2.GDK_NOTIFY_ANCESTOR
constant GTK2.GDK_NOTIFY_INFERIOR
constant GTK2.GDK_NOTIFY_NONLINEAR
constant GTK2.GDK_NOTIFY_NONLINEAR_VIRTUAL
constant GTK2.GDK_NOTIFY_UNKNOWN
constant GTK2.GDK_NOTIFY_VIRTUAL
constant GTK2.GDK_NO_EXPOSE
constant GTK2.GDK_OPAQUE_STIPPLED
constant GTK2.GDK_OR
constant GTK2.GDK_OR_INVERT
constant GTK2.GDK_OR_REVERSE
constant GTK2.GDK_OVERLAP_RECTANGLE_IN
constant GTK2.GDK_OVERLAP_RECTANGLE_OUT
constant GTK2.GDK_OVERLAP_RECTANGLE_PART
constant GTK2.GDK_OWNER_CHANGE
constant GTK2.GDK_OWNER_CHANGE_CLOSE
constant GTK2.GDK_OWNER_CHANGE_DESTROY
constant GTK2.GDK_OWNER_CHANGE_NEW_OWNER
constant GTK2.GDK_PENCIL
constant GTK2.GDK_PIRATE
constant GTK2.GDK_PIXBUF_ALPHA_BILEVEL
constant GTK2.GDK_PIXBUF_ALPHA_FULL
constant GTK2.GDK_PIXBUF_ERROR_BAD_OPTION
constant GTK2.GDK_PIXBUF_ERROR_CORRUPT_IMAGE
constant GTK2.GDK_PIXBUF_ERROR_FAILED
constant GTK2.GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY
constant GTK2.GDK_PIXBUF_ERROR_UNKNOWN_TYPE
constant GTK2.GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION
constant GTK2.GDK_PIXBUF_ROTATE_CLOCKWISE
constant GTK2.GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE
constant GTK2.GDK_PIXBUF_ROTATE_NONE
constant GTK2.GDK_PIXBUF_ROTATE_UPSIDEDOWN
constant GTK2.GDK_PLUS
constant GTK2.GDK_POINTER_MOTION_HINT_MASK
constant GTK2.GDK_POINTER_MOTION_MASK
constant GTK2.GDK_PROPERTY_CHANGE_MASK
constant GTK2.GDK_PROPERTY_DELETE
constant GTK2.GDK_PROPERTY_NEW_VALUE
constant GTK2.GDK_PROPERTY_NOTIFY
constant GTK2.GDK_PROP_MODE_APPEND
constant GTK2.GDK_PROP_MODE_PREPEND
constant GTK2.GDK_PROP_MODE_REPLACE
constant GTK2.GDK_PROXIMITY_IN
constant GTK2.GDK_PROXIMITY_IN_MASK
constant GTK2.GDK_PROXIMITY_OUT
constant GTK2.GDK_PROXIMITY_OUT_MASK
constant GTK2.GDK_QUESTION_ARROW
constant GTK2.GDK_RELEASE_MASK
constant GTK2.GDK_RGB_DITHER_MAX
constant GTK2.GDK_RGB_DITHER_NONE
constant GTK2.GDK_RGB_DITHER_NORMAL
constant GTK2.GDK_RIGHTBUTTON
constant GTK2.GDK_RIGHT_PTR
constant GTK2.GDK_RIGHT_SIDE
constant GTK2.GDK_RIGHT_TEE
constant GTK2.GDK_RTL_LOGO
constant GTK2.GDK_SAILBOAT
constant GTK2.GDK_SB_DOWN_ARROW
constant GTK2.GDK_SB_H_DOUBLE_ARROW
constant GTK2.GDK_SB_LEFT_ARROW
constant GTK2.GDK_SB_RIGHT_ARROW
constant GTK2.GDK_SB_UP_ARROW
constant GTK2.GDK_SB_V_DOUBLE_ARROW
constant GTK2.GDK_SCROLL
constant GTK2.GDK_SCROLL_DOWN
constant GTK2.GDK_SCROLL_LEFT
constant GTK2.GDK_SCROLL_MASK
constant GTK2.GDK_SCROLL_RIGHT
constant GTK2.GDK_SCROLL_UP
constant GTK2.GDK_SELECTION_CLEAR
constant GTK2.GDK_SELECTION_NOTIFY
constant GTK2.GDK_SELECTION_REQUEST
constant GTK2.GDK_SET
constant GTK2.GDK_SETTING
constant GTK2.GDK_SETTING_ACTION_CHANGED
constant GTK2.GDK_SETTING_ACTION_DELETED
constant GTK2.GDK_SETTING_ACTION_NEW
constant GTK2.GDK_SHIFT_MASK
constant GTK2.GDK_SHUTTLE
constant GTK2.GDK_SIZING
constant GTK2.GDK_SOLID
constant GTK2.GDK_SOURCE_CURSOR
constant GTK2.GDK_SOURCE_ERASER
constant GTK2.GDK_SOURCE_MOUSE
constant GTK2.GDK_SOURCE_PEN
constant GTK2.GDK_SPIDER
constant GTK2.GDK_SPRAYCAN
constant GTK2.GDK_STAR
constant GTK2.GDK_STIPPLED
constant GTK2.GDK_STRUCTURE_MASK
constant GTK2.GDK_SUBSTRUCTURE_MASK
constant GTK2.GDK_TARGET
constant GTK2.GDK_TCROSS
constant GTK2.GDK_TILED
constant GTK2.GDK_TOP_LEFT_ARROW
constant GTK2.GDK_TOP_LEFT_CORNER
constant GTK2.GDK_TOP_RIGHT_CORNER
constant GTK2.GDK_TOP_SIDE
constant GTK2.GDK_TOP_TEE
constant GTK2.GDK_TREK
constant GTK2.GDK_UL_ANGLE
constant GTK2.GDK_UMBRELLA
constant GTK2.GDK_UNMAP
constant GTK2.GDK_UR_ANGLE
constant GTK2.GDK_VISIBILITY_FULLY_OBSCURED
constant GTK2.GDK_VISIBILITY_NOTIFY
constant GTK2.GDK_VISIBILITY_NOTIFY_MASK
constant GTK2.GDK_VISIBILITY_PARTIAL
constant GTK2.GDK_VISIBILITY_UNOBSCURED
constant GTK2.GDK_VISUAL_DIRECT_COLOR
constant GTK2.GDK_VISUAL_GRAYSCALE
constant GTK2.GDK_VISUAL_PSEUDO_COLOR
constant GTK2.GDK_VISUAL_STATIC_COLOR
constant GTK2.GDK_VISUAL_STATIC_GRAY
constant GTK2.GDK_VISUAL_TRUE_COLOR
constant GTK2.GDK_WATCH
constant GTK2.GDK_WA_COLORMAP
constant GTK2.GDK_WA_CURSOR
constant GTK2.GDK_WA_NOREDIR
constant GTK2.GDK_WA_TITLE
constant GTK2.GDK_WA_VISUAL
constant GTK2.GDK_WA_WMCLASS
constant GTK2.GDK_WA_X
constant GTK2.GDK_WA_Y
constant GTK2.GDK_WINDING_RULE
constant GTK2.GDK_WINDOW_CHILD
constant GTK2.GDK_WINDOW_DIALOG
constant GTK2.GDK_WINDOW_EDGE_EAST
constant GTK2.GDK_WINDOW_EDGE_NORTH
constant GTK2.GDK_WINDOW_EDGE_NORTH_EAST
constant GTK2.GDK_WINDOW_EDGE_NORTH_WEST
constant GTK2.GDK_WINDOW_EDGE_SOUTH
constant GTK2.GDK_WINDOW_EDGE_SOUTH_EAST
constant GTK2.GDK_WINDOW_EDGE_SOUTH_WEST
constant GTK2.GDK_WINDOW_EDGE_WEST
constant GTK2.GDK_WINDOW_FOREIGN
constant GTK2.GDK_WINDOW_ROOT
constant GTK2.GDK_WINDOW_STATE
constant GTK2.GDK_WINDOW_STATE_ABOVE
constant GTK2.GDK_WINDOW_STATE_BELOW
constant GTK2.GDK_WINDOW_STATE_FULLSCREEN
constant GTK2.GDK_WINDOW_STATE_ICONIFIED
constant GTK2.GDK_WINDOW_STATE_MAXIMIZED
constant GTK2.GDK_WINDOW_STATE_STICKY
constant GTK2.GDK_WINDOW_STATE_WITHDRAWN
constant GTK2.GDK_WINDOW_TEMP
constant GTK2.GDK_WINDOW_TOPLEVEL
constant GTK2.GDK_WINDOW_TYPE_HINT_DESKTOP
constant GTK2.GDK_WINDOW_TYPE_HINT_DIALOG
constant GTK2.GDK_WINDOW_TYPE_HINT_DOCK
constant GTK2.GDK_WINDOW_TYPE_HINT_MENU
constant GTK2.GDK_WINDOW_TYPE_HINT_NORMAL
constant GTK2.GDK_WINDOW_TYPE_HINT_SPLASHSCREEN
constant GTK2.GDK_WINDOW_TYPE_HINT_TOOLBAR
constant GTK2.GDK_WINDOW_TYPE_HINT_UTILITY
constant GTK2.GDK_XOR
constant GTK2.GDK_XTERM
constant GTK2.GDK_X_CURSOR
constant GTK2.GNOME_CLIENT_IS_CONNECTED
constant GTK2.GNOME_CLIENT_RESTARTED
constant GTK2.GNOME_CLIENT_RESTORED
constant GTK2.GNOME_DATE_EDIT_24_HR
constant GTK2.GNOME_DATE_EDIT_SHOW_TIME
constant GTK2.GNOME_DATE_EDIT_WEEK_STARTS_ON_MONDAY
constant GTK2.GNOME_DIALOG_ERROR
constant GTK2.GNOME_DIALOG_NORMAL
constant GTK2.GNOME_DOCK_BOTTOM
constant GTK2.GNOME_DOCK_ITEM_BEH_EXCLUSIVE
constant GTK2.GNOME_DOCK_ITEM_BEH_LOCKED
constant GTK2.GNOME_DOCK_ITEM_BEH_NEVER_FLOATING
constant GTK2.GNOME_DOCK_ITEM_BEH_NEVER_HORIZONTAL
constant GTK2.GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL
constant GTK2.GNOME_DOCK_ITEM_BEH_NORMAL
constant GTK2.GNOME_DOCK_LEFT
constant GTK2.GNOME_DOCK_RIGHT
constant GTK2.GNOME_DOCK_TOP
constant GTK2.GNOME_EDGE_FINISH
constant GTK2.GNOME_EDGE_LAST
constant GTK2.GNOME_EDGE_OTHER
constant GTK2.GNOME_EDGE_START
constant GTK2.GNOME_FONT_PICKER_MODE_FONT_INFO
constant GTK2.GNOME_FONT_PICKER_MODE_PIXMAP
constant GTK2.GNOME_FONT_PICKER_MODE_UNKNOWN
constant GTK2.GNOME_FONT_PICKER_MODE_USER_WIDGET
constant GTK2.GNOME_INTERACT_ANY
constant GTK2.GNOME_INTERACT_ERRORS
constant GTK2.GNOME_INTERACT_NONE
constant GTK2.GNOME_PREFERENCES_ALWAYS
constant GTK2.GNOME_PREFERENCES_NEVER
constant GTK2.GNOME_PREFERENCES_USER
constant GTK2.GNOME_RESTART_ANYWAY
constant GTK2.GNOME_RESTART_IF_RUNNING
constant GTK2.GNOME_RESTART_IMMEDIATELY
constant GTK2.GNOME_RESTART_NEVER
constant GTK2.GNOME_SAVE_BOTH
constant GTK2.GNOME_SAVE_GLOBAL
constant GTK2.GNOME_SAVE_LOCAL
constant GTK2.GNOME_STOCK_BUTTON_APPLY
constant GTK2.GNOME_STOCK_BUTTON_CANCEL
constant GTK2.GNOME_STOCK_BUTTON_CLOSE
constant GTK2.GNOME_STOCK_BUTTON_DOWN
constant GTK2.GNOME_STOCK_BUTTON_FONT
constant GTK2.GNOME_STOCK_BUTTON_HELP
constant GTK2.GNOME_STOCK_BUTTON_NEXT
constant GTK2.GNOME_STOCK_BUTTON_NO
constant GTK2.GNOME_STOCK_BUTTON_OK
constant GTK2.GNOME_STOCK_BUTTON_PREV
constant GTK2.GNOME_STOCK_BUTTON_UP
constant GTK2.GNOME_STOCK_BUTTON_YES
constant GTK2.GNOME_STOCK_MENU_ABOUT
constant GTK2.GNOME_STOCK_MENU_ALIGN_CENTER
constant GTK2.GNOME_STOCK_MENU_ALIGN_JUSTIFY
constant GTK2.GNOME_STOCK_MENU_ALIGN_LEFT
constant GTK2.GNOME_STOCK_MENU_ALIGN_RIGHT
constant GTK2.GNOME_STOCK_MENU_ATTACH
constant GTK2.GNOME_STOCK_MENU_BACK
constant GTK2.GNOME_STOCK_MENU_BLANK
constant GTK2.GNOME_STOCK_MENU_BOOK_BLUE
constant GTK2.GNOME_STOCK_MENU_BOOK_GREEN
constant GTK2.GNOME_STOCK_MENU_BOOK_OPEN
constant GTK2.GNOME_STOCK_MENU_BOOK_RED
constant GTK2.GNOME_STOCK_MENU_BOOK_YELLOW
constant GTK2.GNOME_STOCK_MENU_BOTTOM
constant GTK2.GNOME_STOCK_MENU_CDROM
constant GTK2.GNOME_STOCK_MENU_CLOSE
constant GTK2.GNOME_STOCK_MENU_CONVERT
constant GTK2.GNOME_STOCK_MENU_COPY
constant GTK2.GNOME_STOCK_MENU_CUT
constant GTK2.GNOME_STOCK_MENU_DOWN
constant GTK2.GNOME_STOCK_MENU_EXEC
constant GTK2.GNOME_STOCK_MENU_EXIT
constant GTK2.GNOME_STOCK_MENU_FIRST
constant GTK2.GNOME_STOCK_MENU_FONT
constant GTK2.GNOME_STOCK_MENU_FORWARD
constant GTK2.GNOME_STOCK_MENU_HOME
constant GTK2.GNOME_STOCK_MENU_INDEX
constant GTK2.GNOME_STOCK_MENU_JUMP_TO
constant GTK2.GNOME_STOCK_MENU_LAST
constant GTK2.GNOME_STOCK_MENU_LINE_IN
constant GTK2.GNOME_STOCK_MENU_MAIL
constant GTK2.GNOME_STOCK_MENU_MAIL_FWD
constant GTK2.GNOME_STOCK_MENU_MAIL_NEW
constant GTK2.GNOME_STOCK_MENU_MAIL_RCV
constant GTK2.GNOME_STOCK_MENU_MAIL_RPL
constant GTK2.GNOME_STOCK_MENU_MAIL_SND
constant GTK2.GNOME_STOCK_MENU_MIC
constant GTK2.GNOME_STOCK_MENU_MIDI
constant GTK2.GNOME_STOCK_MENU_NEW
constant GTK2.GNOME_STOCK_MENU_OPEN
constant GTK2.GNOME_STOCK_MENU_PASTE
constant GTK2.GNOME_STOCK_MENU_PREF
constant GTK2.GNOME_STOCK_MENU_PRINT
constant GTK2.GNOME_STOCK_MENU_PROP
constant GTK2.GNOME_STOCK_MENU_QUIT
constant GTK2.GNOME_STOCK_MENU_REDO
constant GTK2.GNOME_STOCK_MENU_REFRESH
constant GTK2.GNOME_STOCK_MENU_REVERT
constant GTK2.GNOME_STOCK_MENU_SAVE
constant GTK2.GNOME_STOCK_MENU_SAVE_AS
constant GTK2.GNOME_STOCK_MENU_SCORES
constant GTK2.GNOME_STOCK_MENU_SEARCH
constant GTK2.GNOME_STOCK_MENU_SPELLCHECK
constant GTK2.GNOME_STOCK_MENU_SRCHRPL
constant GTK2.GNOME_STOCK_MENU_STOP
constant GTK2.GNOME_STOCK_MENU_TEXT_BOLD
constant GTK2.GNOME_STOCK_MENU_TEXT_ITALIC
constant GTK2.GNOME_STOCK_MENU_TEXT_STRIKEOUT
constant GTK2.GNOME_STOCK_MENU_TEXT_UNDERLINE
constant GTK2.GNOME_STOCK_MENU_TIMER
constant GTK2.GNOME_STOCK_MENU_TIMER_STOP
constant GTK2.GNOME_STOCK_MENU_TOP
constant GTK2.GNOME_STOCK_MENU_TRASH
constant GTK2.GNOME_STOCK_MENU_TRASH_FULL
constant GTK2.GNOME_STOCK_MENU_UNDELETE
constant GTK2.GNOME_STOCK_MENU_UNDO
constant GTK2.GNOME_STOCK_MENU_UP
constant GTK2.GNOME_STOCK_MENU_VOLUME
constant GTK2.GNOME_STOCK_PIXMAP_ABOUT
constant GTK2.GNOME_STOCK_PIXMAP_ADD
constant GTK2.GNOME_STOCK_PIXMAP_ALIGN_CENTER
constant GTK2.GNOME_STOCK_PIXMAP_ALIGN_JUSTIFY
constant GTK2.GNOME_STOCK_PIXMAP_ALIGN_LEFT
constant GTK2.GNOME_STOCK_PIXMAP_ALIGN_RIGHT
constant GTK2.GNOME_STOCK_PIXMAP_ATTACH
constant GTK2.GNOME_STOCK_PIXMAP_BACK
constant GTK2.GNOME_STOCK_PIXMAP_BOOK_BLUE
constant GTK2.GNOME_STOCK_PIXMAP_BOOK_GREEN
constant GTK2.GNOME_STOCK_PIXMAP_BOOK_OPEN
constant GTK2.GNOME_STOCK_PIXMAP_BOOK_RED
constant GTK2.GNOME_STOCK_PIXMAP_BOOK_YELLOW
constant GTK2.GNOME_STOCK_PIXMAP_BOTTOM
constant GTK2.GNOME_STOCK_PIXMAP_CDROM
constant GTK2.GNOME_STOCK_PIXMAP_CLEAR
constant GTK2.GNOME_STOCK_PIXMAP_CLOSE
constant GTK2.GNOME_STOCK_PIXMAP_COLORSELECTOR
constant GTK2.GNOME_STOCK_PIXMAP_CONVERT
constant GTK2.GNOME_STOCK_PIXMAP_COPY
constant GTK2.GNOME_STOCK_PIXMAP_CUT
constant GTK2.GNOME_STOCK_PIXMAP_DISABLED
constant GTK2.GNOME_STOCK_PIXMAP_DOWN
constant GTK2.GNOME_STOCK_PIXMAP_EXEC
constant GTK2.GNOME_STOCK_PIXMAP_EXIT
constant GTK2.GNOME_STOCK_PIXMAP_FIRST
constant GTK2.GNOME_STOCK_PIXMAP_FOCUSED
constant GTK2.GNOME_STOCK_PIXMAP_FONT
constant GTK2.GNOME_STOCK_PIXMAP_FORWARD
constant GTK2.GNOME_STOCK_PIXMAP_HELP
constant GTK2.GNOME_STOCK_PIXMAP_HOME
constant GTK2.GNOME_STOCK_PIXMAP_INDEX
constant GTK2.GNOME_STOCK_PIXMAP_JUMP_TO
constant GTK2.GNOME_STOCK_PIXMAP_LAST
constant GTK2.GNOME_STOCK_PIXMAP_LINE_IN
constant GTK2.GNOME_STOCK_PIXMAP_MAIL
constant GTK2.GNOME_STOCK_PIXMAP_MAIL_FWD
constant GTK2.GNOME_STOCK_PIXMAP_MAIL_NEW
constant GTK2.GNOME_STOCK_PIXMAP_MAIL_RCV
constant GTK2.GNOME_STOCK_PIXMAP_MAIL_RPL
constant GTK2.GNOME_STOCK_PIXMAP_MAIL_SND
constant GTK2.GNOME_STOCK_PIXMAP_MIC
constant GTK2.GNOME_STOCK_PIXMAP_MIDI
constant GTK2.GNOME_STOCK_PIXMAP_MULTIPLE
constant GTK2.GNOME_STOCK_PIXMAP_NEW
constant GTK2.GNOME_STOCK_PIXMAP_NOT
constant GTK2.GNOME_STOCK_PIXMAP_OPEN
constant GTK2.GNOME_STOCK_PIXMAP_PASTE
constant GTK2.GNOME_STOCK_PIXMAP_PREFERENCES
constant GTK2.GNOME_STOCK_PIXMAP_PRINT
constant GTK2.GNOME_STOCK_PIXMAP_PROPERTIES
constant GTK2.GNOME_STOCK_PIXMAP_QUIT
constant GTK2.GNOME_STOCK_PIXMAP_REDO
constant GTK2.GNOME_STOCK_PIXMAP_REFRESH
constant GTK2.GNOME_STOCK_PIXMAP_REGULAR
constant GTK2.GNOME_STOCK_PIXMAP_REMOVE
constant GTK2.GNOME_STOCK_PIXMAP_REVERT
constant GTK2.GNOME_STOCK_PIXMAP_SAVE
constant GTK2.GNOME_STOCK_PIXMAP_SAVE_AS
constant GTK2.GNOME_STOCK_PIXMAP_SCORES
constant GTK2.GNOME_STOCK_PIXMAP_SEARCH
constant GTK2.GNOME_STOCK_PIXMAP_SPELLCHECK
constant GTK2.GNOME_STOCK_PIXMAP_SRCHRPL
constant GTK2.GNOME_STOCK_PIXMAP_STOP
constant GTK2.GNOME_STOCK_PIXMAP_TABLE_BORDERS
constant GTK2.GNOME_STOCK_PIXMAP_TABLE_FILL
constant GTK2.GNOME_STOCK_PIXMAP_TEXT_BOLD
constant GTK2.GNOME_STOCK_PIXMAP_TEXT_BULLETED_LIST
constant GTK2.GNOME_STOCK_PIXMAP_TEXT_INDENT
constant GTK2.GNOME_STOCK_PIXMAP_TEXT_ITALIC
constant GTK2.GNOME_STOCK_PIXMAP_TEXT_NUMBERED_LIST
constant GTK2.GNOME_STOCK_PIXMAP_TEXT_STRIKEOUT
constant GTK2.GNOME_STOCK_PIXMAP_TEXT_UNDERLINE
constant GTK2.GNOME_STOCK_PIXMAP_TEXT_UNINDENT
constant GTK2.GNOME_STOCK_PIXMAP_TIMER
constant GTK2.GNOME_STOCK_PIXMAP_TIMER_STOP
constant GTK2.GNOME_STOCK_PIXMAP_TOP
constant GTK2.GNOME_STOCK_PIXMAP_TRASH
constant GTK2.GNOME_STOCK_PIXMAP_TRASH_FULL
constant GTK2.GNOME_STOCK_PIXMAP_TYPE_DATA
constant GTK2.GNOME_STOCK_PIXMAP_TYPE_FILE
constant GTK2.GNOME_STOCK_PIXMAP_TYPE_GPIXMAP
constant GTK2.GNOME_STOCK_PIXMAP_TYPE_IMLIB
constant GTK2.GNOME_STOCK_PIXMAP_TYPE_IMLIB_SCALED
constant GTK2.GNOME_STOCK_PIXMAP_TYPE_NONE
constant GTK2.GNOME_STOCK_PIXMAP_TYPE_PATH
constant GTK2.GNOME_STOCK_PIXMAP_TYPE_WIDGET
constant GTK2.GNOME_STOCK_PIXMAP_UNDELETE
constant GTK2.GNOME_STOCK_PIXMAP_UNDO
constant GTK2.GNOME_STOCK_PIXMAP_UP
constant GTK2.GNOME_STOCK_PIXMAP_VOLUME
constant GTK2.HAS_DEFAULT
constant GTK2.HAS_FOCUS
constant GTK2.HAS_GRAB
constant GTK2.ICON_LOOKUP_FORCE_SVG
constant GTK2.ICON_LOOKUP_NO_SVG
constant GTK2.ICON_LOOKUP_USE_BUILTIN
constant GTK2.ICON_SIZE_BUTTON
constant GTK2.ICON_SIZE_DIALOG
constant GTK2.ICON_SIZE_DND
constant GTK2.ICON_SIZE_INVALID
constant GTK2.ICON_SIZE_LARGE_TOOLBAR
constant GTK2.ICON_SIZE_MENU
constant GTK2.ICON_SIZE_SMALL_TOOLBAR
constant GTK2.ICON_THEME_FAILED
constant GTK2.ICON_THEME_NOT_FOUND
constant GTK2.IMAGE_ANIMATION
constant GTK2.IMAGE_EMPTY
constant GTK2.IMAGE_ICON_NAME
constant GTK2.IMAGE_ICON_SET
constant GTK2.IMAGE_IMAGE
constant GTK2.IMAGE_PIXBUF
constant GTK2.IMAGE_PIXMAP
constant GTK2.IMAGE_STOCK
constant GTK2.IM_PREEDIT_CALLBACK
constant GTK2.IM_PREEDIT_NONE
constant GTK2.IM_PREEDIT_NOTHING
constant GTK2.IM_STATUS_CALLBACK
constant GTK2.IM_STATUS_NONE
constant GTK2.IM_STATUS_NOTHING
constant GTK2.INCHES
constant GTK2.IN_DESTRUCTION
constant GTK2.JUSTIFY_CENTER
constant GTK2.JUSTIFY_FILL
constant GTK2.JUSTIFY_LEFT
constant GTK2.JUSTIFY_RIGHT
constant GTK2.MAJOR_VERSION
constant GTK2.MAPPED
constant GTK2.MENU_DIR_CHILD
constant GTK2.MENU_DIR_NEXT
constant GTK2.MENU_DIR_PARENT
constant GTK2.MENU_DIR_PREV
constant GTK2.MESSAGE_ERROR
constant GTK2.MESSAGE_INFO
constant GTK2.MESSAGE_QUESTION
constant GTK2.MESSAGE_WARNING
constant GTK2.MICRO_VERSION
constant GTK2.MINOR_VERSION
constant GTK2.MOVEMENT_BUFFER_ENDS
constant GTK2.MOVEMENT_DISPLAY_LINES
constant GTK2.MOVEMENT_DISPLAY_LINE_ENDS
constant GTK2.MOVEMENT_HORIZONTAL_PAGES
constant GTK2.MOVEMENT_LOGICAL_POSITIONS
constant GTK2.MOVEMENT_PAGES
constant GTK2.MOVEMENT_PARAGRAPHS
constant GTK2.MOVEMENT_PARAGRAPH_ENDS
constant GTK2.MOVEMENT_VISUAL_POSITIONS
constant GTK2.MOVEMENT_WORDS
constant GTK2.NO_REPARENT
constant GTK2.NO_SHOW_ALL
constant GTK2.NO_WINDOW
constant GTK2.ORIENTATION_HORIZONTAL
constant GTK2.ORIENTATION_VERTICAL
constant GTK2.PACK_DIRECTION_BTT
constant GTK2.PACK_DIRECTION_LTR
constant GTK2.PACK_DIRECTION_RTL
constant GTK2.PACK_DIRECTION_TTB
constant GTK2.PACK_END
constant GTK2.PACK_START
constant GTK2.PAGE_ORIENTATION_LANDSCAPE
constant GTK2.PAGE_ORIENTATION_PORTRAIT
constant GTK2.PAGE_ORIENTATION_REVERSE_LANDSCAPE
constant GTK2.PAGE_ORIENTATION_REVERSE_PORTRAIT
constant GTK2.PAGE_SET_ALL
constant GTK2.PAGE_SET_EVEN
constant GTK2.PAGE_SET_ODD
constant GTK2.PANGO_ALIGN_CENTER
constant GTK2.PANGO_ALIGN_LEFT
constant GTK2.PANGO_ALIGN_RIGHT
constant GTK2.PANGO_ATTR_BACKGROUND
constant GTK2.PANGO_ATTR_FALLBACK
constant GTK2.PANGO_ATTR_FAMILY
constant GTK2.PANGO_ATTR_FONT_DESC
constant GTK2.PANGO_ATTR_FOREGROUND
constant GTK2.PANGO_ATTR_INVALID
constant GTK2.PANGO_ATTR_LANGUAGE
constant GTK2.PANGO_ATTR_LETTER_SPACING
constant GTK2.PANGO_ATTR_RISE
constant GTK2.PANGO_ATTR_SCALE
constant GTK2.PANGO_ATTR_SHAPE
constant GTK2.PANGO_ATTR_SIZE
constant GTK2.PANGO_ATTR_STRETCH
constant GTK2.PANGO_ATTR_STRIKETHROUGH
constant GTK2.PANGO_ATTR_STYLE
constant GTK2.PANGO_ATTR_UNDERLINE
constant GTK2.PANGO_ATTR_VARIANT
constant GTK2.PANGO_ATTR_WEIGHT
constant GTK2.PANGO_ELLIPSIZE_END
constant GTK2.PANGO_ELLIPSIZE_MIDDLE
constant GTK2.PANGO_ELLIPSIZE_NONE
constant GTK2.PANGO_ELLIPSIZE_START
constant GTK2.PANGO_FONT_MASK_FAMILY
constant GTK2.PANGO_FONT_MASK_SIZE
constant GTK2.PANGO_FONT_MASK_STRETCH
constant GTK2.PANGO_FONT_MASK_STYLE
constant GTK2.PANGO_FONT_MASK_VARIANT
constant GTK2.PANGO_FONT_MASK_WEIGHT
constant GTK2.PANGO_SCALE
constant GTK2.PANGO_SCALE_LARGE
constant GTK2.PANGO_SCALE_MEDIUM
constant GTK2.PANGO_SCALE_SMALL
constant GTK2.PANGO_SCALE_XX_LARGE
constant GTK2.PANGO_SCALE_XX_SMALL
constant GTK2.PANGO_SCALE_X_LARGE
constant GTK2.PANGO_SCALE_X_SMALL
constant GTK2.PANGO_STRETCH_CONDENSED
constant GTK2.PANGO_STRETCH_EXPANDED
constant GTK2.PANGO_STRETCH_EXTRA_CONDENSED
constant GTK2.PANGO_STRETCH_EXTRA_EXPANDED
constant GTK2.PANGO_STRETCH_NORMAL
constant GTK2.PANGO_STRETCH_SEMI_CONDENSED
constant GTK2.PANGO_STRETCH_SEMI_EXPANDED
constant GTK2.PANGO_STRETCH_ULTRA_CONDENSED
constant GTK2.PANGO_STRETCH_ULTRA_EXPANDED
constant GTK2.PANGO_STYLE_ITALIC
constant GTK2.PANGO_STYLE_NORMAL
constant GTK2.PANGO_STYLE_OBLIQUE
constant GTK2.PANGO_TAB_LEFT
constant GTK2.PANGO_UNDERLINE_DOUBLE
constant GTK2.PANGO_UNDERLINE_ERROR
constant GTK2.PANGO_UNDERLINE_LOW
constant GTK2.PANGO_UNDERLINE_NONE
constant GTK2.PANGO_UNDERLINE_SINGLE
constant GTK2.PANGO_VARIANT_NORMAL
constant GTK2.PANGO_VARIANT_SMALL_CAPS
constant GTK2.PANGO_WEIGHT_BOLD
constant GTK2.PANGO_WEIGHT_HEAVY
constant GTK2.PANGO_WEIGHT_LIGHT
constant GTK2.PANGO_WEIGHT_NORMAL
constant GTK2.PANGO_WEIGHT_ULTRABOLD
constant GTK2.PANGO_WEIGHT_ULTRALIGHT
constant GTK2.PANGO_WRAP_CHAR
constant GTK2.PANGO_WRAP_WORD
constant GTK2.PANGO_WRAP_WORD_CHAR
constant GTK2.PARENT_SENSITIVE
constant GTK2.PATH_CLASS
constant GTK2.PATH_PRIO_APPLICATION
constant GTK2.PATH_PRIO_GTK
constant GTK2.PATH_PRIO_HIGHEST
constant GTK2.PATH_PRIO_LOWEST
constant GTK2.PATH_PRIO_RC
constant GTK2.PATH_PRIO_THEME
constant GTK2.PATH_WIDGET
constant GTK2.PATH_WIDGET_CLASS
constant GTK2.PIXELS
constant GTK2.POLICY_ALWAYS
constant GTK2.POLICY_AUTOMATIC
constant GTK2.POLICY_NEVER
constant GTK2.POS_BOTTOM
constant GTK2.POS_LEFT
constant GTK2.POS_RIGHT
constant GTK2.POS_TOP
constant GTK2.PRINT_DUPLEX_HORIZONTAL
constant GTK2.PRINT_DUPLEX_SIMPLEX
constant GTK2.PRINT_DUPLEX_VERTICAL
constant GTK2.PRINT_ERROR_GENERAL
constant GTK2.PRINT_ERROR_INTERNAL_ERROR
constant GTK2.PRINT_ERROR_NOMEM
constant GTK2.PRINT_OPERATION_ACTION_EXPORT
constant GTK2.PRINT_OPERATION_ACTION_PREVIEW
constant GTK2.PRINT_OPERATION_ACTION_PRINT
constant GTK2.PRINT_OPERATION_ACTION_PRINT_DIALOG
constant GTK2.PRINT_OPERATION_RESULT_APPLY
constant GTK2.PRINT_OPERATION_RESULT_CANCEL
constant GTK2.PRINT_OPERATION_RESULT_ERROR
constant GTK2.PRINT_OPERATION_RESULT_IN_PROGRESS
constant GTK2.PRINT_PAGES_ALL
constant GTK2.PRINT_PAGES_CURRENT
constant GTK2.PRINT_PAGES_RANGES
constant GTK2.PRINT_QUALITY_DRAFT
constant GTK2.PRINT_QUALITY_HIGH
constant GTK2.PRINT_QUALITY_LOW
constant GTK2.PRINT_QUALITY_NORMAL
constant GTK2.PRINT_SETTINGS_COLLATE
constant GTK2.PRINT_SETTINGS_DEFAULT_SOURCE
constant GTK2.PRINT_SETTINGS_DITHER
constant GTK2.PRINT_SETTINGS_DUPLEX
constant GTK2.PRINT_SETTINGS_FINISHINGS
constant GTK2.PRINT_SETTINGS_MEDIA_TYPE
constant GTK2.PRINT_SETTINGS_NUMBER_UP
constant GTK2.PRINT_SETTINGS_N_COPIES
constant GTK2.PRINT_SETTINGS_ORIENTATION
constant GTK2.PRINT_SETTINGS_OUTPUT_BIN
constant GTK2.PRINT_SETTINGS_OUTPUT_FILE_FORMAT
constant GTK2.PRINT_SETTINGS_OUTPUT_URI
constant GTK2.PRINT_SETTINGS_PAGE_RANGES
constant GTK2.PRINT_SETTINGS_PAGE_SET
constant GTK2.PRINT_SETTINGS_PAPER_FORMAT
constant GTK2.PRINT_SETTINGS_PAPER_HEIGHT
constant GTK2.PRINT_SETTINGS_PAPER_WIDTH
constant GTK2.PRINT_SETTINGS_PRINT_PAGES
constant GTK2.PRINT_SETTINGS_QUALITY
constant GTK2.PRINT_SETTINGS_RESOLUTION
constant GTK2.PRINT_SETTINGS_REVERSE
constant GTK2.PRINT_SETTINGS_SCALE
constant GTK2.PRINT_SETTINGS_USE_COLOR
constant GTK2.PRINT_SETTINGS_WIN32_DRIVER_EXTRA
constant GTK2.PRINT_SETTINGS_WIN32_DRIVER_VERSION
constant GTK2.PRINT_STATUS_FINISHED
constant GTK2.PRINT_STATUS_FINISHED_ABORTED
constant GTK2.PRINT_STATUS_GENERATING_DATA
constant GTK2.PRINT_STATUS_INITIAL
constant GTK2.PRINT_STATUS_PENDING
constant GTK2.PRINT_STATUS_PENDING_ISSUE
constant GTK2.PRINT_STATUS_PREPARING
constant GTK2.PRINT_STATUS_PRINTING
constant GTK2.PRINT_STATUS_SENDING_DATA
constant GTK2.PROGRESS_BOTTOM_TO_TOP
constant GTK2.PROGRESS_CONTINUOUS
constant GTK2.PROGRESS_DISCRETE
constant GTK2.PROGRESS_LEFT_TO_RIGHT
constant GTK2.PROGRESS_RIGHT_TO_LEFT
constant GTK2.PROGRESS_TOP_TO_BOTTOM
constant GTK2.RC_BASE
constant GTK2.RC_BG
constant GTK2.RC_FG
constant GTK2.RC_STYLE
constant GTK2.RC_TEXT
constant GTK2.RC_TOKEN_ACTIVE
constant GTK2.RC_TOKEN_APPLICATION
constant GTK2.RC_TOKEN_BASE
constant GTK2.RC_TOKEN_BG
constant GTK2.RC_TOKEN_BG_PIXMAP
constant GTK2.RC_TOKEN_BIND
constant GTK2.RC_TOKEN_BINDING
constant GTK2.RC_TOKEN_CLASS
constant GTK2.RC_TOKEN_ENGINE
constant GTK2.RC_TOKEN_FG
constant GTK2.RC_TOKEN_FONT
constant GTK2.RC_TOKEN_FONTSET
constant GTK2.RC_TOKEN_FONT_NAME
constant GTK2.RC_TOKEN_GTK
constant GTK2.RC_TOKEN_HIGHEST
constant GTK2.RC_TOKEN_IM_MODULE_FILE
constant GTK2.RC_TOKEN_IM_MODULE_PATH
constant GTK2.RC_TOKEN_INCLUDE
constant GTK2.RC_TOKEN_INSENSITIVE
constant GTK2.RC_TOKEN_INVALID
constant GTK2.RC_TOKEN_LAST
constant GTK2.RC_TOKEN_LOWEST
constant GTK2.RC_TOKEN_LTR
constant GTK2.RC_TOKEN_MODULE_PATH
constant GTK2.RC_TOKEN_NORMAL
constant GTK2.RC_TOKEN_PIXMAP_PATH
constant GTK2.RC_TOKEN_PRELIGHT
constant GTK2.RC_TOKEN_RC
constant GTK2.RC_TOKEN_RTL
constant GTK2.RC_TOKEN_SELECTED
constant GTK2.RC_TOKEN_STOCK
constant GTK2.RC_TOKEN_STYLE
constant GTK2.RC_TOKEN_TEXT
constant GTK2.RC_TOKEN_THEME
constant GTK2.RC_TOKEN_WIDGET
constant GTK2.RC_TOKEN_WIDGET_CLASS
constant GTK2.RC_TOKEN_XTHICKNESS
constant GTK2.RC_TOKEN_YTHICKNESS
constant GTK2.REALIZED
constant GTK2.RECEIVES_DEFAULT
constant GTK2.RECENT_CHOOSER_ERROR_INVALID_URI
constant GTK2.RECENT_CHOOSER_ERROR_NOT_FOUND
constant GTK2.RECENT_FILTER_AGE
constant GTK2.RECENT_FILTER_APPLICATION
constant GTK2.RECENT_FILTER_DISPLAY_NAME
constant GTK2.RECENT_FILTER_GROUP
constant GTK2.RECENT_FILTER_MIME_TYPE
constant GTK2.RECENT_FILTER_URI
constant GTK2.RECENT_MANAGER_ERROR_INVALID_ENCODING
constant GTK2.RECENT_MANAGER_ERROR_INVALID_URI
constant GTK2.RECENT_MANAGER_ERROR_NOT_FOUND
constant GTK2.RECENT_MANAGER_ERROR_NOT_REGISTERED
constant GTK2.RECENT_MANAGER_ERROR_READ
constant GTK2.RECENT_MANAGER_ERROR_UNKNOWN
constant GTK2.RECENT_MANAGER_ERROR_WRITE
constant GTK2.RECENT_SORT_CUSTOM
constant GTK2.RECENT_SORT_LRU
constant GTK2.RECENT_SORT_MRU
constant GTK2.RECENT_SORT_NONE
constant GTK2.RELIEF_HALF
constant GTK2.RELIEF_NONE
constant GTK2.RELIEF_NORMAL
constant GTK2.RESERVED_1
constant GTK2.RESERVED_2
constant GTK2.RESIZE_IMMEDIATE
constant GTK2.RESIZE_PARENT
constant GTK2.RESIZE_QUEUE
constant GTK2.RESPONSE_ACCEPT
constant GTK2.RESPONSE_APPLY
constant GTK2.RESPONSE_CANCEL
constant GTK2.RESPONSE_CLOSE
constant GTK2.RESPONSE_DELETE_EVENT
constant GTK2.RESPONSE_HELP
constant GTK2.RESPONSE_NO
constant GTK2.RESPONSE_NONE
constant GTK2.RESPONSE_OK
constant GTK2.RESPONSE_REJECT
constant GTK2.RESPONSE_YES
constant GTK2.SCROLL_END
constant GTK2.SCROLL_ENDS
constant GTK2.SCROLL_HORIZONTAL_ENDS
constant GTK2.SCROLL_HORIZONTAL_PAGES
constant GTK2.SCROLL_HORIZONTAL_STEPS
constant GTK2.SCROLL_JUMP
constant GTK2.SCROLL_NONE
constant GTK2.SCROLL_PAGES
constant GTK2.SCROLL_PAGE_BACKWARD
constant GTK2.SCROLL_PAGE_DOWN
constant GTK2.SCROLL_PAGE_FORWARD
constant GTK2.SCROLL_PAGE_LEFT
constant GTK2.SCROLL_PAGE_RIGHT
constant GTK2.SCROLL_PAGE_UP
constant GTK2.SCROLL_START
constant GTK2.SCROLL_STEPS
constant GTK2.SCROLL_STEP_BACKWARD
constant GTK2.SCROLL_STEP_DOWN
constant GTK2.SCROLL_STEP_FORWARD
constant GTK2.SCROLL_STEP_LEFT
constant GTK2.SCROLL_STEP_RIGHT
constant GTK2.SCROLL_STEP_UP
constant GTK2.SELECTION_BROWSE
constant GTK2.SELECTION_MULTIPLE
constant GTK2.SELECTION_NONE
constant GTK2.SELECTION_SINGLE
constant GTK2.SENSITIVE
constant GTK2.SENSITIVITY_AUTO
constant GTK2.SENSITIVITY_OFF
constant GTK2.SENSITIVITY_ON
constant GTK2.SHADOW_ETCHED_IN
constant GTK2.SHADOW_ETCHED_OUT
constant GTK2.SHADOW_IN
constant GTK2.SHADOW_NONE
constant GTK2.SHADOW_OUT
constant GTK2.SHRINK
constant GTK2.SIZE_GROUP_BOTH
constant GTK2.SIZE_GROUP_HORIZONTAL
constant GTK2.SIZE_GROUP_NONE
constant GTK2.SIZE_GROUP_VERTICAL
constant GTK2.SORT_ASCENDING
constant GTK2.SORT_DESCENDING
constant GTK2.SOURCE_SEARCH_CASE_INSENSITIVE
constant GTK2.SOURCE_SEARCH_TEXT_ONLY
constant GTK2.SOURCE_SEARCH_VISIBLE_ONLY
constant GTK2.SPIN_END
constant GTK2.SPIN_HOME
constant GTK2.SPIN_PAGE_BACKWARD
constant GTK2.SPIN_PAGE_FORWARD
constant GTK2.SPIN_STEP_BACKWARD
constant GTK2.SPIN_STEP_FORWARD
constant GTK2.SPIN_USER_DEFINED
constant GTK2.STATE_ACTIVE
constant GTK2.STATE_INSENSITIVE
constant GTK2.STATE_NORMAL
constant GTK2.STATE_PRELIGHT
constant GTK2.STATE_SELECTED
constant GTK2.STOCK_ABOUT
constant GTK2.STOCK_ADD
constant GTK2.STOCK_APPLY
constant GTK2.STOCK_BOLD
constant GTK2.STOCK_CANCEL
constant GTK2.STOCK_CDROM
constant GTK2.STOCK_CLEAR
constant GTK2.STOCK_CLOSE
constant GTK2.STOCK_COLOR_PICKER
constant GTK2.STOCK_CONNECT
constant GTK2.STOCK_CONVERT
constant GTK2.STOCK_COPY
constant GTK2.STOCK_CUT
constant GTK2.STOCK_DELETE
constant GTK2.STOCK_DIALOG_AUTHENTICATION
constant GTK2.STOCK_DIALOG_ERROR
constant GTK2.STOCK_DIALOG_INFO
constant GTK2.STOCK_DIALOG_QUESTION
constant GTK2.STOCK_DIALOG_WARNING
constant GTK2.STOCK_DIRECTORY
constant GTK2.STOCK_DISCONNECT
constant GTK2.STOCK_DND
constant GTK2.STOCK_DND_MULTIPLE
constant GTK2.STOCK_EDIT
constant GTK2.STOCK_EXECUTE
constant GTK2.STOCK_FILE
constant GTK2.STOCK_FIND
constant GTK2.STOCK_FIND_AND_REPLACE
constant GTK2.STOCK_FLOPPY
constant GTK2.STOCK_FULLSCREEN
constant GTK2.STOCK_GOTO_BOTTOM
constant GTK2.STOCK_GOTO_FIRST
constant GTK2.STOCK_GOTO_LAST
constant GTK2.STOCK_GOTO_TOP
constant GTK2.STOCK_GO_BACK
constant GTK2.STOCK_GO_DOWN
constant GTK2.STOCK_GO_FORWARD
constant GTK2.STOCK_GO_UP
constant GTK2.STOCK_HARDDISK
constant GTK2.STOCK_HELP
constant GTK2.STOCK_HOME
constant GTK2.STOCK_INDENT
constant GTK2.STOCK_INDEX
constant GTK2.STOCK_INFO
constant GTK2.STOCK_ITALIC
constant GTK2.STOCK_JUMP_TO
constant GTK2.STOCK_JUSTIFY_CENTER
constant GTK2.STOCK_JUSTIFY_FILL
constant GTK2.STOCK_JUSTIFY_LEFT
constant GTK2.STOCK_JUSTIFY_RIGHT
constant GTK2.STOCK_LEAVE_FULLSCREEN
constant GTK2.STOCK_MEDIA_FORWARD
constant GTK2.STOCK_MEDIA_NEXT
constant GTK2.STOCK_MEDIA_PAUSE
constant GTK2.STOCK_MEDIA_PLAY
constant GTK2.STOCK_MEDIA_PREVIOUS
constant GTK2.STOCK_MEDIA_RECORD
constant GTK2.STOCK_MEDIA_REWIND
constant GTK2.STOCK_MEDIA_STOP
constant GTK2.STOCK_MISSING_IMAGE
constant GTK2.STOCK_NETWORK
constant GTK2.STOCK_NEW
constant GTK2.STOCK_NO
constant GTK2.STOCK_OK
constant GTK2.STOCK_OPEN
constant GTK2.STOCK_PASTE
constant GTK2.STOCK_PREFERENCES
constant GTK2.STOCK_PRINT
constant GTK2.STOCK_PRINT_PREVIEW
constant GTK2.STOCK_PROPERTIES
constant GTK2.STOCK_QUIT
constant GTK2.STOCK_REDO
constant GTK2.STOCK_REFRESH
constant GTK2.STOCK_REMOVE
constant GTK2.STOCK_REVERT_TO_SAVED
constant GTK2.STOCK_SAVE
constant GTK2.STOCK_SAVE_AS
constant GTK2.STOCK_SELECT_COLOR
constant GTK2.STOCK_SELECT_FONT
constant GTK2.STOCK_SORT_ASCENDING
constant GTK2.STOCK_SORT_DESCENDING
constant GTK2.STOCK_SPELL_CHECK
constant GTK2.STOCK_STOP
constant GTK2.STOCK_STRIKETHROUGH
constant GTK2.STOCK_UNDELETE
constant GTK2.STOCK_UNDERLINE
constant GTK2.STOCK_UNDO
constant GTK2.STOCK_UNINDENT
constant GTK2.STOCK_YES
constant GTK2.STOCK_ZOOM_100
constant GTK2.STOCK_ZOOM_FIT
constant GTK2.STOCK_ZOOM_IN
constant GTK2.STOCK_ZOOM_OUT
constant GTK2.TARGET_SAME_APP
constant GTK2.TARGET_SAME_WIDGET
constant GTK2.TEXT_DIR_LTR
constant GTK2.TEXT_DIR_NONE
constant GTK2.TEXT_DIR_RTL
constant GTK2.TEXT_SEARCH_TEXT_ONLY
constant GTK2.TEXT_SEARCH_VISIBLE_ONLY
constant GTK2.TEXT_WINDOW_BOTTOM
constant GTK2.TEXT_WINDOW_LEFT
constant GTK2.TEXT_WINDOW_PRIVATE
constant GTK2.TEXT_WINDOW_RIGHT
constant GTK2.TEXT_WINDOW_TEXT
constant GTK2.TEXT_WINDOW_TOP
constant GTK2.TEXT_WINDOW_WIDGET
constant GTK2.TOOLBAR_BOTH
constant GTK2.TOOLBAR_BOTH_HORIZ
constant GTK2.TOOLBAR_ICONS
constant GTK2.TOOLBAR_SPACE_EMPTY
constant GTK2.TOOLBAR_SPACE_LINE
constant GTK2.TOOLBAR_TEXT
constant GTK2.TOPLEVEL
constant GTK2.TREE_MODEL_ITERS_PERSIST
constant GTK2.TREE_MODEL_LIST_ONLY
constant GTK2.TREE_VIEW_COLUMN_AUTOSIZE
constant GTK2.TREE_VIEW_COLUMN_FIXED
constant GTK2.TREE_VIEW_COLUMN_GROW_ONLY
constant GTK2.TREE_VIEW_DROP_AFTER
constant GTK2.TREE_VIEW_DROP_BEFORE
constant GTK2.TREE_VIEW_DROP_INTO_OR_AFTER
constant GTK2.TREE_VIEW_DROP_INTO_OR_BEFORE
constant GTK2.TREE_VIEW_GRID_LINES_BOTH
constant GTK2.TREE_VIEW_GRID_LINES_HORIZONTAL
constant GTK2.TREE_VIEW_GRID_LINES_NONE
constant GTK2.TREE_VIEW_GRID_LINES_VERTICAL
constant GTK2.TRUE
constant GTK2.UI_MANAGER_ACCELERATOR
constant GTK2.UI_MANAGER_AUTO
constant GTK2.UI_MANAGER_MENU
constant GTK2.UI_MANAGER_MENUBAR
constant GTK2.UI_MANAGER_MENUITEM
constant GTK2.UI_MANAGER_PLACEHOLDER
constant GTK2.UI_MANAGER_POPUP
constant GTK2.UI_MANAGER_SEPARATOR
constant GTK2.UI_MANAGER_TOOLBAR
constant GTK2.UI_MANAGER_TOOLITEM
constant GTK2.UNIT_INCH
constant GTK2.UNIT_MM
constant GTK2.UNIT_PIXEL
constant GTK2.UNIT_POINTS
constant GTK2.UPDATE_ALWAYS
constant GTK2.UPDATE_CONTINUOUS
constant GTK2.UPDATE_DELAYED
constant GTK2.UPDATE_DISCONTINUOUS
constant GTK2.UPDATE_IF_VALID
constant GTK2.VISIBILITY_FULL
constant GTK2.VISIBILITY_NONE
constant GTK2.VISIBILITY_PARTIAL
constant GTK2.VISIBLE
constant GTK2.WIDGET_HELP_TOOLTIP
constant GTK2.WIDGET_HELP_WHATS_THIS
constant GTK2.WINDOW_POPUP
constant GTK2.WINDOW_TOPLEVEL
constant GTK2.WIN_POS_CENTER
constant GTK2.WIN_POS_CENTER_ALWAYS
constant GTK2.WIN_POS_CENTER_ON_PARENT
constant GTK2.WIN_POS_MOUSE
constant GTK2.WIN_POS_NONE
constant GTK2.WRAP_CHAR
constant GTK2.WRAP_NONE
constant GTK2.WRAP_WORD
constant GTK2.WRAP_WORD_CHAR
void add_builtin_icon(string name, int size, GTK2.GdkPixbuf pixbuf)
Registers a built-in icon for icon theme lookups. The idea of build-in icons is to allow an application or library that uses themed icons to function requiring files to be present in the file system. For instance, the default images for all of GTK2+'s stock icons are registered as built-in icons.
In general, if you use add_builtin_icon() you should also install the icon in the icon theme, so that the icon is generally available.
int false()
Always returns false.
void flush()
Flush GDK. Not normally needed, can be useful while doing calculations.
array get_default_icon_list()
Gets the value set by set_default_icon_list().
GTK2.IconTheme get_default_icon_theme()
Gets the icon theme.
mapping get_file_info(string filename)
Parses an image file far enough to determine its format and size.
array get_formats()
Get information about the image formats supported.
array gnome_init(string app_id, string app_version, array argv)
Initializes the application. This sets up all of the GNOME internals and prepares them (gdk/gtk, session-management, triggers, sound, user preferences). If corba init flags are specified, corba initialization is done as well as gnome initialization. corba_init_flags is 0 or more of GNORBA_INIT_SERVER_FUNC (1), GNORBA_INIT_DISABLE_COOKIES (2) and GNORBA_INIT_CORBA_PRIO_HIGH (4)
void grab_add(GTK2.Widget widget)
Grab a widget.
void grab_remove(GTK2.Widget widget)
Remove the grab.
array gtk_init(array|void argc, int|void no_pgtkrc)
Low level GTK init function (used by setup_gtk). This function is more or less equivalent to the C-GTK+ function gtk_init. setup_gtk does some extra things (such as parsing ~/.pgtkrc).
array list_toplevels()
Returns a list of all existing toplevel windows.
void low_flush()
Flush, but do not process events. Not normally needed.
void main()
Start GTK in blocking mode. Doing this disables asynchronous I/O in pike. You can return -1 from main in pike to run GTK (and the rest of pike) in asynchronous mode.
int main_iteration_do(int block)
Run one iteration in the mainloop. If block is true, wait for an event before returning.
int main_level()
Return the current recursion depth.
void main_quit()
Exit from the gtk_main function on the next iteration.
void move_cursor(int dx, int dy)
Move the mouse-cursor dx,dy pixels, relative to it's current position. This will generate a normal motion event.
Note that this is a low-level X11 function, and thus only works when GDK uses X11.
void move_cursor_abs(GTK2.GdkWindow w, int dx, int dy)
Move the mouse-cursor to x,y, relative to the upper left corner of the specified window. This will generate a normal motion event.
Note that this is a low-level X11 function, and thus only works when GDK uses X11.
void parse_rc(string rc)
Takes a string and reads it as a gtkrc file.
GTK2.GdkWindow root_window()
Returns the root window of the current display
void saver_disable()
Disable the screensaver. This is a low-level X11 function, and thus only works when GDK uses X11
void saver_enable()
Enable the screensaver again after saver_disable has been called. This is a low-level X11 function, and thus only works when GDK uses X11.
void set_auto_startup_notification(int setting)
By default, after showing the first GTK2.Window for each GDK2.Screen, GTK+ calls GDK2.Screen->notify_startup_complete(). Call this function to disable the automatic startup notification. You might do this if your first window is a splash screen, and you want to delay notification until after your real main window has been shown, for example.
In that example, you would disable startup notification temporarily, show your splash screen, then re-enable it so that showing the main window would automatically result in notification.
void set_default_icon(GTK2.GdkPixbuf pix)
Sets an icon to be used as fallback for windows that haven't had set_icon() called on them.
void set_default_icon_from_file(string filename)
Sets an icon to be used as fallback from a file on disk.
void set_default_icon_list(array list)
Sets an icon list to be used as fallback for windows that haven't had set_icon_list() called on them to set up a window-specific icon list. This function allows you to set up the icon for all windows in your app at once.
void set_default_icon_name(string name)
Sets an icon to be used as fallback for windows that haven't had set_icon_list() called on them from a named themed icon.
array setup_gtk(array|void argv, int|void do_not_parse_rc)
Initialize GTK, and all that comes with it. Also parses $HOME/.pgtkrc and $HOME/.gtkrc if they exists. The single argument, if supplied, is the argument array passed to the program. This is used to set default window titles etc. The second argument, if supplied, indicates that pike specific *rc files should not be parsed.
The most common usage is GTK2.setup_gtk(argv);
int true()
Always returns true.
array version()
Returns the version of the GTK library.
CLASS GTK2.AboutDialog |
Properties: array(string) artists array(string) authors string comments string copyright array(string) documenters string license GDK2.Pixbuf logo string logo-icon-name string name string translator-credits string version string website string website-label
Style properties: GDK2.Color link-color
GTK2.AboutDialog GTK2.AboutDialog(mapping|void props)
Create a new GTK2.AboutDialog.
array get_artists()
Returns the strings which are displayed in the artists tab of the secondary credits dialog.
array get_authors()
Returns the strings which are displayed in the authors tab of the secondary credits dialog.
string get_comments()
Returns the comments string.
string get_copyright()
Returns the copyright string.
array get_documenters()
Returns the strings which are displayed in the documenters tab of the secondary credits dialog.
string get_license()
Returns the license information.
GTK2.GdkPixbuf get_logo()
Returns the pixbuf displayed as logo.
string get_logo_icon_name()
Returns the icon name.
string get_program_name()
Returns the program name.
mixed get_property(string property)
Get property.
string get_translator_credits()
Returns the translator credis.
string get_version()
Returns the version string.
string get_website()
Returns the website URL.
string get_website_label()
Returns the label used for the website link.
int get_wrap_license()
Returns whether the license text is automatically wrapped.
inherit GTK2.Dialog : Dialog
GTK2.AboutDialog set_artists(array art)
Sets the strings which are displayed in the artists tab of the secondary credits dialog.
GTK2.AboutDialog set_authors(array auth)
Sets the strings which are displayed in the authors tab of the secondary credits dialog.
GTK2.AboutDialog set_comments(string comments)
Sets the comment string.
GTK2.AboutDialog set_copyright(string copyright)
Sets the copyright string.
GTK2.AboutDialog set_documenters(array doc)
Sets the strings which are displayed in the documenters tab of the secondary credits dialog.
GTK2.AboutDialog set_license(string license)
Sets the license information.
GTK2.AboutDialog set_logo(GTK2.GdkPixbuf logo)
Sets the pixbuf to be displayed as the logo.
GTK2.AboutDialog set_logo_icon_name(string name)
Sets the icon name.
GTK2.AboutDialog set_program_name(string name)
Sets the name to display in the dialog.
GTK2.AboutDialog set_translator_credits(string credits)
Sets the translator credits.
GTK2.AboutDialog set_version(string version)
Sets the version string.
GTK2.AboutDialog set_website(string website)
Sets the URL to use for the website link.
GTK2.AboutDialog set_website_label(string label)
Sets the label used for the website link. Defaults to the website URL.
GTK2.AboutDialog set_wrap_license(int setting)
Sets whether the license text is automatically wrapped.
CLASS GTK2.AccelGroup |
An AccelGroup stores keybindings. A group is automatically created by W(MenuFactory)
NOIMG
Signals: accel_activate
accel_changed
GTK2.AccelGroup connect(int accel_key, int accel_mods, int accel_flags, function(:void) cb, mixed user_data)
Installs an accelerator in this group.
GTK2.AccelGroup connect_by_path(string accel_path, function(:void) cb, mixed user_data)
Installs an accelerator in this group, using an accelerator path to look up the appropriate key and modifiers.
GTK2.AccelGroup GTK2.AccelGroup()
Create a new accelerator group
GTK2.AccelGroup disconnect(int accel_key, int accel_mods)
Removes an accelerator previously installed.
inherit G.Object : Object
GTK2.AccelGroup lock()
Locks the group.
GTK2.AccelGroup unlock()
Undoes the last call to lock().
CLASS GTK2.AccelLabel |
A label for accelerators. Properties: GTK2.Widget accel-widget
GTK2.AccelLabel GTK2.AccelLabel(string|mapping text_or_props)
Creates a new W(AccelLabel).
GTK2.Widget get_accel_widget()
Fetches the widget monitored by this accelerator label.
int get_accel_width()
Returns the width needed to display the accelerator key(s). This is used by menus to align all of the W(MenuItem).
inherit GTK2.Label : Label
int refetch()
Recreates the string representing the accelerator keys. This should not be needed since the string is automatically updated whenever accelerators are added or removed from the associated widget.
GTK2.AccelLabel set_accel_widget(GTK2.Widget accel_widget)
Sets the widget to be monitored.
CLASS GTK2.Action |
Properties: GTK2.ActionGroup action-group int hide-if-empty int is-important string label string name int sensitive string short-label string stock-id string tooltip int visible int visible-horizontal int visible-overflown int visible-vertical
Signals: activate
GTK2.Action activate()
Emits the "activate" signal, if it isn't insensitive.
GTK2.Action block_activate_from(GTK2.Widget proxy)
Disables calls to the activate() function by signals on the proxy. This is used to break notification loops for things like check or radio actions.
GTK2.Action connect_accelerator()
Installs the accelerator if this action widget has an accel path and group.
GTK2.Action connect_proxy(GTK2.Widget proxy)
Connects a widget to an action object as a proxy. Synchronises various properties of the action with the widget (such as label text, icon, tooltip, etc), and attaches a callback so that the action gets activated when the proxy widget does.
GTK2.Action GTK2.Action(string|mapping name_or_props, string|void label, string|void tooltip, string|void stock_id)
Creates a new object.
GTK2.Widget create_icon(int icon_size)
This function is intended for use by action implementations to create icons displayed in the proxy widgets. One of ICON_SIZE_BUTTON, ICON_SIZE_DIALOG, ICON_SIZE_DND, ICON_SIZE_INVALID, ICON_SIZE_LARGE_TOOLBAR, ICON_SIZE_MENU and ICON_SIZE_SMALL_TOOLBAR.
GTK2.Widget create_menu()
If this action provides a W(Menu) widget as a submenu for the menu item or the toolbar item it creates, this function returns an instance of that menu.
GTK2.Widget create_menu_item()
Creates a menu item widget that proxies for the action.
GTK2.Widget create_tool_item()
Creates a toolbar item widget that proxies for the action.
GTK2.Action disconnect_accelerator()
Undoes the effect of one call to connect_accelerator().
GTK2.Action disconnect_proxy(GTK2.Widget proxy)
Disconnects a proxy widget. Does not destroy the widget.
string get_accel_path()
Returns the accel path for this action.
string get_name()
Returns the name of the action.
array get_proxies()
Returns the proxy widgets.
int get_sensitive()
Returns whether the action itself is sensitive. Note that this doesn't necessarily mean effective sensitivity.
int get_visible()
Returns whether the action itself is visible.
inherit G.Object : Object
int is_sensitive()
Returns whether the action is effectively sensitive.
int is_visible()
Returns whether the action is effectively visible.
GTK2.Action set_accel_group(GTK2.AccelGroup group)
Sets the GTK2.AccelGroup in which the accelerator for this action will be installed.
GTK2.Action set_accel_path(string accel_path)
Sets the accel path for this action. All proxy widgets associated with this action will have this accel path, so that their accelerators are consistent.
GTK2.Action set_sensitive(int setting)
Sets the sensitive property.
GTK2.Action set_visible(int setting)
Sets the visible property.
GTK2.Action unblock_activate_from(GTK2.Widget proxy)
Re-enables calls to the activate() function.
CLASS GTK2.ActionGroup |
Actions are organized into groups. An action group is essentially a map from names to GTK2.Action objects.
All actions that would make sense to use in a particular context should be in a single group. Multiple action groups may be used for a particular user interface. In fact, it is expected that most non-trivial applications will make use of multiple groups. For example, in an application that can edit multiple documents, one group holding global actions (e.g. quit, about, new), and one group per document holding actions that act on that document (eg. save, cut/copy/paste, etc). Each window's menus would be constructed from a combination of two action groups.
Accelerators are handled by the GTK2+ accelerator map. All actions are assigned an accelerator path (which normally has the form <Actions>/group-name/action-name) and a shortcut is associated with this accelerator path. All menuitems and toolitems take on this accelerator path. The GTK2+ accelerator map code makes sure that the correct shortcut is displayed next to the menu item. Properties: string name int sensitive int visible
Signals: connect_proxy
disconnect_proxy
post_activate
pre_activate
GTK2.ActionGroup add_action(GTK2.Action action, string|void accelerator)
Adds an action object to the action group and sets up the accelerator.
If accelerator is omitted, attempts to use the accelerator associated with the stock_id of the action.
Accel paths are set to <Actions>/group-name/action-name.
GTK2.ActionGroup add_actions(array entries)
This is a convenience function to create a number of actions and add them to the action group.
The "activate" signals of the actions are connect to the callbacks and their accel paths are set to <Actions>/group-name/action-name.
Mapping is: ([ "name": string, "stock_id": string, "label": string, "accelerator": string, "tooltip": string, "callback": function(callback) "data": mixed ]);
GTK2.ActionGroup add_radio_actions(array entries, function(:void) cb, mixed user_data)
This is a convenience routine to create a group of radio actions and add them to the action group.
Mapping is: ([ "name": string, "stock_id": string, "label": string, "accelerator": string, "tooltip": string, "value": int ]);
GTK2.ActionGroup add_toggle_actions(array entries)
This is a convenience function to create a number of toggle actions and add them to the action group.
Mapping is: ([ "name": string, "stock_id": string, "label": string, "accelerator": string, "tooltip": string, "callback": function(callback), "data": mixed, "is_active": int ]);
GTK2.ActionGroup GTK2.ActionGroup(string|mapping name_or_props)
Creates a new GTK2.ActionGroup object. The name of the action group is used when associating keybindings with the actions.
GTK2.Action get_action(string name)
Looks up an action in the action group by name.
string get_name()
Gets the name of the action group.
int get_sensitive()
Returns true if the group is sensitive. The constituent actions can only be logically sensitive if they are sensitive and their group is sensitive.
int get_visible()
Returns true if the group is visible. The constituent actions can only be logically visible if they are visible and their group is visible.
inherit G.Object : Object
array list_actions()
Lists the actions in the action group.
GTK2.ActionGroup remove_action(GTK2.Action action)
Removes an action object.
GTK2.ActionGroup set_sensitive(int setting)
Changes the sensitivity.
GTK2.ActionGroup set_visible(int setting)
Changes the visibility.
CLASS GTK2.Activatable |
Activatable widgets can be connected to a GTK.Action and reflects the state of its action. A GTK.Activatable can also provide feedback through its action, as they are responsible for activating their related actions. Properties: GTK2.Action related-action int use-action-apperance
GTK2.Action get_related_action()
Gets the related action
int get_use_action_appearance()
Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.
GTK2.Activatable set_related_action(GTK2.Action a)
Sets the related action
GTK2.Activatable set_use_action_appearance(int use_apperance)
Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance
CLASS GTK2.Adjustment |
The GTK2.Adjustment object represents a value which has an associated lower and upper bound, together with step and page increments, and a page size. It is used within several GTK2+ widgets, including GtkSpinButton, GtkViewport, and GtkRange (which is a base class for GtkHScrollbar, GtkVScrollbar, GtkHScale, and GtkVScale).
The GtkAdjustment object does not update the value itself. Instead it is left up to the owner of the GtkAdjustment to control the value.
The owner of the GtkAdjustment typically calls the value_changed() and changed() functions after changing the value or its bounds. This results in the emission of the "value_changed" or "changed" signal respectively.
Properties: float lower float page-increment float page-size float step-increment float upper float value
Signals: changed The adjustment changed in some way
value_changed The value changed
GTK2.Adjustment changed()
Emites a "changed" signal.
GTK2.Adjustment clamp_page(float lower, float upper)
Updates the W(Adjustment) value to ensure that the range between lower and upper is in the current page (i.e. between value and value+page_size). If the range is larger than the page size, then only the start of it will be in the current page. A "changed" signal will be emitted if the value is changed.
GTK2.Adjustment GTK2.Adjustment(float|mapping value_or_props, float|void lower, float|void upper, float|void step_increment, float|void page_increment, float|void page_size)
The value argument is the initial value you want to give to the adjustment, usually corresponding to the topmost or leftmost position of an adjustable widget. The lower argument specifies the lowest value which the adjustment can hold. The step_increment argument specifies the "smaller" of the two increments by which the user can change the value, while the page_increment is the "larger" one. The page_size argument usually corresponds somehow to the visible area of a panning widget. The upper argument is used to represent the bottom most or right most coordinate in a panning widget's child. Therefore it is not always the largest number that value can take, since the page_size of such widgets is usually non-zero.
All values are optional, they default to 0.0. For most widgets the unit is pixels.
float get_value()
Gets the current value.
inherit GTK2.Data : Data
GTK2.Adjustment set_value(float to)
Sets the value. The value is clamped to lie between lower and upper.
Note that for adjustments which are used in a W(Scrollbar), the effective range of allowed values goes from lower to upper-page_size.
GTK2.Adjustment value_changed()
Emits a "value-changed" signal.
CLASS GTK2.Alignment |
The W(Alignment) widget controls the alignment and size of its child widget. It has four settings: xscale, yscale, xalign, and yalign.
The scale settings are used to specify how much the child widget should expand to fill the space allocated to the W(Alignment). The values can range from 0 (meaning the child doesn't expand at all) to 1 (meaning the child expands to fill all of the available space).
The align settings are used to place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect.
NOIMG Properties: int bottom-padding int left-padding int right-padding int top-padding float xalign float xscale float yalign float yscale
GTK2.Alignment GTK2.Alignment(float|mapping xalign_or_props, float|void yalign, float|void xscale, float|void yscale)
|
inherit GTK2.Bin : Bin
GTK2.Alignment set(float xalign, float yalign, float xscale, float yscale)
|
GTK2.Alignment set_padding(int padding_top, int padding_bottom, int padding_left, int padding_right)
Sets the padding on the different sides.
CLASS GTK2.Allocation |
inherit GDK2.Rectangle : Rectangle
CLASS GTK2.Arrow |
An arrow pointing in one of four directions. The 'etched' shadow
types does not work.
GTK2.Arrow(GTK2.ARROW_UP, GTK2.SHADOW_OUT)
GTK2.Arrow(GTK2.ARROW_LEFT, GTK2.SHADOW_IN)
GTK2.Arrow(GTK2.ARROW_RIGHT, GTK2.SHADOW_IN)
GTK2.Arrow(GTK2.ARROW_DOWN, GTK2.SHADOW_OUT)
Properties: int arrow-type ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT and ARROW_UP int shadow-type SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK2.Arrow GTK2.Arrow(int|mapping arrow_type_or_props, int|void shadow_type)
First argument is one of ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT and ARROW_UP, second one of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT.
inherit GTK2.Misc : Misc
GTK2.Arrow set(int arrow_type, int shadow_type)
First argument is one of ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT and ARROW_UP, second one of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT.
CLASS GTK2.AspectFrame |
A W(Frame) widget that always maintain a specified ratio between width and height. width/height == ratio
GTK2.AspectFrame("Title",0.5,0.5,0.4,0)->add( GTK2.Label("Wrong aspect"))->set_size_request(200,200)
Properties: int obey-child float ratio float xalign float yalign
GTK2.AspectFrame GTK2.AspectFrame(mapping|string label, float|void xalign, float|void yalign, float|void ratio, int|void obey_child)
Create a new frame. Arguments are label, xalign, yalign, ratio, obey_child xalign is floats between 0 and 1, 0.0 is upper (or leftmost), 1.0 is lower (or rightmost). If 'obey_child' is true, the frame will use the aspect ratio of it's (one and only) child widget instead of 'ratio'.
inherit GTK2.Frame : Frame
GTK2.AspectFrame set(float xalign, float yalign, float ratio, int obey_child)
Set the aspec values. Arguments are xalign, yalign, ratio, obey_child xalign is floats between 0 and 1, 0.0 is upper (or leftmost), 1.0 is lower (or rightmost). If 'obey_child' is true, the frame will use the aspect ratio of it's (one and only) child widget instead of 'ratio'.
CLASS GTK2.Assistant |
Properties:
int complete GDK2.Pixbuf header-image GTK2.AssistantPageType page-type GDK2.Pixbuf sidebar-image string title
Style properties:
int content-padding int header-padding
Signals: apply
cancel
close
prepare A GTK2.Assistant is a widget used to represent a generally complex operation splitted in several steps, guiding the user through its pages and controlling the page flow to collect the necessary data.
GTK2.Assistant add_action_widget(GTK2.Widget child)
Adds a widget to the action area.
int append_page(GTK2.Widget page)
Appends a page to the assistant.
GTK2.Assistant GTK2.Assistant(mapping|void props)
Create a new assistant.
int get_current_page()
Returns the page number of the current page. Returns -1 if there are no pages.
int get_n_pages()
Returns the number of pages.
GTK2.Widget get_nth_page(int page_num)
Returnss the child widget contained in page number page_num.
int get_page_complete(GTK2.Widget page)
Gets whether page is complete.
GTK2.GdkPixbuf get_page_header_image(GTK2.Widget page)
Gets the header image for page.
GTK2.GdkPixbuf get_page_side_image(GTK2.Widget page)
Gets the side image for page.
string get_page_title(GTK2.Widget page)
Gets the title for page.
int get_page_type(GTK2.Widget page)
Gets the page type of page.
inherit GTK2.Window : Window
int insert_page(GTK2.Widget page, int pos)
Inserts a page at a given position. If pos equals -1 it will append the page.
int prepend_page(GTK2.Widget page)
Prepends a page to the assistant.
GTK2.Assistant remove_action_widget(GTK2.Widget child)
Removes a widget from the action area.
GTK2.Assistant set_current_page(int page_num)
Switches the page to page_num.
GTK2.Assistant set_forward_page_func(function(:void) f, mixed data)
Set the forward page function.
GTK2.Assistant set_page_complete(GTK2.Widget page, int complete)
Sets whether page contents are complete. This will make assistant update the buttons state to be able to continue the task.
GTK2.Assistant set_page_header_image(GTK2.Widget page, GTK2.GdkPixbuf pixbuf)
Sets a header image for page. This image is displayed in the header area of the assistant when page is the current page.
GTK2.Assistant set_page_side_image(GTK2.Widget page, GTK2.GdkPixbuf pixbuf)
Sets a side image for page. This image is displayed in the side area of the assistant when page is the current page.
GTK2.Assistant set_page_title(GTK2.Widget page, string title)
Sets a title for page. The title is displayed in the header area of the assistant when page is the current page.
GTK2.Assistant set_page_type(GTK2.Widget page, int type)
Sets the page type for page. The page type determines the page behavior.
GTK2.Assistant update_buttons_state()
Forces the assistant to recompute the buttons state.
GTK+ automatically takes care of this in most situations, e.g. when the user goes to a different page, or when the visibility or completeness of a page changes.
One situation where it can be necessary to call this function is when changing a value on the current page affects the future page flow of the assistant.
CLASS GTK2.Bin |
A container that can only contain one child.
GTK2.Widget get_child()
Return the child.
inherit GTK2.Container : Container
CLASS GTK2.Box |
A box is a container that can contain more than one child. The basic 'Box' class cannot be instantiated, it is a virtual class that only defines some common 'Box' functions shared with all other Box widgets. Properties: int homogeneous int spacing
Child properties: int expand int fill int pack-type int padding int position
int get_homogeneous()
Returns whether the box is homogeneous.
int get_spacing()
Gets the spacing.
inherit GTK2.Container : Container
GTK2.Box pack_end(GTK2.Widget widget, int expandp, int fillp, int padding)
Pack from the right (or bottom) of the box. Arguments are widget, expand, fill, paddingb widget, expand, fill, padding
GTK2.Box pack_end_defaults(GTK2.Widget widget)
The argument is the widget to add.
GTK2.Box pack_start(GTK2.Widget widget, int expandp, int fillp, int padding)
Pack from the left (or top) of the box. Argument are widget, expand, fill, padding pack(widget,1,1,0) is equivalent to 'add' or 'pack_start_defaults'
GTK2.Box pack_start_defaults(GTK2.Widget widget)
The argument is the widget to add. This function is equivalent to 'add'
mapping query_child_packing(GTK2.Widget child)
Return a mapping: ([ "expand":expandp, "fill":fillp, "padding":paddingp, "type":type ])
GTK2.Box reorder_child(GTK2.Widget child, int new_position)
Move widget to pos, pos is an integer, between 0 and sizeof(box->children())-1
GTK2.Box set_child_packing(GTK2.Widget child_widget, int expandp, int fillp, int padding, int pack_type)
widget, expand, fill, padding, pack_type. If exand is true, the widget will be expanded when the box is resized. If 'fill' is true, the widget will be resized to fill up all available space. Padding is the amount of padding to use, and pack_type is one of PACK_DIRECTION_BTT, PACK_DIRECTION_LTR, PACK_DIRECTION_RTL, PACK_DIRECTION_TTB, PACK_END and PACK_START.
You can emulate pack_start and pack_end with add and set_child_packing.
GTK2.Box set_homogeneous(int homogeneousp)
If true, all widgets in the box will get exactly the same amount of space
GTK2.Box set_spacing(int spacing)
This is the amount of spacing (in pixels) inserted beween all widgets
CLASS GTK2.Button |
A container that can only contain one child, and accepts events.
draws a bevelbox around itself.
GTK2.Button("A button")
GTK2.Button("A button\nwith multiple lines\nof text")
GTK2.Button()->add(GTK2.Image(GTK2.GdkImage(0)->set(Image.Image(100,40)->test())))
Properties: int focus-on-click GTK2.Widget image int image-position string label int relief int use-stock int use-underline float xalign float yalign
Style properties: int child-displacement-x int child-displacement-y GTK2.Border default-border GTK2.Border default-outside-border int displace-focus int image-spacing int inner-border
Signals: activate
clicked Called when the button is pressed, and then released
enter Called when the mouse enters the button
leave Called when the mouse leaves the button
pressed Called when the button is pressed
released Called when the button is released
GTK2.Button clicked()
Emulate a 'clicked' event (press followed by release).
GTK2.Button GTK2.Button(string|mapping label_or_props)
If a string is supplied, a W(Label) is created and added to the button.
GTK2.Button enter()
Emulate a 'enter' event.
mapping get_alignment()
Gets the alignment of the child.
int get_focus_on_click()
Returns whether the button grabs focus when it is clicked.
GTK2.Widget get_image()
Gets the widget that is currently set as the image of the button.
int get_image_position()
Gets the position of the image relative to the text inside the button.
string get_label()
Get the text from the label of the button.
int get_relief()
One of RELIEF_HALF, RELIEF_NONE and RELIEF_NORMAL, set with set_relief()
int get_use_stock()
Returns whether the button label is a stock item.
int get_use_underline()
Returns whether an embedded underline in the button indicates a mnemonic.
inherit GTK2.Activatable : Activatable
inherit GTK2.Bin : Bin
GTK2.Button leave()
Emulate a 'leave' event.
GTK2.Button pressed()
Emulate a 'press' event.
GTK2.Button released()
Emulate a 'release' event.
GTK2.Button set_alignment(float xalign, float yalign)
Sets the alignment of the child.
GTK2.Button set_focus_on_click(int focus_on_click)
Sets whether the button will grab focus when it is clicked.
GTK2.Button set_image(GTK2.Widget widget)
Set the image of the button to the given widget. Note that it depends on the gtk-button-images setting whether the image will be displayed or not.
GTK2.Button set_image_position(int position)
Sets the position of the image relative to the text inside the button.
GTK2.Button set_label(string label)
Set the text of the label.
GTK2.Button set_relief(int newstyle)
One of RELIEF_HALF, RELIEF_NONE and RELIEF_NORMAL
GTK2.Button set_use_stock(int use_stock)
If true, the label set on the button is used as a stock id to select the stock item for the button.
GTK2.Button set_use_underline(int use_underline)
If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.
CLASS GTK2.ButtonBox |
More or less equivalent to a normal box, but you can set a few layout schemes that are not available for normal boxes. See the hbox and vbox documentation for examples. Properties: int layout-style
Child properties: int secondary
Style properties: int child-internal-pad-x int child-internal-pad-y int child-min-height int child-min-width
int get_child_secondary(GTK2.Widget child)
Returns whether child should appear in a secondary group of children.
int get_layout()
Returns the currently configured layout. One of BUTTONBOX_DEFAULT_STYLE, BUTTONBOX_EDGE, BUTTONBOX_END, BUTTONBOX_SPREAD and BUTTONBOX_START
inherit GTK2.Box : Box
GTK2.ButtonBox set_child_secondary(GTK2.Widget child, int is_secondary)
Sets whether child should appear in a secondary group of children.
GTK2.ButtonBox set_layout(int layout)
layout is one of BUTTONBOX_DEFAULT_STYLE, BUTTONBOX_EDGE, BUTTONBOX_END, BUTTONBOX_SPREAD and BUTTONBOX_START
CLASS GTK2.Calendar |
A calendar widget.
GTK2.Calendar();
GTK2.Calendar()->select_day( 16 );
Properties: int day int month int no-month-change int show-day-names int show-heading int show-week-numbers int year
Signals: day_selected
day_selected_double_click
month_changed
next_month
next_year
prev_month
prev_year
GTK2.Calendar clear_marks()
Remove all day markers
GTK2.Calendar GTK2.Calendar(mapping|void props)
Create a new calendar widget
GTK2.Calendar freeze()
Suspend all dynamic updating of the widget
mapping get_date()
returns a mapping: ([ "year":year, "month":month, "day":day ])
int get_display_options()
Returns the current display options.
array get_marked_dates()
Returns an array (with 31 elements) with 1es and 0es.
inherit GTK2.Widget : Widget
GTK2.Calendar mark_day(int day_of_month)
Mark a day
GTK2.Calendar select_day(int day_of_month)
Select a certain day of the currently selected month
int select_month(int month, int year)
Select the month to be viewed.
GTK2.Calendar set_display_options(int options)
Bitwise or of one or more of CALENDAR_NO_MONTH_CHANGE, CALENDAR_SHOW_DAY_NAMES, CALENDAR_SHOW_HEADING, CALENDAR_SHOW_WEEK_NUMBERS and CALENDAR_WEEK_START_MONDAY.
GTK2.Calendar thaw()
Resume dynamic updating of the widget
GTK2.Calendar unmark_day(int day_of_month)
Unmark a day
CLASS GTK2.CellEditable |
Interface for widgets which are used for editing cells.
Signals: editing_done
remove_widget
GTK2.CellEditable editing_done()
Emits the "editing-done" signal. This signal is a sign for the cell renderer to update its value from the cell.
GTK2.CellEditable remove_widget()
Emits the "remove-widget" signal. This signal is meant to indicate that the cell is finished editing, and the widget may now be destroyed.
GTK2.CellEditable start_editing(GTK2.GdkEvent event)
Begins editing. event is the GDK2.Event that began the editing process. It may be empty, in the instance that editing was initiated through programmatic means.
CLASS GTK2.CellLayout |
An interface for packing cells.
GTK2.CellLayout add_attribute(GTK2.CellRenderer cell, string attribute, int column)
Adds an attribute mapping.
GTK2.CellLayout clear()
Unsets all the mappings on all renderers and removes all renderers.
GTK2.CellLayout clear_attributes(GTK2.CellRenderer cell)
Clears all existing attributes.
GTK2.CellLayout pack_end(GTK2.CellRenderer cell, int expand)
See pack_start().
GTK2.CellLayout pack_start(GTK2.CellRenderer cell, int expand)
Packs the cell into the beginning. If expand is false, then the cell is allocated no more space than it needs. Any unused space is divied evenly between the cells for which expand is true.
GTK2.CellLayout reorder(GTK2.CellRenderer cell, int position)
Re-inserts cell at position.
GTK2.CellLayout set_cell_data_func(GTK2.CellRenderer cell, function(:void) f, mixed user_data)
Sets the callback to use for this cell layout. This function is used instead of the standard attributes mapping for setting the column value, and should set the value of the cell layout's cell renderer(s) as appropriate. f may be 0 to remove an older one.
CLASS GTK2.CellRenderer |
Properties: string cell-background GDK2.Color cell-background-gdk int cell-background-set int height int is-expanded int is-expander int mode CELL_RENDERER_MODE_ACTIVATABLE, CELL_RENDERER_MODE_EDITABLE and CELL_RENDERER_MODE_INERT int sensitive int visible int width float xalign int xpad float yalign int ypad
Signals: editing_canceled
editing_started
int activate(GTK2.GdkEvent event, GTK2.Widget widget, string path, GTK2.GdkRectangle background_area, GTK2.GdkRectangle cell_area, int flags)
Passes an activate event to the cell renderer for possible processing. Some cell renderers may use events; for example, W(CellRendererToggle) toggles when it gets a mouse click.
mapping get_fixed_size()
Fills in width and height with the appropriate size of the cell.
mapping get_size(GTK2.Widget widget, GTK2.GdkRectangle cell_area)
Obtains the width and heigh needed to render the cell. Used by widgets to determine the appropriate size for the cell_area passed to render(). If cell_area is present, fills in the x and y offset of the cell relative to this location. Please note that the values set in width and height, as well as those in x_offset and y_offset are inclusive of the xpad and ypad properties.
inherit GTK2.Data : Data
GTK2.CellRenderer render(GTK2.GdkWindow window, GTK2.Widget widget, GTK2.GdkRectangle background_area, GTK2.GdkRectangle cell_area, GTK2.GdkRectangle expose_area, int flags)
Invokes the virtual render function of the W(CellRenderer). The three passed-in rectangles are areas of window. Most renderers will draw within cell_area; the xalign, yalign, xpad, and ypad fields of the W(CellRenderer) should be honored with respect to cell_area. background_area includes the blank space around the cell, and also the area containing the tree expander; so the background_area rectangles for all cells tile to cover the entire window. expose_area is a clip rectangle. flags is one of CELL_RENDERER_ACCEL_MODE_GTK, CELL_RENDERER_ACCEL_MODE_OTHER, CELL_RENDERER_FOCUSED, CELL_RENDERER_INSENSITIVE, CELL_RENDERER_MODE_ACTIVATABLE, CELL_RENDERER_MODE_EDITABLE, CELL_RENDERER_MODE_INERT, CELL_RENDERER_PRELIT, CELL_RENDERER_SELECTED and CELL_RENDERER_SORTED.
GTK2.CellRenderer set_fixed_size(int width, int height)
Sets the renderer size to be explicit, independent of the properties set.
GTK2.CellRenderer start_editing(GTK2.GdkEvent event, GTK2.Widget widget, string path, GTK2.GdkRectangle background_area, GTK2.GdkRectangle cell_area, int flags)
Passes an activate event to the cell renderer for possible processing.
GTK2.CellRenderer stop_editing(int canceled)
Informs the cell renderer that the editing is stopped. If canceled is true, the cell renderer will emit the "editing-canceled" signal. This function should be called by cell renderer implementations in response to the "editing-done" signal of W(CellEditable).
CLASS GTK2.CellRendererAccel |
Properties: int accel-key int accel-mode int accel-mods int keycode
Signals: accel_cleared
accel_edited
GTK2.CellRendererAccel GTK2.CellRendererAccel(mapping|void props)
Create a new GTK2.CellRendererAccel.
inherit GTK2.CellRendererText : CellRendererText
CLASS GTK2.CellRendererCombo |
Properties: int has-entry GTK2.TreeModel model int text-column
GTK2.CellRendererCombo GTK2.CellRendererCombo(mapping|void props)
Creates a new W(CellRendererCombo).
inherit GTK2.CellRendererText : CellRendererText
CLASS GTK2.CellRendererPixbuf |
Properties: GDK2.Pixbuf pixbuf GDK2.Pixbuf pixbuf-expander-closed GDK2.Pixbuf pixbuf-expander-open string stock-detail string stock-id int stock-size
GTK2.CellRendererPixbuf GTK2.CellRendererPixbuf(mapping|void props)
Creates a new W(CellRendererPixbuf). Adjust rendering parameters using object properties. Object properties can be set globally with G.Object->set(). Also, with W(TreeViewColumn), you can bind a property to a value in a W(TreeModel). For example, you can bind the "pixbuf" property on the cell renderer to a pixbuf value in the model, thus rendering a different image in each row of the W(TreeView).
inherit GTK2.CellRenderer : CellRenderer
CLASS GTK2.CellRendererProgress |
Properties: int orientation int pulse string text float text-xalign float text-yalign int value
GTK2.CellRendererProgress GTK2.CellRendererProgress(mapping|void props)
Create a new W(CellRendererProgress).
inherit GTK2.CellRenderer : CellRenderer
CLASS GTK2.CellRendererSpin |
Properties: int digits GTK2.Adjustment adjustment float climb-rate
GTK2.CellRendererSpin GTK2.CellRendererSpin(mapping|void props)
Create a new GTK2.CellRendererSpin.
inherit GTK2.CellRendererText : CellRendererText
CLASS GTK2.CellRendererText |
Properties: int alignment Pango.AttrList attributes string background GDK2.Color background-gdk int background-set int editable int editable-set int ellipsize PANGO_ELLIPSIZE_END, PANGO_ELLIPSIZE_MIDDLE, PANGO_ELLIPSIZE_NONE and PANGO_ELLIPSIZE_START int ellipsize-set string family int family-set string font Pango.FontDescription font-desc string foreground GDK2.Color foreground-gdk int foreground-set string language int language-set string markup int rise int rise-set float scale int scale-set int single-paragraph-mode int size float size-points int size-set int stretch PANGO_STRETCH_CONDENSED, PANGO_STRETCH_EXPANDED, PANGO_STRETCH_EXTRA_CONDENSED, PANGO_STRETCH_EXTRA_EXPANDED, PANGO_STRETCH_NORMAL, PANGO_STRETCH_SEMI_CONDENSED, PANGO_STRETCH_SEMI_EXPANDED, PANGO_STRETCH_ULTRA_CONDENSED and PANGO_STRETCH_ULTRA_EXPANDED int stretch-set int strikethrough int strikethrough-set int style PANGO_STYLE_ITALIC, PANGO_STYLE_NORMAL and PANGO_STYLE_OBLIQUE int style-set string text int underline PANGO_UNDERLINE_DOUBLE, PANGO_UNDERLINE_ERROR, PANGO_UNDERLINE_LOW, PANGO_UNDERLINE_NONE and PANGO_UNDERLINE_SINGLE int underline-set int variant PANGO_VARIANT_NORMAL and PANGO_VARIANT_SMALL_CAPS int variant-set int weight int weight-set int width-chars
Signals: edited
GTK2.CellRendererText GTK2.CellRendererText(mapping|void props)
Creates a new W(CellRendererText). Adjust how text is drawn using object properties. Object properties can be set globally (with G.Object->set()). Also, with W(TreeViewColumn), you can bind a property to a value in a W(TreeModel). For example, you can bind the "text" property on the cell renderer to a string value in the model, thus rendering a different string in each row of the W(TreeView).
inherit GTK2.CellRenderer : CellRenderer
GTK2.CellRendererText set_fixed_height_from_font(int number_of_rows)
Sets the height of a renderer to explicitly be determined by the "font" and "y_bad" property set on it. Further changes in these properties do not affect the height, so they must be accompanied by a subsequent call to this function. Using this function is unflexible, and should really only be used if calculating the size of cell is too slow (i.e., a massive number of cells displayed). If number_of_rows is -1, then the fixed height is unset, and the height is determined by the properties again.
CLASS GTK2.CellRendererToggle |
Properties: int activatable The toggle button can be activated. int active The toggle state of the button. int inconsistent The inconsistent state of the button. int indicator-size int radio Draw the toggle butotn as a radio button.
Signals: toggled
GTK2.CellRendererToggle GTK2.CellRendererToggle(mapping|void props)
Creates a new W(CellRendererToggle). Adjust rendering parameters using object properties. Object properties can be set globally with set().
int get_active()
Returns whether the cell renderer is active.
int get_radio()
Returns whether we're rendering radio toggles rather than checkboxes.
inherit GTK2.CellRenderer : CellRenderer
GTK2.CellRendererToggle set_active(int setting)
Activates or deactivates a cell renderer.
GTK2.CellRendererToggle set_radio(int radio)
If radio is true, the cell renderer renders a radio toggle (i.e a toggle in a group of mutually-exclusive toggles). If false, it renders a check toggle (a standalone boolean option). This can be set globally for the cell renderer, or changed just before rendering each cell in the model (for W(TreeView), you set up a per-row setting using W(TreeViewColumn) to associate model columns with cell renderer properties).
CLASS GTK2.CellView |
Properties: string background GDK2.Color background-gdk int background-set
GTK2.CellView GTK2.CellView(string|GdkPixbuf|mapping text, int|void markup)
Create a new W(CellView) widget.
array get_cell_renderers()
Returns the cell renderers which have been added to this view.
GTK2.TreePath get_displayed_row()
Returns a W(TreePath) referring to the currently displayed row. If no row is currently displayed, 0 is returned.
mapping get_size_of_row(GTK2.TreePath path)
Returns width and height of the size needed to display the model row pointed to by path.
inherit GTK2.CellLayout : CellLayout
inherit GTK2.Widget : Widget
GTK2.CellView set_background_color(GTK2.GdkColor color)
Sets the background color.
GTK2.CellView set_displayed_row(GTK2.TreePath path)
Sets the row of the model that is currently displayed. If the path is omitted, then the contents of the cellview "stick" at their last value; this is not normally a desired result, but may be a needed intermediate state if say, the mode becomes temporarily empty.
GTK2.CellView set_model(GTK2.TreeModel model)
Sets the model. If this view already has a model set, it will remove it before setting the new model.
CLASS GTK2.CheckButton |
Check buttons inherent many properties and functions from the the
toggle buttons, but look a little different. Rather than
being buttons with text inside them, they are small squares with
the text to the right of them. These are often used for toggling
options on and off in applications.
GTK2.CheckButton( "title" )
Style properties: int indicator-size int indicator-spacing
GTK2.CheckButton GTK2.CheckButton(string|mapping label_or_props, int|void mnemonic)
The argument, if specified, is the label of the item. If no label is specified, use object->add() to add some other widget (such as an pixmap or image widget)
inherit GTK2.ToggleButton : ToggleButton
CLASS GTK2.CheckMenuItem |
A check menu item is more or less identical to a check button, but it
should be used in menus.
GTK2.CheckMenuItem("Hi there")
GTK2.CheckMenuItem("Hi there")->set_active(1)
Properties: int active int draw-as-radio int inconsistent
Style properties: int indicator-size
Signals: toggled Called when the state of the menu item is changed
GTK2.CheckMenuItem GTK2.CheckMenuItem(string|mapping label_or_props)
The argument, if specified, is the label of the item. If no label is specified, use object->add() to add some other widget (such as an pixmap or image widget)
int get_active()
Get whether item is active.
int get_draw_as_radio()
Get whether check menu item is drawn like a radio button.
int get_inconsistent()
Retrieves the value set by set_inconsistent().
inherit GTK2.MenuItem : MenuItem
GTK2.CheckMenuItem set_active(int new_state)
State is either 1 or 0. If 1, the button will be 'pressed'.
GTK2.CheckMenuItem set_draw_as_radio(int draw_as_radio)
Set whether check menu item is drawn like a radio button.
GTK2.CheckMenuItem set_inconsistent(int setting)
If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a boolean setting, and the current values in that range are inconsistent, you may want to display the check in an "in between" state. This function turns on "in between" display.
GTK2.CheckMenuItem toggled()
Emulate a toggled event
CLASS GTK2.Clipboard |
Clipboard implementation.
GTK2.Clipboard clear()
Clears the contents of the clipboard.
GTK2.Clipboard get(GDK2.Atom selection)
Returns the clipboard object for the given selection.
GTK2.GdkDisplay get_display()
Gets the GDK2.Display associated with this clipboard.
GTK2.Clipboard get_for_display(GTK2.GdkDisplay display, GDK2.Atom selection)
Returns the clipboard object for the given selection.
inherit G.Object : Object
GTK2.Clipboard set_image(GTK2.GdkPixbuf pixbuf)
Sets the contents of the clipboard to the given GDK2(Pixbuf).
GTK2.Clipboard set_text(sprintf_format text, sprintf_args ... fmt)
Sets the contents of the clipboard to the given string. If multiple arguments are supplied, sprintf() is called implicitly.
GTK2.GdkPixbuf wait_for_image()
Requests the contents of the clipboard as image and converts the result to a GDK2.Pixbuf.
string wait_for_rich_text(GTK2.TextBuffer buffer)
Requests the contents of the clipboard as rich text.
string wait_for_text()
Requests the contents of the clipboard as text
int wait_is_image_available()
Test to see if tehre is an image available to be pasted.
int wait_is_rich_text_available(GTK2.TextBuffer buffer)
Test to see if there is rich text available to be pasted.
int wait_is_text_available()
Test to see if there is text available to be pasted. This is done by requesting the TARGETS atom and checking if it contains any of the supported text targets.
CLASS GTK2.ColorButton |
Properties: int alpha GDK2.Color color string title int use-alpha
Signals: color_set When a user selects a color.
GTK2.ColorButton GTK2.ColorButton(GTK2.GdkColor red_or_props, int|void green, int|void blue)
Create a new W(ColorButton).
int get_alpha()
Get the current alpha value.
GTK2.GdkColor get_color()
Returns the current color.
string get_title()
Get the title.
int get_use_alpha()
Gets whether the color button uses the alpha channel.
inherit GTK2.Button : Button
GTK2.ColorButton set_alpha(int alpha)
Sets the current opacity to alpha.
GTK2.ColorButton set_color(int|GdkColor red, int|void green, int|void blue)
Sets the current color.
GTK2.ColorButton set_title(string title)
Sets the title for the color selection dialog.
GTK2.ColorButton set_use_alpha(int use_alpha)
Sets whether or not the color button should use the alpha channel.
CLASS GTK2.ColorSelection |
The color selection widget is, not surprisingly, a widget for interactive selection of colors. This composite widget lets the user select a color by manipulating RGB (Red, Green, Blue) and HSV (Hue, Saturation, Value) triples. This is done either by adjusting single values with sliders or entries, or by picking the desired color from a hue-saturation wheel/value bar. Optionally, the opacity of the color can also be set.
The color selection widget currently emits only one signal, "color_changed", which is emitted whenever the current color in the widget changes, either when the user changes it or if it's set explicitly through set_color().
GTK2.ColorSelection()
Properties: int current-alpha GDK2.Color current-color int has-opacity-control int has-palette
Signals: color_changed
GTK2.ColorSelection GTK2.ColorSelection(mapping|void props)
Create a new color selection.
int get_current_alpha()
Returns the current alpha value.
mapping get_current_color()
When you need to query the current color, typically when you've received a "color_changed" signal, you use this function. The return value is an array of floats, See the set_color() function for the description of this array.
int get_has_opacity_control()
Determines whether the colorsel has an opacity control.
int get_has_palette()
Determines whether the color selector has a color palette.
int get_previous_alpha()
Returns the previous alpha value.
mapping get_previous_color()
Returns the original color value.
inherit GTK2.Vbox : Vbox
int is_adjusting()
Gets the current state of the colorsel.
GTK2.ColorSelection set_current_alpha(int alpha)
Sets the current opacity to be alpha. The first time this is called, it will also set the original opacity to be alpha too.
GTK2.ColorSelection set_current_color(mapping color)
You can set the current color explicitly by calling this function with an array of colors (floats). The length of the array depends on whether opacity is enabled or not. Position 0 contains the red component, 1 is green, 2 is blue and opacity is at position 3 (only if opacity is enabled, see set_opacity()) All values are between 0 and 65535
GTK2.ColorSelection set_has_opacity_control(int setting)
Sets whether or not to use opacity.
GTK2.ColorSelection set_has_palette(int has_palette)
Shows and hides the palette based upon the value of has_palette
GTK2.ColorSelection set_previous_alpha(int alpha)
Sets the 'previous' alpha to be alpha. This function should be called with some hesitation, as it might seem confusing to have that alpha change.
GTK2.ColorSelection set_previous_color(mapping colors)
Sets the 'previous' color to be color.
CLASS GTK2.ColorSelectionDialog |
Color Selection Dialog
GTK2.ColorSelectionDialog GTK2.ColorSelectionDialog(string|mapping title_or_props)
Create a new Color Selection Dialog
GTK2.Widget get_cancel_button()
The Cancel button.
GTK2.Widget get_colorsel()
The Color Selection widget contained within the dialog
GTK2.Widget get_help_button()
The Help button.
GTK2.Widget get_ok_button()
The OK button.
inherit GTK2.Dialog : Dialog
CLASS GTK2.ComboBox |
Properties: int active int add-tearoffs int column-span-column int focus-on-click int has-frame GTK2.TreeModel model int row-span-column string tearoff-title int wrap-width
Style properties: int appears-as-list int arrow-size int shadow-type
Signals: changed
GTK2.ComboBox append_text(string text)
Appends text to the list of strings stored in this combo box. Note that you can only use this function with combo boxes constructed with GTK2.ComboBox("a string").
GTK2.ComboBox GTK2.ComboBox(GTK2.TreeModel model_or_props)
Create a new ComboBox, either empty or with a model. If a string is passed int instead, it will create a new W(ComboBox) with only text strings. If you do so, you should only manipulate it with the following functions: append_text(), insert_text(), prepend_text(), and remove_text().
int get_active()
Returns the index of the currently active item, or -1 if none. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this function returns path_get_indices(path)[0], where path is the GTK2.TreePath of the active item.
GTK2.TreeIter get_active_iter()
Get the current active item.
string get_active_text()
Returns the currently active string. Note that you can only use this function with combo boxes constructed with GTK2.ComboBox("a string").
int get_add_tearoffs()
Gets whether the popup menu has tearoff items.
int get_column_span_column()
Returns the column with column span information.
int get_focus_on_click()
Returns whether the combo box grabs focus when it is clicked with the mouse.
GTK2.TreeModel get_model()
Get the GTK2.TreeModel which is acting as a data source.
int get_row_span_column()
Returns the column with row span information.
string get_title()
Gets the current title of the menu in tearoff mode.
int get_wrap_width()
Returns the wrap width which is used to determine the number of columns for the popup menu. If the wrap width is larger than 1, the combo box is in table mode.
inherit GTK2.Bin : Bin
inherit GTK2.CellEditable : CellEditable
inherit GTK2.CellLayout : CellLayout
GTK2.ComboBox insert_text(int position, string text)
Inserts string at position in the list of strings stored. Note that you can only use this function with combo boxes constructed with GTK2.ComboBox("a string").
GTK2.ComboBox popdown()
Hides the menu or dropdown list.
GTK2.ComboBox popup()
Pops up the menu or dropdown list.
GTK2.ComboBox prepend_text(string text)
Prepends string to the list of strings stored in this combo box. Note that you can only use this function with combo boxes constructed with GTK2.ComboBox("a string").
GTK2.ComboBox remove_text(int position)
Removes the string at position from this combo box. Note that you can only use this function with combo boxes constructed with GTK2.ComboBox("a string").
GTK2.ComboBox set_active(int index_)
Sets the active item.
GTK2.ComboBox set_active_iter(GTK2.TreeIter iter)
Sets the current active item to be the one referenced by iter. iter must correspond to a path of depth one.
GTK2.ComboBox set_add_tearoffs(int setting)
Sets whether the popup menu should have a tearoff menu item.
GTK2.ComboBox set_column_span_column(int column_span)
Sets the column span information. The column span column contains integers which indicate how many columns an item should span.
GTK2.ComboBox set_focus_on_click(int setting)
Sets whether the combo box will grab focus when it is clicked with the mouse.
GTK2.ComboBox set_model(GTK2.TreeModel model)
Sets the model used by this widget. Will unset a previously set model. If no arguments are passed, then it will unset the model.
GTK2.ComboBox set_row_separator_func(function(:void) f, mixed user_data)
Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is 0 no separators are drawn. This is the default value.
GTK2.ComboBox set_row_span_column(int row_span)
Sets the column with row span information. The row span column contains integers which indicate how many rows an item should span.
GTK2.ComboBox set_title(string title)
Sets the menu's title in tearoff mode.
GTK2.ComboBox set_wrap_width(int width)
Sets the wrap width. The wrap width is basically the preferred number of columns when you want the popup to be layed out in a table.
CLASS GTK2.ComboBoxEntry |
Properties: int text-column
GTK2.ComboBoxEntry GTK2.ComboBoxEntry(string|TreeModel|mapping model, int|void text_column)
Create a new ComboBoxEntry, either empty or with a model.
GTK2.Widget entry()
Returns the GTK2.Entry widget
int get_text_column()
Returns the column which this widget is using to get the strings from.
inherit GTK2.CellEditable : CellEditable
inherit GTK2.CellLayout : CellLayout
inherit GTK2.ComboBox : ComboBox
GTK2.ComboBoxEntry set_text_column(int text_column)
Sets the model column which this widget should use to get strings from.
CLASS GTK2.Container |
The basic container class. Properties: int border-width GTK2.Widget child int resize-mode RESIZE_IMMEDIATE, RESIZE_PARENT and RESIZE_QUEUE
Signals: add Called when a new object is added to the container. (used internally)
check_resize Called when the container needs resizing (used internally)
remove Called when a object is removed from the container (used internally)
set_focus_child
GTK2.Container add(GTK2.Widget widget)
Add a subwidget to the container. Don't forget to call show() in the subwidget. Some (even most) containers can only contain one child. Calling this function might result in a resize of the container.
GTK2.Container check_resize()
Undocumented
int get_border_width()
Retrieves the border width.
array get_children()
This function returns all children of the container as an array.
array get_focus_chain()
Returns the focus chain.
GTK2.Adjustment get_focus_hadjustment()
Retrieves the horizontal focus adjustment.
GTK2.Adjustment get_focus_vadjustment()
Retrieves the vertical focus adjustment.
int get_resize_mode()
Returns the resize mode.
inherit GTK2.Widget : Widget
GTK2.Container remove(GTK2.Widget widget)
Remove a child from the container. The argument is the child to remove. Calling this function might result in a resize of the container.
GTK2.Container resize_children()
Undocumented.
GTK2.Container set_border_width(int width)
Sets the border width.
GTK2.Container set_focus_chain(array focusable_widgets)
Sets a focus chain, overriding the one computer automatically by GTK+.
In principle each widget in the chain should be a descendant of the container, but this is not enforced by this method, since it's allowed to set the focus chain before you pack the widgets, or have a widget in the chain that isn't always packed. The necessary checks are done when the focus chain is actually traversed.
GTK2.Container set_focus_child(GTK2.Widget child)
Emulate a set_focus_child signal. Focus on the specified child.
GTK2.Container set_focus_hadjustment(GTK2.Adjustment adj)
Set the hadjustment used to focus children.
GTK2.Container set_focus_vadjustment(GTK2.Adjustment adj)
Set the vadjustment used to focus children.
GTK2.Container set_reallocate_redraws(int setting)
Sets the reallocate_redraws flag.
GTK2.Container set_resize_mode(int mode)
One of RESIZE_IMMEDIATE, RESIZE_PARENT and RESIZE_QUEUE
CLASS GTK2.Data |
A class inherited by all objects used to store data (they are not widgets)
Signals: disconnect
inherit GTK2.Object : Object
CLASS GTK2.Databox |
GtkDatabox is designed to display large amounts of numerical data fast and easy. Thousands of data points (X and Y coordinate) may be displayed without any problems, zooming and scrolling as well as optional rulers are already included.
The widget may be used as display for oscilloscopes or other applications that need to display fast changes in their data.
GTK2.Databox x=GTK2.Databox(); x->data_add_x_y(3, ({ 1.0, 0.5, 0.0 }), ({1.0, -1.0, 0.0}),GTK2.GdkColor(Image.Color.red), GTK2.DataboxLines,2); x->rescale(); x->set_size_request(300,300); return x;
Signals: marked
selection_canceled
selection_changed
selection_started
selection_stopped
zoomed
GTK2.Databox GTK2.Databox()
Create a new databox widget
int data_add(int nelems, array x, array y, GTK2.GdkColor color, int type, int dot_size)
Type is one of DATABOX_BARS, DATABOX_CROSS_SIMPLE, DATABOX_GRID, DATABOX_LINES, DATABOX_NOT_DISPLAYED and DATABOX_POINTS
GTK2.GdkColor data_get_color(int index)
Get the color at index.
array data_get_extrema()
Get the bounds of the data set (?)
int data_get_grid_config(int index)
See data_set_grid_config().
array data_get_type(int index)
Return type and dot size at index.
mapping data_get_value(int x, int y)
Get the value at the given coordinates.
array data_get_visible_extrema()
Get the positions of the edges of the display.
int data_remove(int index)
Remove data at index.
int data_remove_all()
Remove all data.
int data_set_color(int index, GTK2.GdkColor color)
Set the color at index.
int data_set_grid_config(int index, int hlines, int vlines)
Not useful unless the data type is GTK2.DATABOX_GRID.
int data_set_type(int index, int type, int dot_size)
Type is one of DATABOX_BARS, DATABOX_CROSS_SIMPLE, DATABOX_GRID, DATABOX_LINES, DATABOX_NOT_DISPLAYED and DATABOX_POINTS
GTK2.Databox get_rulers_enable()
Get whether rulers will be displayed.
GTK2.Databox get_scrollbars_enable()
Get whether scrollbars will be displayed.
int get_selection_enable()
Get whether selection is enabled.
int get_selection_fill_enable()
Get whether the selection will be filled.
GTK2.Databox get_zoom_enable()
Get whether zoom is enabled.
float get_zoom_limit()
Get the zoom limit.
inherit GTK2.Vbox : Vbox
GTK2.Databox redraw()
Redraw.
GTK2.Databox rescale()
Rescale with automatically-calculated extrema.
GTK2.Databox rescale_inverted(int invertX, int invertY)
Rescale with an inverted x and/or y direction.
GTK2.Databox rescale_with_values(float minx, float miny, float maxx, float maxy)
Rescale with specific data extrema.
GTK2.Databox set_background_color(GTK2.GdkColor color)
Set the background color.
GTK2.Databox set_rulers_enable(int setting)
Set whether rulers will be displayed.
GTK2.Databox set_scrollbars_enable(int setting)
Set whether scrollbars will be displayed.
GTK2.Databox set_selection_enable(int setting)
Set whether selection is enabled.
GTK2.Databox set_selection_fill_enable(int setting)
Set whether the selection will be filled.
GTK2.Databox set_zoom_enable(int setting)
Set whether zoom is enabled.
GTK2.Databox set_zoom_limit(float limit)
Set the zoom limit. Default is 0.01, which is 100 times.
CLASS GTK2.Dialog |
A dialog is a window with a few default widgets added. The 'vbox' is the main content area of the widget. The 'action_area' is allocated for buttons (ok, cancel etc) Properties: int has-separator
Style properties: int action-area-border int button-spacing int content-area-border
Signals: close
response
GTK2.Dialog add_action_widget(GTK2.Widget child, int response_id)
Adds an activatable widget to the action area, connecting a signal handler that will emit the "response" signal on the dialog when the widget is activated.
GTK2.Widget add_button(string button_text, int response_id)
Adds a button with the given text (or a stock button) and sets things up so that clicking the button will emit the "response" signal with the given response_id.
GTK2.Dialog GTK2.Dialog(mapping|void props)
Create a new dialog widget.
GTK2.HbuttonBox get_action_area()
The action area, this is where the buttons (ok, cancel etc) go
int get_has_separator()
Accessor for whether the dialog has a separator.
int get_response_for_widget(GTK2.Widget widget)
Gets the response id of a widget in the action area.
GTK2.Vbox get_vbox()
The vertical box that should contain the contents of the dialog
inherit GTK2.Window : Window
GTK2.Dialog response(int response_id)
Emits the "response" signal with the given response ID.
int run()
Run the selected dialog.
GTK2.Dialog set_default_response(int response_id)
Sets the last widget in the action area with the given response_id as the default widget. Pressing "Enter" normally activates the default widget.
GTK2.Dialog set_has_separator(int setting)
Sets whether this dialog has a separator above the buttons. True by default.
GTK2.Dialog set_response_sensitive(int response_id, int setting)
Calls GTK2.Widget->set_sensitive() for each widget in the dialog's action area with the given response_id.
CLASS GTK2.DrawingArea |
The drawing area is a window you can draw in.
Please note that you must handle refresh and resize events
on your own. Use W(pDrawingArea) for a drawingarea with automatic
refresh/resize handling.
GTK2.DrawingArea()->set_size_request(100,100)
GTK2.DrawingArea clear(int|void x, int|void y, int|void width, int|void height)
Either clears the rectangle defined by the arguments, of if no arguments are specified, the whole drawable.
GTK2.DrawingArea copy_area(GTK2.GdkGC gc, int xdest, int ydest, GTK2.Widget source, int xsource, int ysource, int width, int height)
Copies the rectangle defined by xsource,ysource and width,height from the source drawable, and places the results at xdest,ydest in the drawable in which this function is called.
GTK2.DrawingArea GTK2.DrawingArea(mapping|void props)
Create a new drawing area.
GTK2.DrawingArea draw_arc(GTK2.GdkGC gc, int filledp, int x1, int y1, int x2, int y2, int angle1, int angle2)
Draws a single circular or elliptical arc. Each arc is specified by a rectangle and two angles. The center of the circle or ellipse is the center of the rectangle, and the major and minor axes are specified by the width and height. Positive angles indicate counterclockwise motion, and negative angles indicate clockwise motion. If the magnitude of angle2 is greater than 360 degrees, it is truncated to 360 degrees.
GTK2.DrawingArea draw_bitmap(GTK2.GdkGC gc, GTK2.GdkBitmap bitmap, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw a GDK2(Bitmap) in this drawable. NOTE: This drawable must be a bitmap as well. This will be fixed in GTK 1.3
GTK2.DrawingArea draw_image(GTK2.GdkGC gc, GTK2.GdkImage image, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw the rectangle specified by xsrc,ysrc+width,height from the GDK2(Image) at xdest,ydest in the destination drawable
GTK2.DrawingArea draw_line(GTK2.GdkGC gc, int x1, int y1, int x2, int y2)
img_begin w = GTK2.DrawingArea()->set_size_request(100,100); delay: g = GDK2.GC(w)->set_foreground( GDK2.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_line(g,x*10,0,100-x*10,99); img_end
GTK2.DrawingArea draw_pixbuf(GTK2.GdkGC gc, GTK2.GdkPixbuf pixbuf, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw a GDK2(Pixbuf) in this drawable.
GTK2.DrawingArea draw_pixmap(GTK2.GdkGC gc, GTK2.GdkPixmap pixmap, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw the rectangle specified by xsrc,ysrc+width,height from the GDK2(Pixmap) at xdest,ydest in the destination drawable
GTK2.DrawingArea draw_point(GTK2.GdkGC gc, int x, int y)
img_begin w = GTK2.DrawingArea()->set_size_request(10,10); delay: g = GDK2.GC(w)->set_foreground( GDK2.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_point(g, x, x); img_end
GTK2.DrawingArea draw_rectangle(GTK2.GdkGC gc, int filledp, int x1, int y1, int x2, int y2)
img_begin w = GTK2.DrawingArea()->set_size_request(100,100); delay: g = GDK2.GC(w)->set_foreground( GDK2.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_rectangle(g,0,x*10,0,100-x*10,99); img_end img_begin w = GTK2.DrawingArea()->set_size_request(100,100); delay: g = GDK2.GC(w); delay: for(int x = 0; x<30; x++) { delay: g->set_foreground(GDK2.Color(random(255),random(255),random(255)) ); delay: w->draw_rectangle(g,1,x*10,0,100-x*10,99); delay: } img_end
GTK2.DrawingArea draw_text(GTK2.GdkGC gc, int x, int y, string|PangoLayout text)
y is used as the baseline for the text.
inherit GTK2.Widget : Widget
GTK2.DrawingArea set_background(GTK2.GdkColor to)
Set the background color or image. The argument is either a GDK2.Pixmap or a GDK2.Color object.
CLASS GTK2.Editable |
Interface for text-editing widgets.
Signals: changed
delete_text
insert_text
GTK2.Editable copy_clipboard()
Causes the characters in the current selection to be copied to the clipboard.
GTK2.Editable cut_clipboard()
Causes the characters in the current selection to be copied to the clipboard and then deleted.
GTK2.Editable delete_selection()
Deletes the current contents of the selection.
GTK2.Editable delete_text(int start, int end)
Deletes a sequence of characters.
string get_chars(int start, int end)
Retrieves a sequence of characters.
int get_editable()
Retrieves whether this widget is editable.
int get_position()
Retrieves the current cursor position.
array get_selection_bounds()
Returns the selection bounds.
int insert_text(string text, int length, int pos)
Inserts text at a given position. Returns the position after the new text.
GTK2.Editable paste_clipboard()
Causes the contents of the clipboard to be pasted into the given widget at the current cursor position.
GTK2.Editable select_region(int start, int end)
Selects a region of text.
GTK2.Editable set_editable(int setting)
Determines if the user can edit the text or not.
GTK2.Editable set_position(int pos)
Sets the cursor position.
CLASS GTK2.Entry |
Use this widget when you want the user to input a single line of text.
GTK2.Entry()->set_text("Hello world")->set_editable(1)
Properties: int activates-default int cursor-position int editable int has-frame int inner-border int invisible-char int max-length int scroll-offset int selection-bound int shadow-type string text int truncate-multiline int visibility int width-chars float xalign
Style properties:
Signals: activate
backspace
copy_clipboard
cut_clipboard
delete_from_cursor
insert_at_cursor
move_cursor
paste_clipboard
populate_popup
toggle_overwrite
GTK2.Entry GTK2.Entry(int|mapping maxlen_or_props)
Create a new W(Entry) widget.
int get_activates_default()
Retrieves the value set by set_activates_default().
float get_alignment()
Gets the value set by set_alignment().
GTK2.EntryCompletion get_completion()
Returns the completion object.
GTK2.Adjustment get_cursor_hadjustment()
Retrieves the horizontal cursor adjustment
int get_has_frame()
Gets the value set by set_has_frame().
array get_inner_border()
This function returns the entry's inner-border property.
int get_invisible_char()
Retrieves the character displayed in place of the real characters for entries with visibility set to false.
GTK2.Pango.Layout get_layout()
Gets the Pango.Layout used to display the entry. The layout is useful to e.g. convert text positions to pixel positions, in combination with get_layout_offsets().
Keep in mind that the layout text may contain a preedit string, so layout_index_to_text_index() and text_index_to_layout_index() are needed to convert byte indices in the layout to byte indices in the entry contents.
mapping get_layout_offsets()
Obtains the position of the Pango.Layout used to render text in the entry, in widget coordinates. Useful if you want to line up the text in an entry with some other text, e.g. when using the entry to implement editable cells in a sheet widget.
Also useful to convert mouse events into coordinates inside the Pango.Layout, e.g. to take some action if some part of the entry text is clicked.
Keep in mind that the layout text may contain a preedit string, so layout_index_to_text_index() and text_index_to_layout_index() are needed to convert byte indices in the layout to byte indices in the entry contents.
int get_max_length()
Retrieves the maximum allowed length of the text.
string get_text()
Returns the contents of the entry widget.
int get_visibility()
Retrieves whether the text is visible.
int get_width_chars()
Gets the value set by set_width_chars().
inherit GTK2.CellEditable : CellEditable
inherit GTK2.Editable : Editable
inherit GTK2.Widget : Widget
int layout_index_to_text_index(int layout_index)
Converts from a position in the entry contents (returned by get_text()) to a position in the entry's Pango.Layout (returned by get_layout()), with text retrieved via Pango.Layout->get_text().
GTK2.Entry set_activates_default(int setting)
If setting is true, pressing Enter will activate the default widget for the window containing the entry. This usually means that the dialog box containing the entry will be closed, since the default widget is usually one of the dialog buttons.
GTK2.Entry set_alignment(float align)
Sets the alignment for the ocntents of the entry. This controls the horizontal positioning of the contents when the displayed text is shorter than the width of the entry.
GTK2.Entry set_completion(GTK2.EntryCompletion completion)
Sets completion to be the auxiliary completion object to use. All further configuration of the completion mechanism is done on completion using the GTK2.EntryCompletion API.
GTK2.Entry set_cursor_hadjustment(GTK2.Adjustment adj)
Hooks up an adjustment to the cursor position in an entry, so that when the cursor is moved, the adjustment is scrolled to show that position.
GTK2.Entry set_has_frame(int setting)
Sets whether the entry has a beveled frame around it.
GTK2.Entry set_icon_from_pixbuf(int icon_pos, GTK2.GdkPixbuf b)
Set the icon from the given in-memory image.
GTK2.Entry set_icon_from_stock(int icon_pos, string id)
Set the icon using a stock icon.
GTK2.Entry set_inner_border(int left, int right, int top, int bottom)
Sets the inner-border property to border, or clears it if 0 is passed. The inner-border is the area around the entry's text, but inside its frame.
If set, this property overrides the inner-border style property. Overriding the style-provided border is useful when you want to do in-place editing of some text in a canvas or list widget, where pixel-exact positioning of the entry is important.
GTK2.Entry set_invisible_char(int ch)
Sets the character to use in place of the actual text when set_invisibility() has been called to set text visibility to false. i.e. this is the character used in "password" mode to show the user how many characters have been type. The default invisible char is an asterisk ('*'). If you set the invisible char to 0, then the user will get no feedback at all; there will be no text on the screen as they type.
GTK2.Entry set_max_length(int maxlen)
Sets the maximum allowed length of the contents. If the current contents are longer than the given length, then they will be truncated to fit. Range is 0-65536. 0 means no maximum.
GTK2.Entry set_text(sprintf_format text, sprintf_args ... fmt)
Set the text to the specified string, replacing the current contents.
GTK2.Entry set_visibility(int visiblep)
0 indicates invisible text (password boxes, as an example)
GTK2.Entry set_width_chars(int n_chars)
changes the size request of the entry to be about the right size for n_chars characters. Note that it changes the size request, the size can still be affected by how you pack the widget into containers. If n_chars is -1, the size reverts to the default entry size.
int text_index_to_layout_index(int text_index)
Opposite of layout_index_to_text_index().
CLASS GTK2.EntryCompletion |
Properties: int inline-completion int minimum-key-length GTK2.TreeModel model int popup-completion int popup-single-match int text-column
Signals: action_activated
insert_prefix
match_selected
GTK2.EntryCompletion complete()
Requests a completion operation, or in other words a refiltering of the current list with completions, using the current key. The completion list view will be updated accordingly.
GTK2.EntryCompletion GTK2.EntryCompletion(mapping|void props)
Creates a new widget.
GTK2.EntryCompletion delete_action(int index)
Deletes the action at index.
GTK2.Widget get_entry()
Gets the entry this widget has been attached to.
int get_inline_completion()
Returns whether the common prefix of the possible completions should be automatically inserted in the entry.
int get_minimum_key_length()
Returns the minimum key length.
GTK2.TreeModel get_model()
Returns the model being used as the data source.
int get_popup_completion()
Returns whether completions should be presented in a popup window.
int get_popup_set_width()
Returns whether the completion popup window will be resized to the width of the entry.
int get_popup_single_match()
Returns whether the completion popup window will appear even if there is only a single match.
int get_text_column()
Returns the column in the model to get strings from.
inherit GTK2.CellLayout : CellLayout
inherit G.Object : Object
GTK2.EntryCompletion insert_action_markup(int index, string markup)
Inserts an action in the action item list at position index with the specified markup.
GTK2.EntryCompletion insert_action_text(int index, string text)
Inserts an action in the action item list at position index with the specified text. If you want the action item to have markup, use insert_action_markup().
GTK2.EntryCompletion insert_prefix()
Requests a prefix insertion.
GTK2.EntryCompletion set_inline_completion(int inline_completion)
Sets whether the common prefix of the possible completions should be automatically inserted in the entry.
GTK2.EntryCompletion set_inline_selection(int inline_selection)
Sets whether it is possible to cycle through the possible completions inside the entry.
GTK2.EntryCompletion set_match_func(function(:void) cb)
Sets the function to be called to decide if a specific row should be displayed.
GTK2.EntryCompletion set_minimum_key_length(int length)
Requires the length of the search key to be at least length long. This is useful for long lists, where completing using a small key takes a lot of time and will come up with meaningless results anyway (i.e. a too large dataset).
GTK2.EntryCompletion set_model(GTK2.TreeModel model)
Sets the model. If this completion already has a model set, it will remove it before setting the new model. If omitted it will unset the model.
GTK2.EntryCompletion set_popup_completion(int setting)
Sets whether the completions should be presented in a popup window.
GTK2.EntryCompletion set_popup_set_width(int setting)
Sets whether the completion popup window will be resized to be the same width as the entry.
GTK2.EntryCompletion set_popup_single_match(int setting)
Sets whether the completion popup window will appear even if there is only a single match. You may want to set this to 0 if you are using inline completion.
GTK2.EntryCompletion set_text_column(int column)
Convenience function for setting up the most used case of this code: a completion list with just strings. This function will set up the completion to have a list displaying all (and just) strings in the list, and to get those strings from column column in the model.
CLASS GTK2.EventBox |
Some gtk widgets don't have associated X windows, so they just draw on their parents. Because of this, they cannot receive events and if they are incorrectly sized, they don't clip so you can get messy overwritting etc. If you require more from these widgets, the EventBox is for you.
At first glance, the EventBox widget might appear to be totally useless. It draws nothing on the screen and responds to no events. However, it does serve a function - it provides an X window for its child widget. This is important as many GTK2 widgets do not have an associated X window. Not having an X window saves memory and improves performance, but also has some drawbacks. A widget without an X window cannot receive events, and does not perform any clipping on it's contents. Although the name EventBox emphasizes the event-handling function, the widget can also be used for clipping.
The primary use for this widget is when you want to receive events for a widget without a window. Examples of such widgets are labels and images.
GTK2.EventBox()->set_size_request(100,100)
Properties: int above-child int visible-window
GTK2.EventBox GTK2.EventBox(mapping|void props)
Create a new event box widget
int get_above_child()
Returns whether the event box window is above or below the windows of its child.
int get_visible_window()
Returns whether the event box has a visible window.
inherit GTK2.Bin : Bin
GTK2.EventBox set_above_child(int above_child)
Sets whether the event box window is positioned above the windows of its child, as opposed to below it. If the window is above, all events inside the event box will go to the event box. If the window is below, events in windows of child widgets will first go to that widget, and then to its parents.
The default is to keep the window below the child.
GTK2.EventBox set_visible_window(int visible_window)
Sets whether the event box uses a visible or invisible child window. The default is to use visible windows.
CLASS GTK2.Expander |
Properties: int expanded string label GTK2.Widget label-widget int spacing int use-markup int use-underline
Style properties: int expander-size int expander-spacing
Signals: activate
GTK2.Expander GTK2.Expander(string|mapping label)
Create a new GTK2.Expander. Set mnemonic to 1 for a mnemonic expander, otherwise omitting it creates a regular expander.
int get_expanded()
Returns true if the child widget is revealed.
string get_label()
Fetches the text from the label of the expander.
GTK2.Widget get_label_widget()
Retrieves the label widget for the frame.
int get_spacing()
Returns the spacing.
int get_use_markup()
Returns whether the label's text is interpreted as marked up with the Pango text markup language.
int get_use_underline()
Returns whether an embedded underline in the label indicates a mnemonic.
inherit GTK2.Bin : Bin
GTK2.Expander set_expanded(int expanded)
Sets the state of the expander. Set to true if you want the child widget to be revealed, and false if you want the child widget to be hidden.
GTK2.Expander set_label(string label)
Sets the text of the label of the expander.
GTK2.Expander set_label_widget(GTK2.Widget label)
Set the label widget for the expander. This is the widget that will appear embedded alongside the expander arrow.
GTK2.Expander set_spacing(int spacing)
Sets the spacing field of the expander, which is the number of pixels to place between the expander and the child.
GTK2.Expander set_use_markup(int use_markup)
Sets whether the text of the label contains markup in Pango's text markup language.
GTK2.Expander set_use_underline(int use_underline)
If true, an underline in the text of the label indicates the next character should be used for the mnemonic accelarator key.
CLASS GTK2.FileChooser |
Properties: int action GTK2.Widget extra-widget string file-system-backend GTK2.FileFilter filter int local-only GTk.Widget preview-widget int preview-widget-active int select-multiple int show-hidden int use-preview-label
Signals: current_folder_changed
file_activated
selection_changed
update_preview
GTK2.FileChooser add_filter(GTK2.FileFilter filter)
Adds filter to the list of filters that the user can select between. When a filter is selected, only files that are passed by that filter are displayed.
int add_shortcut_folder(string folder)
Adds a folder to be displayed with the shortcut folders in a file chooser. Note that shortcut folders do not get saved, as they are provided by the application. For example, you can use this to add a "/usr/share/mydrawprogram/Clipart" folder to the volume list.
int add_shortcut_folder_uri(string uri)
Adds a folder URI to be displayed with the shortcut folders.
int get_action()
Get the type of action the file chooser is performing.
string get_current_folder()
Gets the current folder as a local filename.
string get_current_folder_uri()
Gets the current folder as a URI.
int get_do_overwrite_confirmation()
Queries whether a file chooser is set to confirm for overwriting when the user types a file name that already exists.
GTK2.Widget get_extra_widget()
Gets the extra widget.
string get_filename()
Gets the filename for the currently select file.
array get_filenames()
Get a list of all selected file and subfolders. The returned names are full absolute paths. If files in the current folder cannot be represented as local filenames, they will be ignored. If you want those files, You may want to use get_uris() instead.
GTK2.FileFilter get_filter()
Gets the current filter.
int get_local_only()
Gets whether only local files can be selected in the file selector.
string get_preview_filename()
Gets the filename that should be previewed in a custom preview widget.
string get_preview_uri()
Gets the URI that should be previewed in a custom preview widget.
GTK2.Widget get_preview_widget()
Gets the current preview widget.
int get_preview_widget_active()
Gets whether the preview widget set by set_preview_widget_active() should be shown for the current filename.
int get_select_multiple()
Gets whether multiple files can be selected.
int get_show_hidden()
Gets whether hidden files and folders are displayed.
string get_uri()
Gets the URI for the currently selected file.
array get_uris()
List all the selected files and subfolders in the current folder. The returned names are full absolute URIs.
int get_use_preview_label()
Gets whether a stock label should be drawn with the name of the previewed file.
array list_filters()
Lists the current set of user-selectable filters.
array list_shortcut_folder_uris()
Queries the list of shortcut folders.
array list_shortcut_folders()
Queries the list of shortcut folders.
GTK2.FileChooser remove_filter(GTK2.FileFilter filter)
Removes filter from the list of filters that the user can select between.
GTK2.FileChooser remove_shortcut_folder(string folder)
Removes a folder from the list of shortcut folders.
GTK2.FileChooser remove_shortcut_folder_uri(string uri)
Removes a folder URI.
GTK2.FileChooser select_all()
Select all files.
int select_filename(string filename)
Selects a filename.
int select_uri(string uri)
Selects the file by uri.
GTK2.FileChooser set_action(int action)
Sets type of action, from opening or saving a file, or opening or saving a folder. Options are: FILE_CHOOSER_ACTION_OPEN FILE_CHOOSER_ACTION_SAVE FILE_CHOOSER_ACTION_SELECT_FOLDER FILE_CHOOSER_ACTION_CREATE_FOLDER
int set_current_folder(string folder)
Sets the current folder from a local filename. The user will be shown the full contents of the current folder, plus user interface elements for navigating to other folders.
int set_current_folder_uri(string uri)
Sets the current folder from a URI.
GTK2.FileChooser set_current_name(string filename)
Sets current name.
GTK2.FileChooser set_do_overwrite_confirmation(int setting)
Sets whether a file chooser in GTK2.FILE_CHOOSER_ACTION_SAVE mode will present a confirmation dialog if the users types a file name that already exists. This is FALSE by default.
Regardless of this setting, the chooser will emit the "confirm-overwrite" signal when appropriate.
If all you need is the stock confirmation dialog, set this property to TRUE. You can override the way confirmation is done by actually handling the "confirm-overwrite" signal.
GTK2.FileChooser set_extra_widget(GTK2.Widget widget)
Sets an application-supplied widget to provide extra options to the user.
int set_filename(string filename)
Sets filename as the current filename. Same as unselect_all() followed by select_filename();
GTK2.FileChooser set_filter(GTK2.FileFilter filter)
Sets the current filter; only the files that pass the filter will be displayed. If the user-selectable list of filters is non-empty, then the filter should be one of the filters in that list. Setting the current filter when the list of filters is empty is useful if you want to restrict the displayed set of files without letting the user change it.
GTK2.FileChooser set_local_only(int local_only)
Sets whether on local files can be selected.
GTK2.FileChooser set_preview_widget(GTK2.Widget widget)
Sets an application-supplied widget to use to display a custom preview of the currently selected file. To implement a preview, after setting the preview widget, you connect to the "update-preview" signal, and call get_preview_filename() or get_preview_uri() on each change. If you can display a preview of the new file, update your widget and set the preview active using set_preview_widget_active(). Otherwise, set the preview inactive.
When there is no application-supplied preview widget, or the application- supplied preview widget is not active, the file chooser may display an internally generated preview of the current file or it may display no preview at all.
GTK2.FileChooser set_preview_widget_active(int setting)
Sets whether the preview widget set by set_preview_widget() should be shown for the current filename. When setting is set to false, the file chooser may display an internally generated preview of the current file or it may display no preview at all.
GTK2.FileChooser set_select_multiple(int select_multiple)
Sets whether multiple files can be selected in the file selector. This is only relevant if the action is set to be FILE_CHOOSER_ACTION_OPEN or FILE_CHOOSER_ACTION_SAVE
GTK2.FileChooser set_show_hidden(int setting)
Sets whether hidden files and folders are displayed.
int set_uri(string uri)
Sets the uri as the current file.
GTK2.FileChooser set_use_preview_label(int setting)
Sets whether the file chooser should display a stock label with the name of the file that is being previewed; the default is true. Applications that want to draw the whole preview area themselves should set this to false and display the name themselves in their preview widget.
GTK2.FileChooser unselect_all()
Unselect all files.
GTK2.FileChooser unselect_filename(string filename)
Unselects a currently selected filename.
GTK2.FileChooser unselect_uri(string uri)
Unselect the uri.
CLASS GTK2.FileChooserButton |
Properties: GTK2.FileChooserDialog dialog int focus-on-click string title int width-chars
GTK2.FileChooserButton GTK2.FileChooserButton(string|mapping title_or_props, int|void action)
Create a new file-selecting button widget. action is one of FILE_CHOOSER_ACTION_CREATE_FOLDER, FILE_CHOOSER_ACTION_OPEN, FILE_CHOOSER_ACTION_SAVE and FILE_CHOOSER_ACTION_SELECT_FOLDER
int get_focus_on_click()
Returns whether the button grabs focus when it is clicked.
string get_title()
Retrieves the title of the browse dialog.
int get_width_chars()
Retrieves the width in characters of the button widget's entry and/or label.
inherit GTK2.FileChooser : FileChooser
inherit GTK2.Hbox : Hbox
GTK2.FileChooserButton set_focus_on_click(int focus)
Sets whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don't want the keyboard focus removed from the main area of the application.
GTK2.FileChooserButton set_title(string title)
Modifies the title of the browse dialog.
GTK2.FileChooserButton set_width_chars(int n_chars)
Sets the width (in characters) that the button will use.
CLASS GTK2.FileChooserDialog |
GtkFileChooserDialog should be used to retrieve file or directory names from the user. It will create a new dialog window containing a directory list, and a file list corresponding to the current working directory. The filesystem can be navigated using the directory list, the drop-down history menu, or the TAB key can be used to navigate using filename completion common in text based editors such as emacs and jed.
The default filename can be set using set_filename() and the selected filename retrieved using get_filename().
Use complete() to display files that match a given pattern. This can be used for example, to show only *.txt files, or only files beginning with gtk*.
Simple file operations; create directory, delete file, and rename file, are available from buttons at the top of the dialog. These can be hidden using hide_fileop_buttons() and shown again using show_fileop_buttons().
GTK2.FileChooserDialog("File selector", 0, GTK2.FILE_CHOOSER_ACTION_OPEN, ({(["text":"Transmogrify", "id":17]), (["text":"Never mind", "id":42])}))
GTK2.FileChooserDialog GTK2.FileChooserDialog(string title, GTK2.Window parent, int mode, array buttons)
Creates a new file selection dialog box. By default it will list the files in the current working directory. Operation buttons allowing the user to create a directory, delete files, and rename files will also be present by default.
inherit GTK2.Dialog : Dialog
inherit GTK2.FileChooser : FileChooser
CLASS GTK2.FileChooserWidget |
File chooser widget that can be embedded in other widgets.
GTK2.FileChooserWidget(GTK2.FILE_CHOOSER_ACTION_OPEN);
GTK2.FileChooserWidget GTK2.FileChooserWidget(int|mapping action_or_props)
Create a new file chooser widget. action is one of FILE_CHOOSER_ACTION_CREATE_FOLDER, FILE_CHOOSER_ACTION_OPEN, FILE_CHOOSER_ACTION_SAVE and FILE_CHOOSER_ACTION_SELECT_FOLDER
inherit GTK2.FileChooser : FileChooser
inherit GTK2.Vbox : Vbox
CLASS GTK2.FileFilter |
A filter for selecting a file subset.
GTK2.FileFilter add_mime_type(string mime_type)
Adds a rule allowing a given mime type.
GTK2.FileFilter add_pattern(string pattern)
Adds a rule allowing a shell style glob.
GTK2.FileFilter add_pixbuf_formats()
Adds a rule allowing image files in the formats support by W(Pixbuf).
GTK2.FileFilter GTK2.FileFilter()
Creates a new W(FileFilter) with no rules added to it. Such a filter doesn't accept any files, so is not particularly useful until you add rules with add_mime_type(), add_pattern(), or add_custom(). To create a filter accepts any file, use add_pattern("*").
string get_name()
Gets the human-readable name for the filter.
inherit GTK2.Data : Data
GTK2.FileFilter set_name(string name)
Sets the human-readable name of the filter; this is the string that will be displayed in the file selector user interface if there is a selectable list of filters.
CLASS GTK2.FileSelection |
GtkFileSelection should be used to retrieve file or directory names from the user. It will create a new dialog window containing a directory list, and a file list corresponding to the current working directory. The filesystem can be navigated using the directory list, the drop-down history menu, or the TAB key can be used to navigate using filename completion common in text based editors such as emacs and jed.
The default filename can be set using set_filename() and the selected filename retrieved using get_filename().
Use complete() to display files that match a given pattern. This can be used for example, to show only *.txt files, or only files beginning with gtk*.
Simple file operations; create directory, delete file, and rename file, are available from buttons at the top of the dialog. These can be hidden using hide_fileop_buttons() and shown again using show_fileop_buttons().
GTK2.FileSelection("File selector")
Properties: string filename int select-multiple int show-fileops
GTK2.FileSelection complete(string pattern)
Will attempt to match pattern to a valid filename in the current directory. If a match can be made, the matched filename will appear in the text entry field of the file selection dialog. If a partial match can be made, the "Files" list will contain those file names which have been partially matched.
GTK2.FileSelection GTK2.FileSelection(string|mapping title_or_props)
Creates a new file selection dialog box. By default it will list the files in the current working directory. Operation buttons allowing the user to create a directory, delete files, and rename files will also be present by default.
GTK2.Vbox get_action_area()
The action area
GTK2.HbuttonBox get_button_area()
The button area
GTK2.Button get_cancel_button()
The cancel button
string get_filename()
Return the filename.
GTK2.Button get_fileop_c_dir()
The create directory button in the file operation button group
GTK2.Button get_fileop_del_file()
The delete file button in the file operation button group
GTK2.Dialog get_fileop_dialog()
Dialog box for GTK2.FileSelection
GTK2.Button get_fileop_ren_file()
The rename file button in the file operation button group
GTK2.Button get_help_button()
The help button
GTK2.Vbox get_main_vbox()
The main vbox
GTK2.Button get_ok_button()
The ok button
int get_select_multiple()
Gets whether the user is allowed to select multiple files.
array get_selection()
Retrieves the list of selections the user has made.
GTK2.FileSelection hide_fileop_buttons()
Hides the file operation buttons that normally appear at the top of the dialog. Useful if you wish to create a custom file selector, based on GTK2.FileSelection.
inherit GTK2.Dialog : Dialog
GTK2.FileSelection set_filename(string fname)
Sets a default path for the file requestor. If filename includes a directory path, then the requestor will open with that path as its current working directory.
GTK2.FileSelection set_select_multiple(int select_multiple)
Sets whether the user is allowed to select multiple files.
GTK2.FileSelection show_fileop_buttons()
Shows the file operation buttons, if they have previously been hidden. The rest of the widgets in the dialog will be resized accordingly.
CLASS GTK2.Fixed |
A fixed container is a container that keeps it's children at fixed locations and give them fixed sizes, both given in pixels.
Example:
GTK2.Fixed()->put(GTK2.Label("100,100"), 100, 100)->put(GTK2.Label("0,0"), 0, 0)->set_size_request(150,115)
Child properties: int x int y
GTK2.Fixed GTK2.Fixed(mapping|void props)
Create a new fixed widget
array get_children()
Get a list of the children and their x,y positions.
int get_has_window()
Gets whether GTK2.Fixed has its own GDK2.Window.
inherit GTK2.Container : Container
GTK2.Fixed move(GTK2.Widget widget, int new_xpos, int new_ypos)
Move the widget to new_xpos,new_ypos from it's old location.
GTK2.Fixed put(GTK2.Widget widget, int x, int y)
Place the widget at xpos,ypos.
GTK2.Fixed set_has_window(int has_window)
Sets wither a GTK2.Fixed widget is created with a separate GDK2.Window for the window or now.
CLASS GTK2.FontButton |
Properties: string font-name int show-size int show-style string title int use-font int use-size
Signals: font_set
GTK2.FontButton GTK2.FontButton(string|mapping font_or_props)
Create a new font picker widget. If font is specified, it will be displayed in the font selection dialog.
string get_font_name()
Retrieves the name of the currently selected font.
int get_show_size()
Returns whether the font size will be shown in the label.
int get_show_style()
Returns whether the name of the font style will be shown in the label.
string get_title()
Retrieves the title of the font selection dialog.
int get_use_font()
Returns whether the selected font is used in the label.
int get_use_size()
Returns whether the selected size is used in the label.
inherit GTK2.Button : Button
int set_font_name(string font)
Sets or updates the currently-displayed font.
GTK2.FontButton set_show_size(int setting)
If setting is true, the font size will be displayed along with the name of the selected of the selected font.
GTK2.FontButton set_show_style(int setting)
If setting is true, the font style will be displayed along with the name of the selected font.
GTK2.FontButton set_title(string title)
Sets the title for the font selection dialog.
GTK2.FontButton set_use_font(int setting)
If setting is true, the font name will be written using the selected font.
GTK2.FontButton set_use_size(int setting)
If setting is true, the font name will be written using the selected size.
CLASS GTK2.FontSelection |
The W(FontSelection) widget lists the available fonts, styles and sizes,
allowing the user to select a font. It is used in W(FontSelectionDialog).
GTK2.FontSelection();
Properties: string font-name string preview-text
GTK2.FontSelection GTK2.FontSelection(mapping|void props)
Create a new GTK2.FontSelection widget.
string get_font_name()
Gets the currently-selected font name.
string get_preview_text()
Gets the text displayed in the preview area.
inherit GTK2.Vbox : Vbox
GTK2.FontSelection set_font_name(string fontname)
This sets the currently displayed font.
GTK2.FontSelection set_preview_text(string text)
Sets the text displayed in the preview area.
CLASS GTK2.FontSelectionDialog |
The GtkFontSelectionDialog widget is a dialog box for selecting a font.
To set the font which is initially selected, use set_font_name().
To get the selected font use get_font_name().
To change the text which is shown in the preview area, use set_preview_text().
GTK2.FontSelectionDialog("Select a font")
GTK2.FontSelectionDialog GTK2.FontSelectionDialog(string title)
Create a new font selection dialog with the specified window title
GTK2.Button get_apply_button()
The apply button
GTK2.Button get_cancel_button()
The cancel button
string get_font_name()
Gets the currently-selected font name.
GTK2.Button get_ok_button()
The ok button
string get_preview_text()
Gets the text displayed in the preview area.
inherit GTK2.Dialog : Dialog
int set_font_name(string font)
Sets the currently-selected font.
GTK2.FontSelectionDialog set_preview_text(string text)
Sets the text displayed in the preview area.
CLASS GTK2.Frame |
The frame widget is a Bin that surrounds its child with a decorative frame and an optional label. If present, the label is drawn in a gap in the top side of the frame. The position of the label can be controlled with set_label_align().
Used to visually group objects.
GTK2.Frame("Title")->add(GTK2.Label("Contents"))
GTK2.Frame()->add(GTK2.Label("Contents"))
GTK2.Frame()->add(GTK2.Label("Contents"))->set_shadow_type(GTK2.SHADOW_IN)
Properties: string label GTK2.Widget label-widget float label-xalign float label-yalign int shadow int shadow-type
GTK2.Frame GTK2.Frame(string|mapping label_or_props)
Create a new W(Frame) widget.
string get_label()
Return the text in the label widget.
array get_label_align()
Retrieves the x and y alignment of the label.
GTK2.Widget get_label_widget()
Retrieves the label widget.
int get_shadow_type()
Return the shadow type.
inherit GTK2.Bin : Bin
GTK2.Frame set_label(string|void label_text)
Set the text of the label.
GTK2.Frame set_label_align(float xalign, float yalign)
Arguments are xalignment and yalignment. 0.0 is left or topmost, 1.0 is right or bottommost. The default value for a newly created Frame is 0.0.
GTK2.Frame set_label_widget(GTK2.Widget label)
Sets the label widget for the frame. This is the widget that will appear embedded in the top edge of the frame as a title.
GTK2.Frame set_shadow_type(int shadow_type)
Set the shadow type for the Frame widget. The type is one of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
CLASS GTK2.GdkBitmap |
A bitmap is a black and white pixmap. Most commonly used as masks for images, widgets and pixmaps.
NOIMG
GTK2.GdkBitmap GTK2.GdkBitmap(int|Image.Image xsize_or_image, int|void ysize, string|void bitmap)
Create a new GDK2.Bitmap object. Argument is either an Image.image object, or {xsisze,ysize,xbitmapdata}.
inherit GDK2.Drawable : Drawable
GDK2.Bitmap ref()
Add a reference
GDK2.Bitmap unref()
Remove a reference
CLASS GTK2.GdkColor |
The GDK2.Color object is used to represent a color. When you call GDK2.Color(r,g,b) the color will be allocated from the X-server. The constructor can return an exception if there are no more colors to allocate. NOIMG
int blue()
Returns the blue color component.
GTK2.GdkColor GTK2.GdkColor(object|int color_or_r, int|void g, int|void b)
r g and b are in the range 0 to 255, inclusive. If color is specified, it should be an Image.Color object, and the only argument.
GDK2.Color destroy()
Destroys the color object. Please note that this function does not free the color from the X-colormap (in case of pseudocolor) right now.
int green()
Returns the green color component.
Image.Color.Color image_color_object()
Return a Image.Color.Color instance. This gives better precision than the rgb function.
int pixel()
Returns the pixel value of the color. See GDK2.Image->set_pixel.
int red()
Returns the red color component.
array rgb()
Returns the red green and blue color components as an array.
CLASS GTK2.GdkColormap |
A colormap is an object that contains the mapping between the color values stored in memory and the RGB values that are used to display color values. In general, colormaps only contain significant information for pseudo-color visuals, but even for other visual types, a colormap object is required in some circumstances.
int alloc_color(GTK2.GdkColor color, int writeable, int best_match)
Alocates a single color from a colormap.
int alloc_colors(array colors, int writeable, int best_match)
Allocates colors from a colormap.
GTK2.GdkColormap GTK2.GdkColormap(GTK2.GdkVisual visual, int|void allocate, int|void system)
Creates a new colormap.
GDK2.Colormap free_colors(array colors)
Free colors.
GTK2.GdkScreen get_screen()
Returns the screen.
GTK2.GdkVisual get_visual()
Returns the visual.
GTK2.GdkColor query_color(int pixel)
Locates the RGB color corresponding to the given hardware pixel. pixel must be a valid pixel in the colormap; it's a programmer error to call this function with a pixel which is not in the colormap. Hardware pixels are normally obtained from alloc_colors(), or from a GDK2.Image.
CLASS GTK2.GdkDisplay |
GdkDisplay object.
Signals: closed
GDK2.Display beep()
Emits a short beep on display
GDK2.Display close()
Closes the connection to the window system for the given display, and cleans up associated resources.
GTK2.GdkDisplay GTK2.GdkDisplay()
Get the default display.
GDK2.Display flush()
Flushes any requests queued for the windowing system; this happens automatically when the main loop blocks waiting for new events, but if your application is drawing without returning control to the main loop, you may need to call this function explicitly. A common case where this function needs to be called is when an application is executing drawing commands from a thread other than the thread where the main loop is running.
int get_default_cursor_size()
Returns the default size to use for cursors.
GTK2.GdkWindow get_default_group()
Returns the default group leader window for all toplevel windows. This window is implicitly create by GDK.
GTK2.GdkScreen get_default_screen()
Get the default screen.
GTK2.GdkEvent get_event()
Gets the next GDK2.Event to be processed, fetching events from the windowing system if necessary.
mapping get_maximal_cursor_size()
Returns the maximal size to use for cursors.
int get_n_screens()
Gets the number of screens managed by the display.
string get_name()
Gets the name of the display.
mapping get_pointer()
Gets the current location of the pointer and the current modifier mask.
GTK2.GdkScreen get_screen(int screen_num)
Returns a screen for one of the screens.
mapping get_window_at_pointer()
Obtains the window underneath the mouse pointer, and the x,y location. Returns 0 if the window is not known to GDK (for example, belongs to another application).
inherit G.Object : Object
GDK2.Display keyboard_ungrab()
Release any keyboard grab.
GDK2.Display open(string name)
Opens a display.
GTK2.GdkEvent peek_event()
Gets a copy of the first GDK2.Event in the event queue, without removing the event from the queue. (Note that this function will not get more events from the windowing system. It only checks the events that have already been moved to the GDK event queue.)
int pointer_is_grabbed()
Test if the pointer is grabbed.
GDK2.Display pointer_ungrab()
Release any pointer grab.
GDK2.Display put_event(GTK2.GdkEvent event)
Appends a copy of the given event onto the front of the event queue.
int request_selection_notification(GDK2.Atom selection)
Request GdkEventOwnerChange events for ownership changes of the selection named by the given atom.
GDK2.Display set_double_click_distance(int distance)
Sets the double click distance (two clicks within this distance count as a double click and result in a GDK_2BUTTON_PRESS event). See also set_double_click_time().
GDK2.Display set_double_click_time(int msec)
Sets the double click time (two clicks within this time interval counts as a double click and result in a GDK_2BUTTON_PRESS event). Applications should not set this, it is a global user-configured setting.
GDK2.Display store_clipboard(GTK2.GdkWindow clipboard_window, array targets)
Issues a request to the clipboard manager to store the clipboard data.
int supports_clipboard_persistence()
Returns whether the specified display supports clipboard persistence, i.e. if it's possible to store the clipboard data after an application has quit. On X11 this checks if a clipboard daemon is running.
int supports_cursor_alpha()
Returns true if cursors can use an 8bit alpha channel. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).
int supports_cursor_color()
Returns true if multicolored cursors are supported. Otherwise, cursors have only a foreground and a background color.
int supports_input_shapes()
Returns true if GDK2.Window->input_shape_combine_mask() can be used to modify the input shape of windows.
int supports_selection_notification()
Returns whether GdkEventOwnerChange events will be sent when the owner of a selection changes.
int supports_shapes()
Returns true if GDK2.Window->shape_combine_mask() can be used to create shaped windows.
GDK2.Display sync()
Flushes any requests queued for the windowing system and waits until all requests have been handled. This is often used for making sure that the display is synchronized with the current state of the program. Calling sync() before (gdk_error_trap_pop()) makes sure that any errors generated from earlier requests are handled before the error trap is removed.
This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.
GDK2.Display warp_pointer(GTK2.GdkScreen screen, int x, int y)
Warps the pointer to the point x,y on the screen, unless the pointer is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping the pointer creates events as if the user had moved the mouse instantaneously to the destination.
CLASS GTK2.GdkDragContext |
The drag context contains all information about the drag'n'drop connected to the signal to which it is an argument.
NOIMG
GDK2.DragContext drag_abort(int time)
Abort the drag
GDK2.DragContext drag_drop(int time)
Drag drop.
GDK2.DragContext drag_finish(int success, int del)
If success is true, the drag succeded. If del is true, the source should be deleted. time is the current time.
GDK2.DragContext drag_set_icon_default()
Use the default drag icon associated with the source widget.
GDK2.DragContext drag_set_icon_pixmap(GTK2.GdkPixmap p, GTK2.GdkBitmap b, int hot_x, int hot_y)
Set the drag pixmap, and optionally mask. The hot_x and hot_y coordinates will be the location of the mouse pointer, relative to the upper left corner of the pixmap.
GDK2.DragContext drag_set_icon_widget(GTK2.Widget widget, int hot_x, int hot_y)
Set the drag widget. This is a widget that will be shown, and then dragged around by the user during this drag.
GDK2.DragContext drag_status(int action)
Setting action to -1 means use the suggested action
GDK2.DragContext drop_reply(int ok)
Drop reply.
int get_action()
One of GDK_ACTION_ASK, GDK_ACTION_COPY, GDK_ACTION_DEFAULT, GDK_ACTION_LINK, GDK_ACTION_MOVE and GDK_ACTION_PRIVATE;
int get_actions()
A bitwise or of one or more of GDK_ACTION_ASK, GDK_ACTION_COPY, GDK_ACTION_DEFAULT, GDK_ACTION_LINK, GDK_ACTION_MOVE and GDK_ACTION_PRIVATE;
int get_is_source()
Is this application the source?
int get_protocol()
One of GDK_DRAG_PROTO_LOCAL, GDK_DRAG_PROTO_MOTIF, GDK_DRAG_PROTO_NONE, GDK_DRAG_PROTO_OLE2, GDK_DRAG_PROTO_ROOTWIN, GDK_DRAG_PROTO_WIN32_DROPFILES and GDK_DRAG_PROTO_XDND
GTK2.Widget get_source_widget()
Return the drag source widget.
int get_start_time()
The start time of this drag, as a unix time_t (seconds since 0:00 1/1 1970)
int get_suggested_action()
One of GDK_ACTION_ASK, GDK_ACTION_COPY, GDK_ACTION_DEFAULT, GDK_ACTION_LINK, GDK_ACTION_MOVE and GDK_ACTION_PRIVATE;
CLASS GTK2.GdkDrawable |
The GDK2.Bitmap, GDK2.Window and GDK2.Pixmap classes are all GDK drawables.
This means that you can use the same set of functions to draw in them.
Pixmaps are offscreen drawables. They can be drawn upon with the standard drawing primitives, then copied to another drawable (such as a GDK2.Window) with window->draw_pixmap(), set as the background for a window or widget, or otherwise used to show graphics (in a W(Pixmap), as an example). The depth of a pixmap is the number of bits per pixels. Bitmaps are simply pixmaps with a depth of 1. (That is, they are monochrome bitmaps - each pixel can be either on or off).
Bitmaps are mostly used as masks when drawing pixmaps, or as a shape for a GDK2.Window or a W(Widget)
GDK2.Drawable clear(int|void x, int|void y, int|void width, int|void height)
Either clears the rectangle defined by the arguments, of if no arguments are specified, the whole drawable.
GDK2.Drawable copy_area(GTK2.GdkGC gc, int xdest, int ydest, GTK2.Widget source, int xsource, int ysource, int width, int height)
Copies the rectangle defined by xsource,ysource and width,height from the source drawable, and places the results at xdest,ydest in the drawable in which this function is called.
GDK2.Drawable draw_arc(GTK2.GdkGC gc, int filledp, int x1, int y1, int x2, int y2, int angle1, int angle2)
Draws a single circular or elliptical arc. Each arc is specified by a rectangle and two angles. The center of the circle or ellipse is the center of the rectangle, and the major and minor axes are specified by the width and height. Positive angles indicate counterclockwise motion, and negative angles indicate clockwise motion. If the magnitude of angle2 is greater than 360 degrees, it is truncated to 360 degrees.
GDK2.Drawable draw_bitmap(GTK2.GdkGC gc, GTK2.GdkBitmap bitmap, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw a GDK2(Bitmap) in this drawable. NOTE: This drawable must be a bitmap as well. This will be fixed in GTK 1.3
GDK2.Drawable draw_image(GTK2.GdkGC gc, GTK2.GdkImage image, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw the rectangle specified by xsrc,ysrc+width,height from the GDK2(Image) at xdest,ydest in the destination drawable
GDK2.Drawable draw_line(GTK2.GdkGC gc, int x1, int y1, int x2, int y2)
img_begin w = GTK2.DrawingArea()->set_size_request(100,100); delay: g = GDK2.GC(w)->set_foreground( GDK2.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_line(g,x*10,0,100-x*10,99); img_end
GDK2.Drawable draw_pixbuf(GTK2.GdkGC gc, GTK2.GdkPixbuf pixbuf, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw a GDK2(Pixbuf) in this drawable.
GDK2.Drawable draw_pixmap(GTK2.GdkGC gc, GTK2.GdkPixmap pixmap, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draw the rectangle specified by xsrc,ysrc+width,height from the GDK2(Pixmap) at xdest,ydest in the destination drawable
GDK2.Drawable draw_point(GTK2.GdkGC gc, int x, int y)
img_begin w = GTK2.DrawingArea()->set_size_request(10,10); delay: g = GDK2.GC(w)->set_foreground( GDK2.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_point(g, x, x); img_end
GDK2.Drawable draw_rectangle(GTK2.GdkGC gc, int filledp, int x1, int y1, int x2, int y2)
img_begin w = GTK2.DrawingArea()->set_size_request(100,100); delay: g = GDK2.GC(w)->set_foreground( GDK2.Color(255,0,0) ); delay: for(int x = 0; x<10; x++) w->draw_rectangle(g,0,x*10,0,100-x*10,99); img_end img_begin w = GTK2.DrawingArea()->set_size_request(100,100); delay: g = GDK2.GC(w); delay: for(int x = 0; x<30; x++) { delay: g->set_foreground(GDK2.Color(random(255),random(255),random(255)) ); delay: w->draw_rectangle(g,1,x*10,0,100-x*10,99); delay: } img_end
GDK2.Drawable draw_text(GTK2.GdkGC gc, int x, int y, string|PangoLayout text)
y is used as the baseline for the text.
mapping get_geometry()
Get width, height position and depth of the drawable as a mapping.
([ "x":xpos, "y":ypos, "width":xsize, "height":ysize, "depth":bits_per_pixel ])
inherit G.Object : Object
GDK2.Drawable set_background(GTK2.GdkColor to)
Set the background color or image. The argument is either a GDK2.Pixmap or a GDK2.Color object.
int xid()
Return the xwindow id.
int xsize()
Returns the width of the drawable specified in pixels
int ysize()
Returns the height of the drawable specified in pixels
CLASS GTK2.GdkEvent |
Gdk events.
protected mixed _index(string ind)
Return an index.
(mapping)GTK2.GdkEvent()
Cast to different types.
CLASS GTK2.GdkGC |
A GC, or Graphics Context, is used for most low-level drawing operations.
As an example, the foreground color, background color, and drawing function is stored in the GC.
NOIMG
GDK2.GC copy(GTK2.GdkGC source)
Copy all attributes from the source GC
GTK2.GdkGC GTK2.GdkGC(GTK2.Widget context, mapping|void attributes)
The argument is either a W(Widget) or a GDK2(Drawable) in which the gc will be valid.
GTK2.GdkScreen get_screen()
Gets the screen.
mapping get_values()
Get all (or rather most) values from the GC. Even though GdkGCValues contains a GdkFont object, we won't return this value because GdkFont is deprecated. The Pango methods should be used instead.
inherit G.Object : Object
GDK2.GC set_background(GTK2.GdkColor color)
Set the background to the specified GDK2.Color.
GDK2.GC set_clip_mask(GTK2.GdkBitmap mask)
Set the clip mask to the specified GDK2.Bitmap
GDK2.GC set_clip_origin(int x, int y)
Set the clip mask origin to the specified point.
GDK2.GC set_clip_rectangle(GTK2.GdkRectangle rect)
Sets the clip mask for a graphics context from a rectangle. The clip mask is interpreted relative to the clip origin.
GDK2.GC set_clip_region(GTK2.GdkRegion rect)
Sets the clip mask for a graphs context from a region. The clip mask is interpreted relative to the clip origin.
GDK2.GC set_dashes(int offset, array dashes)
Sets the way dashed-lines are drawn. Lines will be drawn with alternating on and off segments of the lengths specified in dashes. The manner in which the on and off segments are drawn is determined by the line_style value of the GC.
GDK2.GC set_exposures(int exp)
Sets whether copying non-visible portions of a drawable using this gc generates exposure events for the corresponding regions of the dest drawable.
GDK2.GC set_fill(int fill)
Set the fill method to fill.
GDK2.GC set_foreground(GTK2.GdkColor color)
Set the foreground to the specified GDK2.Color.
GDK2.GC set_function(int fun)
Set the function to the specified one. One of GDK2.Xor, GDK2.Invert and GDK2.Copy.
GDK2.GC set_line_attributes(int line_width, int line_style, int cap_style, int join_style)
Control how lines are drawn. line_style is one of GDK2.LineSolid, GDK2,LineOnOffDash and GDK2.LineDoubleDash. cap_style is one of GDK2.CapNotLast, GDK2.CapButt, GDK2.CapRound and GDK2.CapProjecting. join_style is one of GDK2.JoinMiter, GDK2.JoinRound and GDK2.JoinBevel.
GDK2.GC set_stipple(GTK2.GdkBitmap stipple)
Set the background type. Fill must be GDK_STIPPLED or GDK_OPAQUE_STIPPLED.
GDK2.GC set_subwindow(int draw_on_subwindows)
If set, anything drawn with this GC will draw on subwindows as well as the window in which the drawing is done.
GDK2.GC set_tile(GTK2.GdkPixmap tile)
Set the background type. Fill must be GDK_TILED
GDK2.GC set_ts_origin(int x, int y)
Set the origin when using tiles or stipples with the GC. The tile or stipple will be aligned such that the upper left corner of the tile or stipple will coincide with this point.
CLASS GTK2.GdkImage |
A gdk (low level) image. Mainly used for W(Image) objects.
NOIMG
GTK2.GdkImage GTK2.GdkImage(int|void fast_mode, Image.Image|void image)
Create a new GDK2.Image object. The first argument is either 0, which indicates that you want a 'slow' image. If you use '1', you indicate that you want a 'fast' image. Fast images are stored in shared memory, and thus are not sent over any network. But please limit your usage of fast images, they use up a possibly limited system resource set. See the man page for shmget(2) for more information on the limits on shared segments on your system.
A 'fast' image will automatically revert back to 'slow' mode if no shared memory is available.
If the second argument is specified, it is the actual image data.
int get_pixel(int x, int y)
Get the pixel value of a pixel as a X-pixel value. It is usualy not very easy to convert this value to a rgb triple. See get_pnm.
string get_pnm()
Returns the data in the image as a pnm object. Currently, this is always a P6 (true color raw) image. This could change in the future. To get a pike image object do 'Image.PNM.decode( gdkimage->get_pnm() )'
GDK2.Image grab(GTK2.Widget widget, int xoffset, int yoffset, int width, int height)
Call this function to grab a portion of a widget (argument 1) to the image. Grabbing non-toplevel widgets may produce unexpected results. To get the size of a widget use ->xsize() and ->ysize(). To get the offset of the upper left corner of the widget, relative to it's X-window (this is what you want for the offset arguments), use ->xoffset() and ->yoffset().
inherit G.Object : Object
GDK2.Image set(Image.Image|int image_or_xsize, int|void ysize)
Call this to set this image to either the contents of a pike image or a blank image of a specified size.
GDK2.Image set_pixel(int x, int y, int pixel)
Set the pixel value of a pixel. Please note that the pixel argument is a X-pixel value, which is not easily gotten from a RGB color. See get_pixel and set.
CLASS GTK2.GdkPixbuf |
Properties: int bits-per-sample int colorspace (GdkColorspace) int has-alpha int height int n-channels object pixels int rowstride int width
GTK2.GdkPixbuf add_alpha(int substitute_color, int r, int g, int b)
Adds an alpha channel to this pixbuf and returns a copy. If it already has an alpha channel, the channel values are copied from the original; otherwise, the alpha channel is initialized to 255 (full opacity). If substitute_color is true, then the color specified by (r,g,b) will be assigned zero opacity. That is, if you pass (255,255,255) for the substitute color, all white pixels will become fully transparent.
GTK2.GdkPixbuf composite(GTK2.GdkPixbuf dest, int dest_x, int dest_y, int dest_width, int dest_height, float offset_x, float offset_y, float scale_x, float scale_y, int type, int overall_alpha)
Creates a transformation of the source image by scalling by scale_x and scale_y, then translating by offset_x and offset_y. This gives an image in the coordinates of the destination pixbuf. The rectangle (dest_x,dest_y,dest_width,dest_height) is then composited onto the corresponding rectangle of the original destination image. when the destination rectangle contain parts not in the source image, the data at the edges of the source image is replicated to infinity.
GTK2.GdkPixbuf composite_color(GTK2.GdkPixbuf dest, int dest_x, int dest_y, int dest_width, int dest_height, float offset_x, float offset_y, float scale_x, float scale_y, int type, int overall_alpha, int check_x, int check_y, int check_size, int color1, int color2)
Creates a transformation of the source image by scaling by scale_x and scale_y, then translating by offset_x and offset_y, then composites the rectangle (dest_x,dest_y,dest_width,dest_height) of the resulting image with a checkboard of the colors color1 and color2 and renders it onto the destinagion image.
See composite_color_simple() for a simpler variant of this function suitable for many tasks.
GTK2.GdkPixbuf composite_color_simple(int dest_width, int dest_height, int type, int overall_alpha, int check_size, int color1, int color2)
Creates a new W(Pixbuf) by scalling src to dest_width x dest_height and compositing the result with a checkboard of colors color1 and color2.
GTK2.GdkPixbuf copy()
Creates a new GDK2.Pixbuf with a copy of this one.
GTK2.GdkPixbuf copy_area(GTK2.GdkPixbuf dest, int src_x, int src_y, int widt, int height, int dest_x, int dest_y)
Copies a rectangular area from this pixbuf to dest. Conversion of pixbuf formats is done automatically.
GTK2.GdkPixbuf GTK2.GdkPixbuf(string|mapping options)
Create a GDK2.Pixbuf object.
options is either a filename or a mapping of options.
If it is a mapping, it may contain:
|
The following is additional keys may exist if the member
"data"
exists:
|
GTK2.GdkPixbuf flip(int horizontal)
Flips a pixbuf horizontally or vertically and returns the result in a new pixbuf.
int get_bits_per_sample()
Queries the number of bits per color sample.
int get_colorspace()
Queries the color space.
int get_has_alpha()
Queries whether a pixbuf has an alpha channel.
int get_height()
Queries the height.
int get_n_channels()
Queries the number of channels.
string get_option(string key)
Looks up key in the list of options that may have been attached to the pixbuf when it was loaded.
string get_pixels()
Returns the pixel data as a string.
int get_rowstride()
Queries the rowstride of a pixbuf, which is the number of bytes between the start of a row and the start of the next row.
int get_width()
Queries the width.
inherit G.Object : Object
GTK2.GdkPixbuf new_subpixbuf(int src_x, int src_y, int width, int height)
Creates a new pixbuf which represents a sub-region of src. The new pixbuf shares its pixels with the original pixbuf, so writing to one affects both. The new pixbuf holds a reference to this one, so this object will not be finalized until the new pixbuf is finalized.
int put_pixel(int x, int y, int r, int g, int b)
Set pixel to value.
GTK2.GdkBitmap render_threshold_alpha(int src_x, int src_y, int dest_c, int dest_y, int width, int height, int alpha_threshold)
Takes the opacity values in a rectangular portion of a pixbuf and thresholds them to produce a bi-level alpha mask that can be used as a clipping mask for a drawable.
GTK2.GdkPixbuf rotate_simple(int angle)
Rotates a pixbuf by a multiple of 90 degrees, and returns the result in a new pixbuf. angle is either a multiple of 90 degrees (0,90,180,270), or one of GDK_PIXBUF_ROTATE_CLOCKWISE, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE, GDK_PIXBUF_ROTATE_NONE and GDK_PIXBUF_ROTATE_UPSIDEDOWN, which are merely aliases.
GDK2.Pixbuf saturate_and_pixelate(GTK2.GdkPixbuf dest, float saturation, int pixelate)
Modifes saturation and optionally pixelates this pixbuf, placing the result in dest. The source and dest may be the same pixbuf with no ill effects. If saturation is 1.0 then saturation is not changed. If it's less than 1.0, saturation is reduced (the image is darkened); if greater than 1.0, saturation is increased (the image is brightened). If pixelate is true, then pixels are faded in a checkerboard pattern to create a pixelated image. This pixbuf and dest must have the same image format, size, and rowstride.
GTK2.GdkPixbuf save(string filename, string type, mapping|void options)
Save to a file in format type. "jpeg", "png", "ico", "bmp", are the only valid writable types at this time. Quality is only valid for jpeg images.
GTK2.GdkPixbuf scale(GTK2.GdkPixbuf dest, int dest_x, int dest_y, int dest_width, int dest_height, float offset_x, float offset_y, float scale_x, float scale_y, int type)
Creates a transformation of the source image by scaling by scale_x and scale_y, then translating by offset_x and offset_y, then renders the rectangle (dest_x,dest_y,dest_width,dest_height) of the resulting image onto the destination image replacing the previous contents. Try to use scale_simple() first, this function is the industrial- strength power tool you can fall back to if scale_simple() isn't powerful enough.
GTK2.GdkPixbuf scale_simple(int dest_width, int dest_height, int|void interp_type)
Create a new W(Pixbuf) containing a copy of this W(Pixbuf) scaled to dest_width x dest_height. Leaves this W(Pixbuf) unaffected. intertype should be GDK2.INTERP_NEAREST if you want maximum speed (but when scaling down GDK2.INTERP_NEAREST is usually unusably ugly). The default interp_type should be GDK2.INTERP_BILINEAR which offers reasonable quality and speed. You can scale a sub-portion by create a sub-pixbuf with new_subpixbuf().
int set_alpha(int x, int y, int setting)
Set alpha value.
int set_option(string key, string value)
Attaches a key/value pair as an option. If the key already exists in the list of options, the new value is ignored.
CLASS GTK2.GdkPixbufAnimation |
The GdkPixbufAnimation object. Holds animations, like gifs.
GTK2.GdkPixbufAnimation GTK2.GdkPixbufAnimation(string filename)
Create a new PixbufAnimation.
int get_height()
Returns the height of the bounding box.
GTK2.GdkPixbufAnimationIter get_iter()
Get an iterator for displaying an animation. The iterator provides the frames that should be displayed at a given time.
Returns the beginning of the animation. Afterwards you should probably immediately display the pixbuf return by GDK2.PixbufAnimationIter->get_pixbuf(). Then, you should install a timeout or by some other mechanism ensure that you'll update the image after GDK2.PixbufAnimationIter->get_delay_time() milliseconds. Each time the image is updated, you should reinstall the timeout with the new, possibly changed delay time.
To update the image, call GDK2.PixbufAnimationIter->advance().
GTK2.GdkPixbuf get_static_image()
If an animation is really just a plain image (has only one frame), this function returns that image. If the animation is an animation, this function returns reasonable thing to display as a static unanimated image, which might be the first frame, or something more sophisticated. If an animation hasn't loaded any frames yet, this function will return 0.
int get_width()
Returns the width of the bounding box.
inherit G.Object : Object
int is_static_image()
If the file turns out to be a plain, unanimated image, this function will return true. Use get_static_image() to retrieve the image.
CLASS GTK2.GdkPixbufAnimationIter |
An iterator for a PixbufAnimation.
int advance()
Possibly advance an animation to a new frame.
int get_delay_time()
Gets the number of milliseconds the current pixbuf should be displayed, or -1 if the current pixbuf should be displayed forever.
GTK2.GdkPixbuf get_pixbuf()
Gets the current pixbuf which should be displayed; the pixbuf will be the same size as the animation itself (GDK2.PixbufAnimation->get_width(), GDK2.PixbufAnimation->get_height()). This pixbuf should be displayed for get_delay_time() milliseconds.
inherit G.Object : Object
int on_currently_loading_frame()
Used to determine how to respond to the area_updated signal on GDK2.PixbufLoader when loading an animation.
CLASS GTK2.GdkPixmap |
This class creates a GDK2.Pixmap from either an GDK2.Image or Image.image object (or a numeric ID, see your X-manual for XIDs). The GDK2.Pixmap object can be used in a lot of different GTK widgets. The most notable is the W(Pixmap) widget.
NOIMG
GTK2.GdkPixmap GTK2.GdkPixmap(int|object image)
Create a new GDK2.Pixmap object. Argument is a GDK2.Image object or a Image.Image object
inherit GDK2.Drawable : Drawable
GDK2.Pixmap ref()
Ref this object.
GDK2.Pixmap set(GTK2.GdkImage image)
Argument is a GDK2.Image object or an Image.image object. It is much faster to use an gdkImage object, especially one allocated in shared memory. This is only an issue if you are going to change the contents of the pixmap often, toggling between a small number of images.
GDK2.Pixmap unref()
Unref this object.
CLASS GTK2.GdkRectangle |
Rectangle class.
(int)GTK2.GdkRectangle()
(float)GTK2.GdkRectangle()
(string)GTK2.GdkRectangle()
(array)GTK2.GdkRectangle()
(mapping)GTK2.GdkRectangle()
(multiset)GTK2.GdkRectangle()
Normally used like (mapping)rectangle or (array)rectangle.
GTK2.GdkRectangle GTK2.GdkRectangle(int x, int y, int width, int height)
Create a new rectangle
NOIMG
GDK2.Rectangle set(int x, int y, int width, int height)
Set the upper left corner and the size of the rectangle.
CLASS GTK2.GdkRegion |
Region information.
GTK2.GdkRegion GTK2.GdkRegion()
Create a new (empty) region
NOIMG
int equal(GTK2.GdkRegion victim)
Return true if the region used as an argument is equal to the current region. Also available as a==b when a is a region.
GTK2.GdkRegion intersect(GTK2.GdkRegion victim)
Computes the intersection of the given region and the region. Also available as region & region
GDK2.Region offset(int dx, int dy)
Offset(move) the region by dx,dy pixels.
int point_in(int x, int y)
Returns true if the given point resides in the given region
int rect_in(GTK2.GdkRectangle r)
Returns true if the given rectangle resides inside the given region
GDK2.Region shrink(int dx, int dy)
reduces the size of a region by a specified amount. Positive values shrink the size of the region, and negative values expand the region.
GTK2.GdkRegion subtract(GTK2.GdkRegion victim)
Computes the difference of the given region and the region. Also available as region - region
GTK2.GdkRegion union(GTK2.GdkRegion victim)
Computes the union of the given rectangle or region and the region. Also available as region | rectangle, region | region, region + region and region + rectangle.
GTK2.GdkRegion xor(GTK2.GdkRegion victim)
Computes the exlusive or of the given region and the region. Also available as region ^ region
CLASS GTK2.GdkScreen |
Properties: font-options float resolution
Signals: composite_changed
size_changed
GTK2.GdkScreen GTK2.GdkScreen()
Gets the default screen.
GTK2.GdkWindow get_active_window()
Returns the currently active window.
GTK2.GdkColormap get_default_colormap()
Gets the default colormap.
GTK2.GdkDisplay get_display()
Gets the display to which this screen belongs.
int get_height()
Gets the height in pixels.
int get_height_mm()
Returns the height in millimeters.
int get_monitor_at_point(int x, int y)
Returns the monitor number in which x,y is located.
int get_monitor_at_window(GTK2.GdkWindow window)
Returns the number of the monitor in which the largest area of the bounding rectangle of window resides.
GTK2.GdkRectangle get_monitor_geometry(int num)
Retrieves the GDK2.Rectangle representing the size and position of the individual monitor within the entire screen area.
int get_n_monitors()
Returns the number of monitors which this screen consists of.
int get_number()
Gets the index of this screen among the screens in the display to which it belongs.
float get_resolution()
Gets the resolution for font handling.
GTK2.GdkColormap get_rgb_colormap()
Gets the preferred colormap for rendering image data.
GTK2.GdkVisual get_rgb_visual()
Get a "preferred visual" chosen by GdkRGB for rendering image data.
GTK2.GdkColormap get_rgba_colormap()
Gets a colormap to use for creating windows or pixmaps with an alpha channel.
GTK2.GdkVisual get_rgba_visual()
Gets a visual to use for creating windows or pixmaps with an alpha channel.
GTK2.GdkWindow get_root_window()
Gets the root window.
GTK2.GdkColormap get_system_colormap()
Gets the system default colormap.
GTK2.GdkVisual get_system_visual()
Get the default system visual.
array get_toplevel_windows()
Returns a list of all toplevel windows known to GDK on the screen.
int get_width()
Gets the width of the screen in pixels.
int get_width_mm()
Gets the width in millimeters.
inherit G.Object : Object
int is_composited()
Returns whether windows with an RGBA visual can reasonable be expected to have their alpha channel drawn correctly on the screen.
array list_visuals(int|void def)
List the available visuals. If def is true, return the available visuals for the default screen.
string make_display_name()
Determines the name to pass to GDK2.Display->open() to get a GDK2.Display with this screen as the default screen.
GDK2.Screen set_default_colormap(GTK2.GdkColormap colormap)
Sets the default colormap.
GDK2.Screen set_resolution(float dpi)
Sets the resolution for font handling.
CLASS GTK2.GdkVisual |
A GdkVisual describes a particular video hardware display format. It includes information about the number of bits used for each color, the way the bits are translated into an RGB value for display, and the way the bits are stored in memory.
GTK2.GdkVisual GTK2.GdkVisual(int|void best, int|void depth, int|void type)
If best is false the systems default GDK screen is returned, otherwise the screen that best fulfills the given depth and type. If none is given, the one with most colors is selected.
The requested bit depth, or 0.
The requested visual type.
|
GTK2.GdkScreen get_screen()
Gets the screen to which this visual belongs.
inherit G.Object : Object
CLASS GTK2.GdkWindow |
a GDK2.Window object.
NOIMG
GDK2.Window change_property(GDK2.Atom property, GDK2.Atom type, int mode, string data)
mode is one of GDK_PROP_MODE_APPEND, GDK_PROP_MODE_PREPEND and GDK_PROP_MODE_REPLACE
array children()
Returns an array of GDK2.Window objects.
GTK2.GdkWindow GTK2.GdkWindow(GTK2.GdkWindow parent, mapping|void attributes)
Not for non-experts. I promise.
GDK2.Window delete_property(GDK2.Atom a)
Delete a property.
mapping get_geometry()
Returns ([ "x":xpos, "y":ypos, "width":width, "height":height, "depth":bits_per_pixel ])
mapping get_property(GDK2.Atom atom, int|void offset, int|void delete_when_done)
Returns the value (as a string) of the specified property. The arguments are:
property: The property atom, as an example GDK2.Atom.__SWM_VROOT offset (optional): The starting offset, in elements delete_when_done (optional): If set, the property will be deleted when it has been fetched.
Example usage: Find the 'virtual' root window (many window managers put large windows over the screen)
GDK2.Window root = GTK.root_window();
array maybe=root->children()->
get_property(GDK2.Atom.__SWM_VROOT)-({0});
if(sizeof(maybe))
root=GDK2.Window( maybe[0]->data[0] );
GDK2.Window grab_input_focus()
Forcibly grab the input focus.
Useful for override-redirect windows in games. Note that the only way to get rid of the focus is to close the window, be careful.
inherit GDK2.Drawable : Drawable
int is_viewable()
Return 1 if the window is mapped.
int is_visible()
Return 1 if the window, or a part of the window, is visible right now.
GDK2.Window lower()
Lower this window if the window manager allows that.
GDK2.Window move_resize(int x, int y, int w, int h)
Move and resize the window in one call.
GDK2.Window raise()
Raise this window if the window manager allows that.
GDK2.Window set_background(GTK2.GdkColor to)
Set the background color or image. The argument is either a GDK2.Pixmap or a GDK2.Color object.
GDK2.Window set_bitmap_cursor(GTK2.GdkBitmap image, GTK2.GdkBitmap mask, GTK2.GdkColor fg, GTK2.GdkColor bg, int xhot, int yhot)
xhot,yhot are the locations of the x and y hotspot relative to the upper left corner of the cursor image.
GDK2.Window set_cursor(int new_cursor)
Change the window cursor.<table border="0" cellpadding="3" cellspacing="0"> CURS(GDK2.Arrow) CURS(GDK2.BasedArrowDown) CURS(GDK2.BasedArrowUp) CURS(GDK2.Boat) CURS(GDK2.Bogosity) CURS(GDK2.BottomLeftCorner) CURS(GDK2.BottomRightCorner) CURS(GDK2.BottomSide) CURS(GDK2.BottomTee) CURS(GDK2.BoxSpiral) CURS(GDK2.CenterPtr) CURS(GDK2.Circle) CURS(GDK2.Clock) CURS(GDK2.CoffeeMug) CURS(GDK2.Cross) CURS(GDK2.CrossReverse) CURS(GDK2.Crosshair) CURS(GDK2.DiamondCross) CURS(GDK2.Dot) CURS(GDK2.Dotbox) CURS(GDK2.DoubleArrow) CURS(GDK2.DraftLarge) CURS(GDK2.DraftSmall) CURS(GDK2.DrapedBox) CURS(GDK2.Exchange) CURS(GDK2.Fleur) CURS(GDK2.Gobbler) CURS(GDK2.Gumby) CURS(GDK2.Hand1) CURS(GDK2.Hand2) CURS(GDK2.Heart) CURS(GDK2.Icon) CURS(GDK2.IronCross) CURS(GDK2.LeftPtr) CURS(GDK2.LeftSide) CURS(GDK2.LeftTee) CURS(GDK2.Leftbutton) CURS(GDK2.LlAngle) CURS(GDK2.LrAngle) CURS(GDK2.Man) CURS(GDK2.Middlebutton) CURS(GDK2.Mouse) CURS(GDK2.Pencil) CURS(GDK2.Pirate) CURS(GDK2.Plus) CURS(GDK2.QuestionArrow) CURS(GDK2.RightPtr) CURS(GDK2.RightSide) CURS(GDK2.RightTee) CURS(GDK2.Rightbutton) CURS(GDK2.RtlLogo) CURS(GDK2.Sailboat) CURS(GDK2.SbDownArrow) CURS(GDK2.SbHDoubleArrow) CURS(GDK2.SbLeftArrow) CURS(GDK2.SbRightArrow) CURS(GDK2.SbUpArrow) CURS(GDK2.SbVDoubleArrow) CURS(GDK2.Shuttle) CURS(GDK2.Sizing) CURS(GDK2.Spider) CURS(GDK2.Spraycan) CURS(GDK2.Star) CURS(GDK2.Target) CURS(GDK2.Tcross) CURS(GDK2.TopLeftArrow) CURS(GDK2.TopLeftCorner) CURS(GDK2.TopRightCorner) CURS(GDK2.TopSide) CURS(GDK2.TopTee) CURS(GDK2.Trek) CURS(GDK2.UlAngle) CURS(GDK2.Umbrella) CURS(GDK2.UrAngle) CURS(GDK2.Watch) CURS(GDK2.Xterm) </table>
GDK2.Window set_events(int events)
events is a bitwise or of one or more of the following constants: GDK2.ExposureMask, GDK2.PointerMotionMask, GDK2.PointerMotion_HINTMask, GDK2.ButtonMotionMask, GDK2.Button1MotionMask, GDK2.Button2MotionMask, GDK2.Button3MotionMask, GDK2.ButtonPressMask, GDK2.ButtonReleaseMask, GDK2.KeyPressMask, GDK2.KeyReleaseMask, GDK2.EnterNotifyMask, GDK2.LeaveNotifyMask, GDK2.FocusChangeMask, GDK2.StructureMask, GDK2.PropertyChangeMask, GDK2.VisibilityNotifyMask, GDK2.ProximityInMask, GDK2.ProximityOutMask and GDK2.AllEventsMask
GDK2.Window set_icon(GTK2.GdkPixmap pixmap, GTK2.GdkBitmap mask, GTK2.GdkWindow window)
Set the icon to the specified image (with mask) or the specified GDK2.Window. It is up to the window manager to display the icon. Most window manager handles window and pixmap icons, but only a few can handle the mask argument. If you want a shaped icon, the only safe bet is a shaped window.
GDK2.Window set_icon_name(string name)
Set the icon name to the specified string.
GDK2.Window shape_combine_mask(GTK2.GdkBitmap mask, int xoffset, int yoffset)
Set the shape of the widget, or, rather, it's window, to that of the supplied bitmap.
CLASS GTK2.Gdk_Atom |
An X-atom. You most likely want to use GDK2.Atom.atom_name instead of GDK2._Atom(name).
GTK2.Gdk_Atom GTK2.Gdk_Atom(string atom_name, int|void only_if_exists)
Create a new low-level atom. You should normally not call this function directly. Use GDK2.Atom[name] instead of GDK2._Atom(name,0).
string get_name()
Returns the name of the atom.
CLASS GTK2.GladeXML |
Glade is a free GUI builder for GTK2+ and Gnome. It's normally used to create C-code, but can also produce code for other languages. Libglade is a utility library that builds the GI from the Glade XML save files. This module uses libglade and allows you to easily make GUI designs to be used with your Pike applications.
GTK2.GladeXML GTK2.GladeXML(string filename_or_buffer, int|void size, string|void root, string|void domain)
Creates a new GladeXML object (and the corresponding widgets) from the XML file. Optionally it will only build the interface from the widget node root. This feature is useful if you only want to build say a toolbar or menu from the XML file, but not the window it is embedded in. Note also that the XML parse tree is cached to speed up creating another GladeXML object from the same file. The third optional argument is used to specify a different translation domain from the default to be used. If xml description is in a string buffer instead, specify the size (or -1 to auto-calculate). If size is 0, then it will assume a file with root and/or domain specified.
int get_signal_id(GTK2.Widget widget)
Used to get the signal id attached to a GladeXML object.
GTK2.Widget get_widget(string name)
This function is used to get the widget corresponding to name in the interface description. You would use this if you have to do anything to the widget after loading.
string get_widget_name(GTK2.Widget widget)
Used to get the name of a widget that was generated by a GladeXML object.
array get_widget_prefix(string name)
This function is used to get a list GTK2.Widgets with names that start with the string name in the interface description.
inherit G.Object : Object
GTK2.GladeXML signal_autoconnect(mapping callbacks, mixed data)
Try to connect functions to all signals in the interface. The mapping should consist of handler name : function pairs. The data argument will be saved and sent as the first argument to all callback functions.
CLASS GTK2.Gnome2App |
Toplevel GNOME applications would normally use one Gnome2.App widget as their toplevel window. You can create as many Gnome2.App widgets as you want, for example, some people use one GnomeApp per document their application loads.
Once you have created one instance of this widget, you would add your main application view information to this window by using set_contents() routine.
The GnomeApp has support for including a menubar, one or more toolbars and a statusbar for your application. It also takes care of intalling the accelerators for you when used in conjuction with the gnome-app-helper routines. The toolbars are inserted into Gnome2.Dock widgets.
The gnome-app-helper module provides various helper routines to simplify the configuration of your menus and toolbars, but you can create those yourself and use the set_menus(), add_toolbar(), set_toolbar(), add_dock_item() and add_docked(). Properties: string app-id
Gnome2.App add_docked(GTK2.Widget widget, string name, int behavior, int placement, int band_num, int band_position, int|void offset)
Create a new Gnome2.DockItem widget containing widget, and add it to app's dock with the specified layout information. Notice that, if automatic layout configuration is enabled, the layout is overridden by the saved configuration, if any.
widget : Widget to be added to app's dock name : Name for the dock item that will contain toolbar behavior : Behavior for the new dock item. One of GNOME_DOCK_ITEM_BEH_EXCLUSIVE, GNOME_DOCK_ITEM_BEH_LOCKED, GNOME_DOCK_ITEM_BEH_NEVER_FLOATING, GNOME_DOCK_ITEM_BEH_NEVER_HORIZONTAL, GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL and GNOME_DOCK_ITEM_BEH_NORMAL placement : Placement for the new dock item, one of Gnome2.DockTop, Gnome2.DockRight, Gnome2.DockBottom, Gnome2.DockLeft and Gnome2.DockFloating band_num : Number of the band where the dock item should be placed band_position : Position of the new dock item in band band_num offset : Offset from the previous dock item in the band; if there is no previous item, offset from the beginning of the band.
Gnome2.App add_toolbar(GTK2.Toolbar toolbar, string name, int behavior, int placement, int band_num, int band_position, int|void offset)
Create a new Gnome2.DockItem widget containing toolbar, and add it to app's dock with the specified layout information. Notice that, if automatic layout configuration is enabled, the layout is overridden by the saved configuration, if any.
toolbar : Toolbar to be added to app's dock name : Name for the dock item that will contain toolbar behavior : Behavior for the new dock item. One or more of GNOME_DOCK_ITEM_BEH_EXCLUSIVE, GNOME_DOCK_ITEM_BEH_LOCKED, GNOME_DOCK_ITEM_BEH_NEVER_FLOATING, GNOME_DOCK_ITEM_BEH_NEVER_HORIZONTAL, GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL and GNOME_DOCK_ITEM_BEH_NORMAL placement : Placement for the new dock item, one of Gnome2.DockTop, Gnome2.DockRight, Gnome2.DockBottom, Gnome2.DockLeft and Gnome2.DockFloating band_num : Number of the band where the dock item should be placed band_position : Position of the new dock item in band band_num offset : Offset from the previous dock item in the band; if there is no previous item, offset from the beginning of the band.
GTK2.Gnome2App GTK2.Gnome2App(string appname, string|void title)
Create a new (empty) application window. You must specify the application's name (used internally as an identifier). title can be left as 0, in which case the window's title will not be set.
Gnome2.App enable_layout_config(int enable)
Specify whether the the dock's layout configuration should be automatically saved via gnome-config whenever it changes, or not.
inherit GTK2.Window : Window
Gnome2.App set_contents(GTK2.Widget contents)
Sets the status bar of the application window.
Gnome2.App set_menus(GTK2.MenuBar menu_bar)
Sets the menu bar of the application window.
Gnome2.App set_statusbar(GTK2.Widget statusbar)
Sets the status bar of the application window.
Gnome2.App set_statusbar_custom(GTK2.Widget container, GTK2.Widget statusbar)
Sets the status bar of the application window, but use container as its container.
Gnome2.App set_toolbar(GTK2.Toolbar toolbar)
Sets the main toolbar of the application window.
CLASS GTK2.Gnome2Appbar |
A bar that GNOME applications put on the bottom of the windows to
display status, progress, hints for menu items or a minibuffer for
getting some sort of response. It has a stack for status messages
GTK2.Gnome2Appbar( 1, 1, GTK2.GNOME_PREFERENCES_USER )->set_progress_percentage( 0.4 );
Properties: int has-progress int has-status int interactivity
Signals: clear_prompt Emitted when the prompt is cleared. mixed user_data
user_response Emitted when the user hits enter after a prompt. mixed user_data
Gnome2.Appbar clear_prompt()
Remove any prompt.
Gnome2.Appbar clear_stack()
Remove all status messages from appbar, and display default status message (if present).
GTK2.Gnome2Appbar GTK2.Gnome2Appbar(int has_progress, int has_status, int interactivity)
Create a new GNOME application status bar. If has_progress is TRUE, a small progress bar widget will be created, and placed on the left side of the appbar. If has_status is TRUE, a status bar, possibly an editable one, is created.
interactivity determines whether the appbar is an interactive "minibuffer" or just a status bar. If it is set to Gnome2.PREFERENCES_NEVER, it is never interactive. If it is set to Gnome2.PREFERENCES_USER we respect user preferences from ui-properties. If it's Gnome2.PREFERENCES_ALWAYS we are interactive whether the user likes it or not. Basically, if your app supports both interactive and not (for example, if you use the gnome-app-util interfaces), you should use Gnome2.PREFERENCES_USER. Otherwise, use the setting you support. Please note that "interactive" mode is not functional now; GtkEntry is inadequate and so a custom widget will be written eventually.
GTK2.ProgressBar get_progress()
Returns GTK2.ProgressBar widget pointer, so that the progress bar may be manipulated further.
string get_response()
Get the response to the prompt, if any.
GTK2.Widget get_status()
Retrieves the statusbar widget.
inherit GTK2.Hbox : Hbox
Gnome2.Appbar pop()
Remove current status message, and display previous status message, if any. It is OK to call this with an empty stack.
Gnome2.Appbar push(string what)
Push a new status message onto the status bar stack, and display it.
Gnome2.Appbar refresh()
Reflect the current state of stack/default. Useful to force a set_status to disappear.
Gnome2.Appbar set_default(string default_status)
What to show when showing nothing else; defaults to "".
Gnome2.Appbar set_progress_percentage(float percentage)
Sets progress bar to the given percentage.
Gnome2.Appbar set_prompt(string prompt, int modal)
Put a prompt in the appbar and wait for a response. When the user responds or cancels, a "user-response" signal is emitted.
Gnome2.Appbar set_status(string status)
Sets the status label without changing widget state; next set or push will destroy this permanently.
CLASS GTK2.Gnome2Canvas |
Gnome2.Canvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. It offers a choice of two rendering back-ends, one based on Xlib for extremely fast display, and another based on Libart, a sophisticated, antialiased, alpha-compositing engine. This widget can be used for flexible display of graphics and for creating interactive user interface elements.
A Gnome2.Canvas widget contains one or more Gnome2.CanvasItem objects. Items consist of graphing elements like lines, ellipses, polygons, images, text, and curves. These items are organized using Gnome2.CanvasGroup objects, which are themselves derived from Gnome2.CanvasItem. Since a group is an item it can be contained within other groups, forming a tree of canvas items. Certain operations, like translating and scaling, can be performed on all items in a group. See http://developer.gnome.org/doc/API/2.0/libgnomecanvas/GnomeCanvas.html for more information. Properties: int aa
Signals: draw_background
render_background
array c2w(int cx, int cy)
Converts canvas pixel coordinates to world coordinates.
GTK2.Gnome2Canvas GTK2.Gnome2Canvas(int|void anti_alias)
Create a new Gnome2.Canvas widget. Set anti_alias to true to create a canvas in antialias mode.
int get_center_scroll_region()
Returns whether the canvas is set to center the scrolling region in the window if the former is smaller than the canvas' allocation.
GTK2.GdkColor get_color(string|void spec)
Allocates a color based on the specified X color specification. An omitted or empty string is considered transparent.
int get_color_pixel(int rgba)
Allocates a color from the RGBA value passed into this function. The alpha opacity value is discarded, since normal X colors do not support it.
int get_dither()
Returns the type of dithering used to render an antialiased canvas.
GTK2.Gnome2CanvasItem get_item_at(float x, float y)
Looks for the item that is under the specified position, which must be specified in world coordinates.
array get_scroll_offsets()
Queries the scrolling offsets of a canvas. The values are returned in canvas pixel units.
mapping get_scroll_region()
Queries the scrolling region of a canvas.
inherit GTK2.Layout : Layout
GTK2.Gnome2CanvasGroup root()
Queries the root group.
Gnome2.Canvas scroll_to(int cx, int cy)
Makes a canvas scroll to the specified offsets, given in canvas pixel units. The canvas will adjust the view so that it is not outside the scrolling region. This function is typically not used, as it is better to hook scrollbars to the canvas layout's scrolling adjustments.
Gnome2.Canvas set_center_scroll_region(int setting)
When the scrolling region of the canvas is smaller than the canvas window, e.g. the allocation of the canvas, it can be either centered on the window or simply made to be on the upper-left corner on the window.
Gnome2.Canvas set_dither(int dither)
Controls the dithered rendering for antialiased canvases. The value of dither should be GDK2.RgbDitherNone, GDK2.RgbDitherNormal, or GDK2.RgbDitherMax. The default canvas setting is GDK2.RgbDitherNormal.
Gnome2.Canvas set_pixels_per_unit(float n)
Sets the zooming factor of a canvas by specifying the number of pixels that correspond to one canvas unit.
The anchor point for zooming, i.e. the point that stays fixed and all others zoom inwards or outwards from it, depends on whether the canvas is set to center the scrolling region or not. You can contorl this using the set_center_scroll_region() function. If the canvas is set to center the scroll region, then the center of the canvas window is used as the anchor point for zooming. Otherwise, the upper-left corner of the canvas window is used as the anchor point.
Gnome2.Canvas set_scroll_region(float x1, float y1, float x2, float y2)
Sets the scrolling region of a canvas to the specified rectangle. The canvas will then be able to scroll only within this region. The view of the canvas is adjusted as appropriate to display as much of the new region as possible.
array w2c(float wx, float wy)
Converts world coordinates into canvas pixel coordinates.
array w2c_affine()
Gets the affine transform that converts from world coordinates to canvas pixel coordinates.
array w2c_d(float wx, float wy)
Converts world coordinates into canvas pixel coordinates. This version returns coordinates in floating point coordinates, for greater precision.
array window_to_world(float winx, float winy)
Converts window-relative coordinates into world coordinates. You can use this when you need to convert mouse coordinates into world coordinates, for example.
array world_to_window(float worldx, float worldy)
Converts world coordinates into window-relative coordinates.
CLASS GTK2.Gnome2CanvasBpath |
inherit Gnome2.CanvasShape : CanvasShape
CLASS GTK2.Gnome2CanvasClipgroup |
Properties: string path int wind
inherit Gnome2.CanvasGroup : CanvasGroup
CLASS GTK2.Gnome2CanvasEllipse |
inherit Gnome2.CanvasRE : CanvasRE
CLASS GTK2.Gnome2CanvasGroup |
inherit Gnome2.CanvasItem : CanvasItem
CLASS GTK2.Gnome2CanvasItem |
This is the base class for all canvas items. Canvas items are the drawing elements of a Gnome2.Canvas. Example items include lines, ellipses, polygons, images, text, curves, and even arbitary GTK+ widgets.
Properties: Gnome2.CanvasItem parent
Signals: event
inherit GTK2.Object : Object
CLASS GTK2.Gnome2CanvasLine |
Properties: float arrow-shape-a float arrow-shape-b float arrow-shape-c int cap-style string fill-color GDK2.Color fill-color-gdk int fill-color-rgba GDK2.Drawable fill-stipple int first-arrowhead int join-style int last-arrowhead int line-style Gnome2.CanvasPoints points int smooth int spline-steps int width-pixels float width-units
inherit Gnome2.CanvasItem : CanvasItem
CLASS GTK2.Gnome2CanvasPixbuf |
Properties: int anchor float height int height-in-pixels int height-set GDK2.Pixbuf pixbuf float width int width-in-pixels int width-set float x int x-in-pixels float y int y-in-pixels
inherit Gnome2.CanvasItem : CanvasItem
CLASS GTK2.Gnome2CanvasRE |
Properties: float x1 float x2 float y1 float y2
inherit Gnome2.CanvasShape : CanvasShape
CLASS GTK2.Gnome2CanvasRect |
inherit Gnome2.CanvasRE : CanvasRE
CLASS GTK2.Gnome2CanvasRichText |
Properties: int anchor int cursor-blink int cursor-visible int direction int editable int grow-height float height int indent int justification int left-margin int pixels-above-lines int pixels-below-lines int pixels-inside-wrap int right-margin string text int visible float width int wrap-mode float x float y
Signals: tag_changed
GTK2.TextBuffer get_buffer()
Get the text buffer.
inherit Gnome2.CanvasItem : CanvasItem
Gnome2.CanvasRichText set_buffer(GTK2.TextBuffer buffer)
Set the text buffer.
CLASS GTK2.Gnome2CanvasShape |
Properties: int cap-style string dash string fill-color GDK2.Color fill-color-gdk int fill-color-rgba GDK2.Drawable fill-stipple int join-style float miterlimit string outline-color GDK2.Color outline-color-gdk int outline-color-rgba GDK2.Drawable outline-stipple int width-pixels float width-units int wind
inherit Gnome2.CanvasItem : CanvasItem
CLASS GTK2.Gnome2CanvasText |
Properties: int anchor Pango.AttrList attributes int clip float clip-height float clip-width string family int family-set string fill-color GDK2.Color fill-color-gdk int fill-color-rgba GDK2.Drawable fill-stipple string font Pango.FontDescription font-dest int justification string markup int rise int rise-set float scale int scale-set int size float size-points int size-set Pango.Stretch stretch int stretch-set int strikethrough int strikethrough-set Pango.Style style int style-set string text float text-height float text-width Pango.Underline underline int underline-set Pango.Variant variant int variant-set int weight float x float x-offset float y float y-offset
inherit Gnome2.CanvasItem : CanvasItem
CLASS GTK2.Gnome2CanvasWidget |
Properties: int anchor float height int size-pixels GTK2.Widget widget float width float x float y
inherit Gnome2.CanvasItem : CanvasItem
CLASS GTK2.Gnome2Client |
Signals: connect Called once the client has been connected to the signal manager. int arg1, mixed user_data
die Called when the session manager wants the client to shut down. mixed user_data
disconnect Called when the client is disconnected from the session manager. mixed user_data
save_complete Called when the session manager has finished checkpointing all of the clients. Clients are then free to change their state. mixed user_data
save_yourself Called when either a "SaveYourself" or a "SaveYourselfPhase2" call is made by the session manager. int arg1: the phase of the "SaveYourself" command ('1' or '2'). int arg2: the data which should be saved (local, global, or both). int arg3: true if the session manager is shutting down. int arg4: how the client is allowed to interact with the user while saving. int arg5: true if this is to be a "fast" shutdown. mixed user_data
shutdown_cancelled Called if the session manager had sent a "SaveYourself" to all clients in preparation for shutting down and the shutdown was then cancelled. A client can then continue running and change its state. mixed user_data
GTK2.Gnome2Client GTK2.Gnome2Client()
Gets the master session management client.
Gnome2.Client disconnect()
Disconnect the client from the session manager.
Gnome2.Client flush()
This will force the underlying connection to the session manager to be flushed. This is useful if you have some pending changes that you want to make sure get committed.
string get_config_prefix()
Get the config prefix. This config prefix provides a suitable place to store any details about the state of the client which can not be described using the app's command line arguments (as set in the restart command).
string get_desktop_id()
Get the client ID of the desktop's current instance, i.e. if you consider the desktop as a whole as a session managed app, this returns its session ID using a gnome extension to session management. May return empty for apps not running under a recent version of gnome-session; apps should handle that case.
int get_flags()
Determine the client's status with the session manager.
string get_global_config_prefix()
Get the config prefix that will be returned by get_config_prefix() for clients which have NOT been restarted or cloned (i.e. for clients started by the user without '--sm-' options). This config prefix may be used to write the user's preferred config for these "new"clients".
You could also use this prefix as a place to store and retrieve config details that you wish to apply to ALL instances of the app. However, this practice limits the users freedom to configure each instance in a different way so it should be used with caution.
string get_id()
Returns the session management ID.
string get_previous_id()
Get the session management ID from the previous session.
inherit GTK2.Object : Object
Gnome2.Client request_phase_2()
Request the session manager to emit the "save-yourself" signal for a second time after all the clients in the session have ceased interacting with the user and entered an idle state. This might be useful if your app managers other apps and requires that they are in an idle state before saving its final data.
Gnome2.Client request_save(int save_style, int shutdown, int interact_style, int fast, int global)
Request the session manager to save the session in some way. The arguments correspond with the arguments passed to the "save-yourself" signal handler.
The save_style (GNOME_SAVE_BOTH, GNOME_SAVE_GLOBAL and GNOME_SAVE_LOCAL) indicates whether the save should affect data accessible to other users (GTK2.GNOME_SAVE_GLOBAL) or only the state visible to the current user (GTK2.GNOME_SAVE_LOCAL), or both. Setting shutdown to true will initiate a logout. The interact_style (GNOME_INTERACT_ANY, GNOME_INTERACT_ERRORS and GNOME_INTERACT_NONE) specifies which kinds of interaction will be available. Setting fast to true will limit the save to setting the session manager properties plus any essential data. Setting the value of global to true will request that all the other apps in the session do a save as well. A global save is mandatory when doing a shutdown.
Gnome2.Client save_any_dialog(GTK2.Dialog dialog)
May be called during a "save-yourself" handler to request that a (modal) dialog is presented to the user. The session manager decides when the dialog is shown, but it will not be shown it unless the session manager is sending an interaction style of GTK2.GNOME_INTERACT_ANY. "Cancel" and "Log out" buttons will be added during a shutdown.
Gnome2.Client save_error_dialog(GTK2.Dialog dialog)
May be called during a "save-yourself" handler when an error has occurred during the save.
Gnome2.Client set_clone_command(array argv)
Set a command the session manager can use to create a new instance of the application. Not implemented yet.
Gnome2.Client set_current_directory(string dir)
Set the directory to be in when running shutdown, discard, restart, etc. commands.
Gnome2.Client set_discard_command(array argv)
Provides a command to run when a client is removed from the session. It might delete session-specific config files, for example. Executing the discard command on the local host should delete the information saved as part of the session save that was in progress when the discard command was set. For example: string prefix=client->get_config_prefix(); array argv=({ "rm","-r" }); argv+=({ Gnome2.Config->get_real_path(prefix) }); client->set_discard_command(argv); Not implemented yet.
Gnome2.Client set_environment(string name, string value)
Set an environment variable to be placed in the client's environment prior to running restart, shutdown, discard, etc. commands.
Gnome2.Client set_global_config_prefix(string prefix)
Set the value used for the global config prefix. The global config prefix defaults to a name based on the name of the executable. This function allows you to set it to a different value. It should be called BEFORE retrieving the config prefix for the first time. Later calls will be ignored.
Gnome2.Client set_priority(int priority)
The gnome-session manager restarts clients in order of their priorities in a similar way to the start up ordering in SysV. This function allows the app to suggest a position in this ordering. The value should be between 0 and 99. A default value of 50 is assigned to apps that do not provide a value. The user may assign a different priority.
Gnome2.Client set_resign_command(array argv)
Some clients can be "undone", removing their effects and deleting any saved state. For example, xmodmap could register a resign command to undo the keymap changes it saved.
Used by clients that use the GTK2.GNOME_RESTART_ANYWAY restart style to undo their effects (these clients usually perform initialization functions and leave effects behind after they die). The resign command combines the effects of a shutdown command and a discard command. It is executed when the user decides that the client should cease to be restarted. Not implemented yet.
Gnome2.Client set_restart_command(array argv)
When clients crash or the user logs out and back in, they are restarted. This command should perform the restart. Executing the restart command on the local host should reproduce the state of the client at the time of the session save as closely as possible. Saving config info under the get_config_prefix() is generally useful. Not implemented yet.
Gnome2.Client set_restart_style(int style)
Tells the session manager how the client should be restarted in future sessions. One of GNOME_RESTART_ANYWAY, GNOME_RESTART_IF_RUNNING, GNOME_RESTART_IMMEDIATELY and GNOME_RESTART_NEVER
Gnome2.Client set_shutdown_command(array argv)
GTK2.GNOME_RESTART_ANYWAY clients can set this command to run when the user logs out but the client is no longer running.
Used by clients that use the GTK2.GNOME_RESTART_ANYWAY restart style to undo their effects (these clients usually perform initialization functions and leave effects behind after they die). The shutdown command simply undoes the effects of the client. It is executed during a normal logout. Not implemented yet.
CLASS GTK2.Gnome2DateEdit |
The GnomeDateEdit widget provides a way to enter dates and times
with a helper calendar to let the user select the date.
GTK2.Gnome2DateEdit(time(),1,1);
GTK2.Gnome2DateEdit(time(),0,1);
Properties: int dateedit-flags int initial-time int lower-hour int time int upper-hour
Signals: date_changed
time_changed
GTK2.Gnome2DateEdit GTK2.Gnome2DateEdit(int the_time, int show_time, int use_24_format)
Creates a new GnomeDateEdit widget which can be used to provide an easy to use way for entering dates and times.
int get_flags()
Get the flags.
int get_initial_time()
Queries the initial time that was set using set_time() or during creation.
int get_time()
Return the time entered in the widget.
inherit GTK2.Hbox : Hbox
Gnome2.DateEdit set_flags(int flags)
Bitwise or of GNOME_DATE_EDIT_24_HR, GNOME_DATE_EDIT_SHOW_TIME and GNOME_DATE_EDIT_WEEK_STARTS_ON_MONDAY.
Gnome2.DateEdit set_popup_range(int low_hour, int up_hour)
Sets the range of times that will be provide by the time popup selectors.
Gnome2.DateEdit set_time(int the_time)
Changes the displayed date and time in the GnomeDateEdit widget to be the one represented by the_time.
CLASS GTK2.Gnome2Druid |
The GNOME druid is a system for assisting the user with installing a service. It is roughly equivalent in functionality to the "Wizards" available in Windows.
There are two major parts of the druid, the Gnome2.Druid widget, and the set of W(Gnome2.DruidPage) widgets. The Gnome2.Druid widget is the main widget that interacts with the user. It has a Next, a Prev, and a Cancel button, and acts as a container for the pages. It is not a top-level window, so it needs to be put in a W(GTK2.Window) in almost all cases. The W(Gnome2.DruidPage) is a virtual widget, from which all of the actual content of the page inherits from. There are currently three of these available within gnome-libs.
GNOME druids are fairly simple to program with. You start by creating a GnomeDruid into which you put all of your pages. This widget will handle the presentation of the W(GnomeDruidPage) widgets.
You then create all appropriate W(GnomeDruidPage) widgets. There are three implementations of these, although there is no reason why more couldn't be written. They are the W(GnomeDruidPageStart), the W(GnomeDruidPageStandard), and the W(GnomeDruidPageFinish). The W(GnomeDruidPageStandard) acts as a W(Container), and is probably the most commonly used druid page. The other ones, as their names might suggest, are used at the endpoints of the druid. More information on the specific properties of these widgets can be found on their respective pages.
You will need to add the pages to the druid in order for them to appear. The druid itself keeps an internal list of all pages, and using the prepend_page(), append_page(), and insert_page() functions will place them into it.
Properties: int show-finish int show-help
Signals: cancel This signal is emitted when the "cancel" button has been pressed. Note that the current druid page has the option to trap the signal and use it, if need be, preventing this signal from being emitted.
help
Gnome2.Druid append_page(GTK2.Gnome2DruidPage page)
This will append a GnomeDruidPage into the internal list of pages that the druid has.
GTK2.Gnome2Druid GTK2.Gnome2Druid()
Create a new druid
inherit GTK2.Container : Container
Gnome2.Druid insert_page(GTK2.Gnome2DruidPage back_page, GTK2.Gnome2DruidPage page)
This will insert page after back_page into the list of internal pages that the druid has. If back_page is not present in the list or is 0, page will be prepended to the list.
Gnome2.Druid prepend_page(GTK2.Gnome2DruidPage page)
This will prepend a GnomeDruidPage into the internal list of pages that the druid has.
Gnome2.Druid set_buttons_sensitive(int back_sensitive, int next_sensitive, int cancel_sensitive, int help_sensitive)
Sets the sensitivity of the druid's control-buttons. If the variables are TRUE, then they will be clickable. This function is used primarily by the actual W(GnomeDruidPage) widgets.
Gnome2.Druid set_page(GTK2.Gnome2DruidPage page)
This will make page the currently showing page in the druid. page must already be in the druid.
Gnome2.Druid set_show_finish(int show_finish)
Sets the text on the last button on the druid. If show_finish is TRUE, then the text becomes "Finish". If show_finish is FALSE, then the text becomes "Cancel".
Gnome2.Druid set_show_help(int show_help)
Sets the "Help" button on the druid to be visible in the lower left corner of the widget, if show_help is true.
CLASS GTK2.Gnome2DruidPage |
This widget is a virtual widget to define the interface to a druid page. It's descendants are placed in a W(Gnome2.Druid) widget.
Signals: back
cancel
finish
next
prepare
int back()
This will emit the "back" signal for that particular page.
int cancel()
This will emit the "cancel" signal for that particular page.
GTK2.Gnome2DruidPage GTK2.Gnome2DruidPage()
Creates a new Gnome2.DruidPage.
Gnome2.DruidPage finish()
This emits the "finish" signal for the page.
inherit GTK2.Bin : Bin
int next()
This will emit the "next" signal for that particular page. It is called by gnome-druid exclusviely. It is expected that non-linear Druid's will override this signal and return true if it handles changing pages.
Gnome2.DruidPage prepare()
This emits the "prepare" signal for the page. It is called by gnome-druid exclusively. This function is called immediately prior to a druid page being show so that it can "prepare" for display.
CLASS GTK2.Gnome2DruidPageEdge |
GTK2.Gnome2DruidPageEdge GTK2.Gnome2DruidPageEdge(int position, int|void anti_alias)
Create a new Gnome2.DruidPageEdge, with optional anti-aliasing.
inherit Gnome2.DruidPage : DruidPage
Gnome2.DruidPageEdge set_bg_color(GTK2.GdkColor color)
This will set the background color.
Gnome2.DruidPageEdge set_logo(GTK2.GdkPixbuf logo)
Sets a GDK2.Pixbuf as the logo in the top right corner. If omitted, then no logo will be displayed.
Gnome2.DruidPageEdge set_logo_bg_color(GTK2.GdkColor color)
Sets the color behind the druid page's logo.
Gnome2.DruidPageEdge set_text(sprintf_format text, sprintf_args ... fmt)
Sets the contents of the text portion.
Gnome2.DruidPageEdge set_text_color(GTK2.GdkColor color)
Sets the color of the text in the body of the page.
Gnome2.DruidPageEdge set_textbox_color(GTK2.GdkColor color)
Sets the color of the background in the main text area of the page.
Gnome2.DruidPageEdge set_title(string title)
Sets the contents of the page's title text.
Gnome2.DruidPageEdge set_title_color(GTK2.GdkColor color)
Sets the color of the title text.
Gnome2.DruidPageEdge set_top_watermark(GTK2.GdkPixbuf watermark)
Sets a GDK2.Pixbuf as the watermark on top of the top strip on the druid. If watermark is omitted, it is reset to the normal color.
Gnome2.DruidPageEdge set_watermark(GTK2.GdkPixbuf watermark)
Sets a GDK2.Pixbuf as the watermark on the left strip on the druid. If watermark is omitted, it is reset to the normal color.
CLASS GTK2.Gnome2DruidPageStandard |
Properties: string background GDK2.Color background-gdk int background-set string contents-background GDK2.Color contents-background-gdk int contents-background-set GDK2.Pixbuf logo string logo-background GDK2.Color logo-background-gdk int logo-background-set string title string title-foreground GDK2.Color title-foreground-gdk int title-foreground-set GDK2.Pixbuf top-watermark
Gnome2.DruidPageStandard append_item(string question, GTK2.Widget item, string additional_info)
Convenience function to add a GTK2.Widget to the vbox. This function creates a new contents section that has the question text followed by the item widget and then the additional_info text, all stacked vertically from top to bottom.
The item widget could be something like a set of radio checkbuttons requesting a choice from the user.
GTK2.Gnome2DruidPageStandard GTK2.Gnome2DruidPageStandard(string|void title, GTK2.GdkPixbuf logo, GTK2.GdkPixbuf top_watermark)
Construct a new Gnome2.DruidPageStandard.
inherit Gnome2.DruidPage : DruidPage
Gnome2.DruidPageStandard set_background(GTK2.GdkColor color)
Sets the background color of the top section.
Gnome2.DruidPageStandard set_contents_background(GTK2.GdkColor color)
Sets the color of the main contents section's background.
Gnome2.DruidPageStandard set_logo(GTK2.GdkPixbuf logo)
Sets a GDK2.Pixbuf as the logo in the top right corner. If omitted, then no logo will be displayed.
Gnome2.DruidPageStandard set_logo_background(GTK2.GdkColor color)
Sets the background color of the logo.
Gnome2.DruidPageStandard set_title(string title)
Sets the title.
Gnome2.DruidPageStandard set_title_foreground(GTK2.GdkColor color)
Sets the title text to the specified color.
Gnome2.DruidPageStandard set_top_watermark(GTK2.GdkPixbuf watermark)
Sets a GDK2.Pixbuf as the watermark on top of the top strip on the druid. If watermark is omitted, it is reset to the normal color.
CLASS GTK2.Gnome2Href |
This widget is a GtkButton button that contains a URL. When clicked it invokes the configured browser for the URL you provided.
GTK2.Gnome2Href( "http://www.gnome.org", "GNOME Web Site" )
GTK2.Gnome2Href( "http://www.gnome.org" )
Properties: string text string url
Style properties: GDK.Color link-color
GTK2.Gnome2Href GTK2.Gnome2Href(string url, string|void label)
Created a GNOME href object, a label widget with a clickable action and an associated URL. If label is set to 0, url is used as the label.
string get_text()
Returns the contents of the label widget used to display the link text.
string get_url()
Return the url
inherit GTK2.Button : Button
Gnome2.Href set_text(sprintf_format text, sprintf_args ... fmt)
Sets the internal label widget text (used to display a URL's link text) to the given value.
Gnome2.Href set_url(string url)
Sets the internal URL
CLASS GTK2.Gnome2IconEntry |
This widget provides the facilities to select an icon. An icon is displayed inside a button, when the button is pressed, an Icon selector (a dialog with a W(GnomeIconSelection) widget) pops up to let the user choose an icon. It also allows one to Drag and Drop the images to and from the preview button. Properties: string browse-dialog-title string filename string history-id GTK2.Dialog pick-dialog string pixmap-subdir
Signals: browse
changed
GTK2.Gnome2IconEntry GTK2.Gnome2IconEntry(string history_id, string title)
Creates a new icon entry widget
string get_filename()
Gets the file name of the image if it was possible to load it into the preview. That is, it will only return a filename if the image exists and it was possible to load it as an image.
inherit GTK2.Vbox : Vbox
GTK2.Widget pick_dialog()
If a pick dialog exists, returns it. This is if you need to do something with all dialogs. You would use the browse signal with connect_after to get the pick dialog when it is displayed.
Gnome2.IconEntry set_browse_dialog_title(string title)
Set the title of the browse dialog.
int set_filename(string filename)
Sets the icon of Gnome2.IconEntry to be the one pointed to by filename.
Gnome2.IconEntry set_history_id(string history_id)
Set the history_id of the entry in the browse dialog and reload the history.
Gnome2.IconEntry set_pixmap_subdir(string subdir)
Sets the subdirectory below gnome's default pixmap directory to use as the default path for the file entry.
CLASS GTK2.Gnome2IconSelection |
An icon listing/chooser display.
Gnome2.IconSelection add_defaults()
Adds the default pixmap directory into the selection widget.
Gnome2.IconSelection add_directory(string dir)
Adds the icons from the directory dir to the selection widget.
Gnome2.IconSelection clear(int|void not_shown)
Clear the currently shown icons, the ones that weren't shown yet are not cleared unless the not_shown parameter is given, in which case even those are cleared.
GTK2.Gnome2IconSelection GTK2.Gnome2IconSelection()
Creates a new icon selection widget, it uses a W(GnomeIconList) for the listing of icons
GTK2.Widget get_box()
Gets the W(Vbox) widget.
string get_icon(int full_path)
Gets the currently selected icon name, if full_path is true, it returns the full path to the icon, if none is selected it returns 0.
inherit GTK2.Vbox : Vbox
Gnome2.IconSelection select_icon(string filename)
Selects the icon filename. This icon must have already been added and shown
Gnome2.IconSelection show_icons()
Shows the icons inside the widget that were added with add_defaults and add_directory. Before this function isf called the icons aren't actually added to the listing and can't be picked by the user.
Gnome2.IconSelection stop_loading()
Stop the loading of images when we are in the loop in show_icons.
CLASS GTK2.HScrollbar |
A horizontal scrollbar.
General documentation: See W(Scrollbar)
GTK2.HScrollbar(GTK2.Adjustment())->set_size_request(300,15)
GTK2.HScrollbar GTK2.HScrollbar(GTK2.Adjustment adjustment_or_props)
Used to create a new hscrollbar widget.
inherit GTK2.Scrollbar : Scrollbar
CLASS GTK2.HandleBox |
The contents of a handle box can be 'dragged' out of the box by the user.
The contents will then be placed in a separate window.
GTK2.HandleBox()->add(GTK2.Label("The contents"))
Properties: int handle-position int shadow int shadow-type int snap-edge int snap-edge-set
Signals: child_attached Called when a new child is added to the box
child_detached Called when a child is removed from the box
GTK2.HandleBox GTK2.HandleBox(mapping|void props)
Create a new handle box widget.
int get_handle_position()
Get the handle position.
int get_shadow_type()
Get the shadow type.
int get_snap_edge()
Get the snap edge.
inherit GTK2.Bin : Bin
GTK2.HandleBox set_handle_position(int pos)
The position of the handle. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP
GTK2.HandleBox set_shadow_type(int shadow_type)
One of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK2.HandleBox set_snap_edge(int pos)
The edge to snap to. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP, or -1 for unset.
CLASS GTK2.Hbox |
Most packing is done by creating boxes. These are invisible widget containers that we can pack our widgets into which come in two forms, a horizontal box, and a vertical box. This is the horizontal one. When packing widgets into a horizontal box, the objects are inserted horizontally from left to right or right to left depending on the call used.
GTK2.Hbox(0,0)->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->pack_end_defaults(GTK2.Button("From right"))->pack_start_defaults(GTK2.Button("From left"))
GTK2.Hbox(1,0)->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->pack_end_defaults(GTK2.Button("From right"))->pack_start_defaults(GTK2.Button("From left"))
GTK2.Hbox(1,40)->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->pack_end_defaults(GTK2.Button("From right"))->pack_start_defaults(GTK2.Button("From left"))
GTK2.Hbox GTK2.Hbox(int|mapping uniformp_or_props, int|void hpadding)
Create a new horizontal box widget. If all_same_size is true, all widgets will have exactly the same size. hpadding is added to the left and right of the children.
inherit GTK2.Box : Box
CLASS GTK2.HbuttonBox |
A HbuttonBox is very similar to a Hbox. The major diffference is that the button box is made to pack buttons in, and has a few convenience function for normal button layouts.
GTK2.HbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_size_request(400,30)
GTK2.HbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_layout(GTK2.BUTTONBOX_SPREAD)->set_size_request(400,30)
GTK2.HbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_layout(GTK2.BUTTONBOX_EDGE)->set_size_request(400,30)
GTK2.HbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_layout(GTK2.BUTTONBOX_START)->set_size_request(400,30)
GTK2.HbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_layout(GTK2.BUTTONBOX_END)->set_size_request(400,30)
GTK2.HbuttonBox GTK2.HbuttonBox(mapping|void props)
Create a new horizontal button box
inherit GTK2.ButtonBox : ButtonBox
CLASS GTK2.Hpaned |
The paned window widgets are useful when you want to divide an area into two parts, with the relative size of the two parts controlled by the user. A groove is drawn between the two portions with a handle that the user can drag to change the ratio. This widgets makes a horizontal division
See W(Paned) for details.
GTK2.Hpaned()->add1(GTK2.Label("Left\nSide\nOf\nPane"))->add2(GTK2.Label("Right\nSide\nOf\nPane"))->set_size_request(100,100)
GTK2.Hpaned GTK2.Hpaned(mapping|void props)
Create a new W(Hpaned) widget.
inherit GTK2.Paned : Paned
CLASS GTK2.Hscale |
The GTK2.HScale widget is used to allow the user to select a value using a horizontal slider. A GTK2.Adjustment is used to set the initial value, the lower and upper bounds, and the step and page increments.
See W(Scale) for details
The position to show the current value, and the number of decimal places shown can be set using the parent W(Scale) class's functions.
GTK2.Hscale(GTK2.Adjustment())->set_size_request(300,30)
GTK2.Hscale GTK2.Hscale(GTK2.Adjustment settings_or_min_props, float|void max, float|void step)
Used to create a new hscale widget. Either pass an W(Adjustment), or three floats representing min, max, and step values.
inherit GTK2.Scale : Scale
CLASS GTK2.Hseparator |
Simply creates a horizontal separator. No bells or whistles.
GTK2.Hseparator()->set_size_request(300,3)
GTK2.Hseparator GTK2.Hseparator(mapping|void props)
Used to create a new hseparator widget.
inherit GTK2.Separator : Separator
CLASS GTK2.IconFactory |
Icon factory, for holding icon sets.
GTK2.IconFactory add(string stock_id, GTK2.IconSet icon_set)
Adds the given icon_set to the icon factory, under the name of stock_id. stock_id should be namespaced for your application, e.g. "myapp-whatever-icon". Normally applications create a GTK2.IconFactory, then add it to the list of default factories with add_default(). Then they pass the stock_id to widgets such as GTK2.Image to display the icon. Themes can provide an icon with the same name (such as "myapp-whatever-icon") to override your application's default icons. If an icon already existed in this factory for stock_id, it is unreferenced and replaced with the new icon_set.
GTK2.IconFactory add_default()
Adds an icon factory to the list of icon factories search by GTK2.Style->lookup_icon_set(). This means that, for example, GTK2.Image->create("stock-id") will be able to find icons in factory. There will normally be an icon factory added for each library or application that comes with icons. The default icon factories can be overridden by themes.
GTK2.IconFactory GTK2.IconFactory()
Creates a new GTK2.IconFactory. An icon factory manages a collection of GTK2.IconSets; a GTK2.IconSet manages a set of variants of a particular icon (i.e. a GTK2.IconSet contains variants for different sizes and widget states). Icons in an icon factory are named by a stock ID, which is a simple string identifying the icon. Each GTK2.Style has a list of GTK2.IconFactorys derived from the current theme; those icon factories are consulted first when searching for an icon. If the theme doesn't set a particular icon, GTK2+ looks for the icon in a list of default icon factories, maintained by add_default() and remove_default(). Applications with icons should add a default icon factory with their icons, which will allow themes to override the icons for the application.
inherit G.Object : Object
GTK2.IconSet lookup(string stock_id)
Looks up stock_id in the icon factory, returning an icon set if found, otherwise 0. For display to the user, you should use GTK2.Style->lookup_icon_set() on the GTK2.Style for the widget that will display the icon, instead of using this function directly, so that themes are taken into account.
GTK2.IconSet lookup_default(string stock_id)
Looks for an icon in the list of default icon factories. For display to the user, you should use GTK2.Style->lookup_icon_set() on the GTK2.Style for the widget that will display the icon, instead of using this function directly, so that themes are taken into account.
GTK2.IconFactory remove_default()
Removes an icon factory from the list of default icon factories.
CLASS GTK2.IconInfo |
Contains information found when looking up an icon in an icon theme.
GTK2.IconInfo copy()
Make a copy.
int get_base_size()
Gets the base size for the icon. The base size is a size for the icon that was specified by the icon theme creator. This may be different than the actual size of image; an example of this is small emblem icons that can be attached to a larger icon. These icons will be given the same base size as the larger icons to which they are attached.
GTK2.GdkPixbuf get_builtin_pixbuf()
Gets the built-in image for this icon, if any. To allow GTK2+ to use built-in icon images, you must pass the GTK2.ICON_LOOKUP_USE_BUILTIN to GTK2.IconTheme->lookup_icon().
string get_filename()
Gets the filename for the icon. If the GTK2.ICON_LOOKUP_USE_BUILTIN flag was passed to GTK2.IconTheme->lookup_icon(), there may be no filename if a builtin icon is returned; in this case, you should use get_builtin_pixbuf().
GTK2.GdkPixbuf load_icon()
Renders an icon previously looked up in an icon theme using GTK2.IconTheme->lookup_icon(); the size will be based on the size passed to GTK2.IconTheme->lookup_icon(). Note that the resulting pixbuf may not be exactly this size; an icon theme may have icons that differe slightly from their nominal sizes, and in addition GTK2+ will avoid scaling icons that it considers sufficiently close to the requested size or for which the source image would have to be scaled up too far. (This maintains sharpness.)
CLASS GTK2.IconSet |
Iconset. A single icon.
GTK2.IconSet add_source(GTK2.IconSource source)
Icon sets have a list of GTK2.IconSource, which they use as base icons for rendering icons in different states and sizes. Icons are scaled, made to look insensitive, etc. in render_icon(), but GTK2.IconSet needs base images to work with. The base images and when to use them are described by a GTK2.IconSource.
This function copies source, so you can reuse the same source immediately without affecting the icon set.
An example of when you'd use this function: a web browser's "Back to Previous Page" icon might point in a different direciton in Hebrew and in English; it might look different when insensitive; and it might change size depending on toolbar mode (small/large icons). So a single icon set would contain all those variants of the icon, and you might add a separate source for each one.
You should nearly always add a "default" icon source with all fields wildcarded, which will be used as a fallback if no more specific source matches. GTK2.IconSet always prefers more specific icon sources to more generic icon sources. The order in which you add the sources to the icon set does not matter.
GTK2.IconSet copy()
Create a copy.
GTK2.IconSet GTK2.IconSet(GTK2.GdkPixbuf pixbuf)
Create a new GTK2.IconSet. A GTK2.IconSet represents a single icon in various sizes and widget states. It can provide a GDK2.Pixbuf for a given size and state on request, and automatically caches some of the rendered GDK2.Pixbuf objects.
Normally you would use GTK2.Widget->render_icon() instead of using GTK2.IconSet directly. The one case where you'd use GTK2.IconSet is to create application-specific icon sets to place in a GTK2.IconFactory.
array get_sizes()
Obtains a list of icon sizes this icon set can render.
CLASS GTK2.IconSize |
Iconsize.
int from_name(string name)
Looks up the icon size associated with name.
string get_name(int size)
Gets the canonical name of the given icon size.
int register(string name, int width, int height)
Registers a new icon size, along the same lines as GTK2.ICON_SIZE_MENU, etc. Returns the integer value for the size.
GTK2.IconSize register_alias(string alias, int target)
Registers alias as another name for target. So calling GTK2.IconSize->from_name() with alias will return target.
CLASS GTK2.IconSource |
Iconsource.
GTK2.IconSource GTK2.IconSource()
Creates a new GTK2.IconSource. A GTK2.IconSource contains a GDK2.Pixbuf (or image filename) that serves as the base image for one or more of the icons in a GTK2.IconSet, along with a specification for which icons in the icon set will be based on that pixbuf or image file. An icon set contains a set of icons that represent "the same" logical concept in different states, different global text directions, and different sizes.
So for example a web browser's "Back to Previous Page" icon might point in a different direction in Hebrew and in English; it might look different when insensitive; and it might change size depending on toolbar mode small/large icons). So a single icon set would contain all those variants of the icon. GTK2.IconSet contains a list of GTK2.IconSource from which it can derive specific icon variants in the set.
In the simplest case, GTK2.IconSet contains one source pixbuf from which it derives all variants. The convenience function GTK2.IconSet->create(pixbuf) handles this case; if you only have one source pixbuf, just use that function.
If you want to use a different base pixbuf for different icon variants, you create multiple icon sources, mark which variants they'll be used to create, and add them to the icon set with GTK2.IconSet->add_source().
By default, the icon source has all parameters wildcarded. That is, the icon source will be used as the base icon for any desired text direction, widget state, or icon size.
int get_direction()
Obtains the text direction this icon source applies to. The return value is only useful/meaningful if the text direction is not wildcarded.
int get_direction_wildcarded()
Gets the value set by set_direction_wildcarded().
string get_filename()
Retrieves the source filename, or empty.
string get_icon_name()
Retrieves the source icon name, or empty.
GTK2.GdkPixbuf get_pixbuf()
Retrieves the source pixbuf, or 0. In addition, if a filename source is in use, this function in some cases will return the pixbuf loaded from the filename. This is, for example, true for the GTK2.IconSource passed to the GTK2.Style->render_icon() virtual function.
int get_size()
Obtains the icon size this source applies to. The return value is only useful/meaningful if the icon size is not wildcarded.
int get_size_wildcarded()
Gets the value set by set_size_wildcarded().
int get_state()
Obtains the widget state this icon source applies to. The return value is only useful/meaningful if the widget state is not wildcarded.
int get_state_wildcarded()
Gets the value set by set_state_wildcarded().
GTK2.IconSource set_direction(int dir)
Sets the text direction this icon source is intended to be used with.
Setting the text direction on an icon source makes no difference if the text direction is wildcarded. Therefore, you should usually call set_direction_wildcarded() to un-wildcard it in addition to calling this function.
GTK2.IconSource set_direction_wildcarded(int setting)
If the text direction is wildcarded, this source can be used as the base image for an icon in any text direction. If the text direction is not wildcarded, then the text direction the icon source applies to should be set with set_direction(), and the icon source will only be used with that text direction.
GTK2.IconSet prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.
GTK2.IconSource set_filename(string filename)
Sets the name of an image file to use as a base image when creating icon variants for GTK2.IconSet. The filename must be absolute.
GTK2.IconSource set_icon_name(string name)
Sets the name of an icon to look up in the current icon theme to use as a base image.
GTK2.IconSource set_pixbuf(GTK2.GdkPixbuf pixbuf)
Sets a pixbuf to use as a base image.
GTK2.IconSource set_size(int size)
Sets the icon size this icon source is intended to be with.
GTK2.IconSource set_size_wildcarded(int setting)
If the icon size is wildcarded, this source can be used as the base image for an icon of any size. If the size is not wildcarded, then the size the source applies to should be set with set_size() and the icon source will only be used with that specific size.
GTK2.IconSource set_state(int state)
Sets the widget state this icon source is intended to be used with.
GTK2.IconSource set_state_wildcarded(int setting)
If the widget state is wildcarded, this source can be used as the base image for an icon in any state. If the widget state is not wildcarded, then the state the source applies to should be set with set_state() and the icon source will only be used with that specific state.
CLASS GTK2.IconTheme |
Looking up icons by name.
Signals: changed
GTK2.IconTheme append_search_path(string path)
Appends a directory to the search path.
GTK2.IconTheme GTK2.IconTheme()
Creates a new icon theme object. Icon theme objects are used to lookup an icon by name in a particular icon theme. Usually you'll want to use get_default() rather than creating a new icon theme object from scratch.
string get_example_icon_name()
Gets the name of an icon that is representative of the current theme (for instance, to use when presenting a list of themes to the user.)
array get_icon_sizes(string name)
Returns an array of integers describing the sizes at which the icon is available without scaling. A size of -1 means that the icon is available in a scalable format.
array get_search_path()
Gets the current search path.
int has_icon(string icon_name)
Checks whether this icon theme includes an icon for a particular name.
inherit G.Object : Object
array list_icons(string|void context)
Lists the icons in the current icon theme. Only a subset of the icons can be listed by providing a context string. The set of values for the context string is system dependent, but will typically include such values as 'apps' and 'mimetypes'.
GTK2.GdkPixbuf load_icon(string name, int size, int flags)
Looks up an icon in an icon theme, scales it to the given size and renders it into a pixbuf.
GTK2.IconInfo lookup_icon(string name, int size, int flags)
Looks up a named icon and returns an object containing information such as the filename of the icon. The icon can then be rendered into a pixbuf using GTK2.IconInfo->load_icon().
GTK2.IconTheme prepend_search_path(string path)
Prepends a directory to the search path.
int rescan_if_needed()
Checks to see if the icon theme has changed; if it has, any currently cached information is discarded and will be reloaded next time this theme is accessed.
GTK2.IconTheme set_custom_theme(string theme_name)
Sets the name of the icon theme that the GTK2.IconTheme object uses overriding system configuration. This function cannot be called on the icon theme objects return from get_default().
GTK2.IconTheme set_search_path(array path)
Sets the search path for the icon theme object. When looking for an icon theme, GTK2+ will search for a subdirectory of one or more of the directories in path with the same name as the icon theme. (Themes from multiple of the path elemets are combined to allow themes to be extended by adding icons in the user's home directory.)
In addition if an icon found isn't found either in the current icon theme or the default icon theme, and an image file with the right name is found directly in one of the elements of path, then that image will be used for the icon name. (This is a legacy feature, and new icons should be put into the default icon theme, which is called DEFAULT_THEME_NAME, rather than directly on the icon path.)
CLASS GTK2.IconView |
GTK2.IconView provides an alternative view on a list model. It displays the model as a grid of icons with labels. Like GTK2.TreeView, it allows to select one or multiple items (depending on the selection mode). In addition to seleciton with the arrow keys, GTK2.IconView supports rubberband selections, which is controlled by dragging the pointer. Properties: int column-spacing int columns int item-width int margin int markup-column GTK2.TreeModel model int orientation int pixbuf-column int row-spacing int selection-mode int spacing int text-column
Style properties: int selection-box-alpha GDK2.Color selection-box-color
Signals: activate_cursor_item
item_activated
move_cursor
select_all
select_cursor_item
selection_changed
set_scroll_adjustments
toggle_cursor_item
unselect_all
GTK2.IconView GTK2.IconView(GTK2.TreeModel model_or_props)
Creates a new GTK2.IconView widget Not implemented yet.
int get_column_spacing()
Returns the value of the column-spacing property.
int get_columns()
Returns the value of the columns property.
array get_cursor()
Returns the GTK2.TreePath and GTK2.CellRenderer of the current cursor path and cell. If the cursor isn't currently set, then path will be 0. If no cell currently has focus, then cell will be 0.
array get_item_at_pos(int x, int y)
Finds the path at the point (x,y) relative to widget coordinates. In contrast to get_path_at_pos(), this function also obtains the cell at the specified position.
int get_item_width()
Returns the value of the item-width property.
int get_margin()
Returns the value of the margin property.
int get_markup_column()
Returns the column with markup text.
GTK2.TreeModel get_model()
Gets the model.
int get_orientation()
Returns the value of the orientation property.
GTK2.TreePath get_path_at_pos(int x, int y)
Finds the path at the point(x,y) relative to widget coordinates.
int get_pixbuf_column()
Returns the column with pixbufs.
int get_reorderable()
Retrieves whether the user can reorder the list via drag-and-drop.
int get_row_spacing()
Returns the value of the row-spacing property.
array get_selected_items()
Creates a list of paths of all selected items. Not implemented yet.
int get_selection_mode()
Gets the selection mode.
int get_spacing()
Returns the value of the spacing property
int get_text_column()
Returns the column with text.
array get_visible_range()
Returns the first and last visible path. Note that there may be invisible paths in between.
inherit GTK2.Container : Container
GTK2.IconView item_activated(GTK2.TreePath path)
Activates the item determined by path.
int path_is_selected(GTK2.TreePath path)
Returns true if the icon pointed to by path is currently selected. If icon does not point to a valid location, false is returned.
GTK2.IconView scroll_to_path(GTK2.TreePath path, int use_align, float row_align, float col_align)
Moves the alignments to the position specified by path. row_align determines where the row is placed, and col_align determines where column is placed. Both are expected to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means center.
If use_align is FALSE, then the alignment arguments are ignored, and the tree does the minimum amount of work to scroll the item onto the screen. This means that the item will be scrolled to the edge closest to its current position. If the item is currently visible on the screen, nothing is done.
This funciton only works if the model is set, and path is a valid row on the model. If the model changes before this icon view is realized, the centered path will be modified to reflect this change.
GTK2.IconView select_all()
Selects all the icons. This widget must have its selection mode set to GTK2.SELECTION_MULTIPLE.
GTK2.IconView select_path(GTK2.TreePath path)
Selects the row at path
GTK2.IconView set_column_spacing(int column_spacing)
Sets the column-spacing property which specifies the space which is inserted between the columns of the icon view.
GTK2.IconView set_columns(int columns)
Sets the columns property which determines in how many columns the icons are arranged. If columns is -1, the number of columns will be chosen automatically to fill the available area.
GTK2.IconView set_cursor(GTK2.TreePath path, GTK2.CellRenderer cell, int|void start_editing)
Sets the current keyboard focus to be at path, and selects it. This is usefull when you want to focus the user's attention on a particular item. If cell is not 0, then focus is given to the cell speicified by it. Additionally, if start_editing is TRUE, then editing should be started in the specified cell.
This function is often followed by grab_focus() in order to give keyboard focus to the widget.
GTK2.IconView set_item_width(int item_width)
Sets the item-width property which specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
GTK2.IconView set_margin(int margin)
Sets the margin property.
GTK2.IconView set_markup_column(int column)
Sets the column with markup information to be column.
GTK2.IconView set_model(GTK2.TreeModel model)
Sets the model.
GTK2.IconView set_orientation(int orientation)
Sets the orientation property which determines whether the labels are drawn beside the icons instead of below. One of ORIENTATION_HORIZONTAL and ORIENTATION_VERTICAL
GTK2.IconView set_pixbuf_column(int column)
Sets the column with pixbufs to be column.
GTK2.IconView set_reorderable(int setting)
This function is a convenience function to allow you to reorder models. Both GTK2.TreeStore and GTK2.ListStore support this. If setting is TRUE, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model's "row-inserted" and "row-deleted" signals.
GTK2.IconView set_row_spacing(int row_spacing)
Sets the row-spacing property which specifies the space which is inserted between the rows of the icon view.
GTK2.IconView set_selection_mode(int mode)
Sets the selection mode. One of SELECTION_BROWSE, SELECTION_MULTIPLE, SELECTION_NONE and SELECTION_SINGLE
GTK2.IconView set_spacing(int spacing)
Sets the spacing property which specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
GTK2.IconView set_text_column(int column)
Sets the column with text to be column.
GTK2.IconView unselect_all()
Unselects all the icons.
GTK2.IconView unselect_path(GTK2.TreePath path)
Unselects the row at path
CLASS GTK2.Image |
An image is a image object stored in client, not X server, memory. A pixmap, on the other hand, is a image object stored in the X-server. See GDK2.Image and GDK2.Pixmap.
GTK2.Image("tornado_nguyen_big.jpg");
Properties: string file string icon-name icon-set int icon-size GDK2.Image image GDK2.Pixmap mask GDK2.Pixbuf pixbuf GDK2.PixbufAnimation pixbuf-animation int pixel-size GDK2.Pixmap pixmap string stock int storage-type IMAGE_ANIMATION, IMAGE_EMPTY, IMAGE_ICON_NAME, IMAGE_ICON_SET, IMAGE_IMAGE, IMAGE_PIXBUF, IMAGE_PIXMAP and IMAGE_STOCK
GTK2.Image clear()
Resets the image to be empty.
GTK2.Image GTK2.Image(string|GdkPixbuf|GdkPixbufAnimation|GdkImage|GdkPixmap|mapping file_or_props, GTK2.GdkBitmap mask_or_size)
Create a new W(Image) from either a file or a GDK2.Pixbuf.
GTK2.GdkPixbufAnimation get_animation()
Gets the GDK2.PixbufAnimation being displayed.
mapping get_icon_name()
Gets the icon name and size.
mapping get_image()
Returns ([ "image":GDK2.Image img, "mask":GDK2.Bitmap mask ])
GTK2.GdkPixbuf get_pixbuf()
Gets the GDK2.Pixbuf being displayed. The storage type of the image must be GTK2.IMAGE_EMPTY or GTK2.IMAGE_PIXBUF).
int get_pixel_size()
Gets the pixel size used for named icons.
mapping get_pixmap()
Gets the pixmap and mask.
mapping get_stock()
Gets the stock icon name and size.
int get_storage_type()
Gets the type of representation being used to store data. If it has no image data, the return value will be GTK2.IMAGE_EMPTY. One of IMAGE_ANIMATION, IMAGE_EMPTY, IMAGE_ICON_NAME, IMAGE_ICON_SET, IMAGE_IMAGE, IMAGE_PIXBUF, IMAGE_PIXMAP and IMAGE_STOCK
inherit GTK2.Misc : Misc
GTK2.Image set_from_animation(GTK2.GdkPixbufAnimation anim)
Causes the W(Image) to display the given animation.
GTK2.Image set_from_file(string filename)
Set the image from a file.
GTK2.Image set_from_icon_name(string icon_name, int size)
Sets from an icon name.
GTK2.Image set_from_icon_set(GTK2.IconSet icon_set, int size)
Set this image from an icon set.
GTK2.Image set_from_image(GTK2.GdkImage gdk_image, GTK2.GdkBitmap mask)
Set this image from a GDK2.Image plus optional mask.
GTK2.Image set_from_pixbuf(GTK2.GdkPixbuf pixbuf)
Set image from a pixbuf
GTK2.Image set_from_pixmap(GTK2.GdkPixmap pixmap, GTK2.GdkBitmap mask)
Set this image from a GDK2.Pixmap plus optional mask.
GTK2.Image set_from_stock(string stock_id, int size)
Sets from a stock icon. Sample icon names are GTK2.STOCK_OPEN, GTK2.STOCK_EXIT. Sample stock sizes are GTK2.ICON_SIZE_MENU, GTK2.ICON_SIZE_SMALL_TOOLBAR. If the stock name isn't known, the image will be empty.
GTK2.Image set_pixel_size(int pixel_size)
Sets the pixel size to use for named icons. If the pixel size is set to a value != -1, it is used instead of the icon size set by set_from_icon_name().
CLASS GTK2.ImageMenuItem |
Properties: GTK2.Widget image
GTK2.ImageMenuItem GTK2.ImageMenuItem(string|mapping label)
Create a new ImageMenuItem.
GTK2.Widget get_image()
Gets the widget that is currently set as the image.
inherit GTK2.MenuItem : MenuItem
GTK2.ImageMenuItem set_image(GTK2.Widget image)
Sets the image of the image menu item.
CLASS GTK2.Invisible |
An invisible container, useful, eh? :) Properties: GDK2.Screen screen
GTK2.Invisible GTK2.Invisible(mapping|void props)
Create a new invisible widget
GTK2.GdkScreen get_screen()
Gets the screen associated with this object.
inherit GTK2.Widget : Widget
GTK2.Invisible set_screen(GTK2.GdkScreen screen)
Sets the screen where this object will be displayed.
CLASS GTK2.Item |
This class is inherited by all 'item' type of widgets.
Signals: deselect
select
toggle
GTK2.Item deselect()
Emulate a 'deselect' event.
inherit GTK2.Bin : Bin
GTK2.Item select()
Emulate a 'select' event.
GTK2.Item toggle()
Emulate a 'toggle' event.
CLASS GTK2.KeywordListTag |
GTK2.KeywordListTag GTK2.KeywordListTag(string id, string name, array keywords, int case_sensitive, int match_empty_string_at_beginning, int match_empty_string_at_end, string beginning_regex, string end_regex)
Creates a new keyword list tag object with the provided arguments.
inherit GTK2.SourceTag : SourceTag
CLASS GTK2.Label |
A simple text label.
GTK2.Label("A simple text label")
GTK2.Label("Multi\nline text\nlabel here")
GTK2.Label("Multi\nline text\nlabel here")->set_justify(GTK2.JUSTIFY_LEFT)
GTK2.Label("Multi\nline text\nlabel here")->set_justify(GTK2.JUSTIFY_RIGHT)
Properties: float angle Pango.AttrList attributes int cursor-position int ellipsize PANGO_ELLIPSIZE_END, PANGO_ELLIPSIZE_MIDDLE, PANGO_ELLIPSIZE_NONE and PANGO_ELLIPSIZE_START int justfy JUSTIFY_CENTER, JUSTIFY_FILL, JUSTIFY_LEFT and JUSTIFY_RIGHT string label int max-width-chars int mnemonic-keyval int mnemonic-widget string pattern int selectable int single-line-mode int use-markup int use-underline int width-chars int wrap
Signals: copy_clipboard
move_cursor
populate_popup
GTK2.Label GTK2.Label(string|mapping text_or_props)
Creates a new label.
float get_angle()
Gets the angle of rotation for the label.
int get_ellipsize()
Returns the ellipsizing position of the label.
int get_justify()
Returns the justification of the label.
string get_label()
Fetches the text from a label widget including any underlines indicating mnemonics and Pango markup.
GTK2.Pango.Layout get_layout()
Gets the Pango.Layout used to display the label. The layout is useful to e.g. convert text positions to pixel positions, in combination with get_layout_offsets().
mapping get_layout_offsets()
Obtains the coordinates where the label will draw the Pango.Layout representing the text in the label; useful to convert mouse events into coordinates inside the Pango.Layout, e.g. to take some action if some part of the label is clicked. Of course, you will need to create a GTK2.EventBox to receive the events, and pack the label inside it, since labels are a GTK2.NO_WINDOW widget. Remember when using the Pango.Layout functions you need to convert to and from pixels using GTK2.PANGO_SCALE.
int get_line_wrap()
Returns whether lines in the label are automatically wrapped.
int get_line_wrap_mode()
Returns line wrap mode used by the label.
int get_max_width_chars()
Retrieves the desired maximum width, in characters.
int get_mnemonic_keyval()
If the label has been set so that is has a mnemonic key, this function returns the keyval used for the mnemonic accelerator. If there is no mnemonic set up it returns GDK_VoidSymbol.
GTK2.Widget get_mnemonic_widget()
Retrieves the target of the mnemonic (keyboard shortcut).
int get_selectable()
Gets the value set by set_selectable().
mapping get_selection_bounds()
Gets the selected range of characters in the label. If there isn't a selection, returns -1 for both start and end.
int get_single_line_mode()
Returns whether the label is in single line mode.
string get_text()
Fetches the text from a label widget, as displayed on the screen. This does not include any embedded underlines indicating mnemonics or Pango markup. (see get_label()).
int get_use_markup()
Returns whether the label's text is interpreted as marked up with the Pango text markup language.
int get_use_underline()
Returns whether an embedded underline in the label indicates a mnemonic.
int get_width_chars()
Retrieves the desired width, in characters.
inherit GTK2.Misc : Misc
GTK2.Label select_region(int start_offset, int end_offset)
Selects a range of characters in the label, if the label is selectable. See set_selectable(). If the label is not selectable, this function has no effect. If start_offset or end_offset are -1, then the end of the label will be substituted.
GTK2.Label set_angle(int|float angle)
Sets the angle of rotation for the label. An angle of 90 reads from bottom to top, and angle of 270, from top to bottom. The angle setting for the label is igrnored if the lable is selectable, wrapped, or ellipsized.
GTK2.Label set_ellipsize(int mode)
Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to render the entire string. One of PANGO_ELLIPSIZE_END, PANGO_ELLIPSIZE_MIDDLE, PANGO_ELLIPSIZE_NONE and PANGO_ELLIPSIZE_START.
GTK2.Label set_justify(int jtype)
Sets the alignment of the lines in the text of the label relative to each other. GTK2.JUSTIFY_LEFT is the default value when the widget is first created. If you instead want to set the alignment of the label as a whole, use set_alignment() instead. set_justify() has no efect on labels containing only a single line. One of JUSTIFY_CENTER, JUSTIFY_FILL, JUSTIFY_LEFT and JUSTIFY_RIGHT.
GTK2.Label set_label(string text)
Sets the text of the label. The label is interpreted as including embedded underlines and/or Pango markup depending on the values of use-underline and use-markup.
GTK2.Label set_line_wrap(int wrap)
Toggles line wrapping within the widget. True makes it break lines if text exceeds the widget's size. False lets the text get cut off by the edge of the widget if it exceeds the widget size.
GTK2.Label set_line_wrap_mode(int wrap_mode)
If line wrapping is on, this controls how the line wrapping is done. The Default is Pango.WRAP_WORD, which means wrap on word boundaries.
GTK2.Label set_markup(string text)
Parses text which is marked up with the Pango text markup language, setting the label's text and attribute list based on the parse results.
GTK2.Label set_markup_with_mnemonic(string text)
Parses text which is marked up with the Pango text markup language, setting the label's text and attribute list based on the parse results. If characters in text are preceded by an underscore, they are underline indicating that they represent a keyboard accelerator called a mnemonic.
The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using set_mnemonic_widget().
GTK2.Label set_max_width_chars(int n_chars)
Sets the desired maximum width in characters to n_chars.
GTK2.Label set_mnemonic_widget(GTK2.Widget widget)
If the label has been set so that it has a mnemonic key (using i.e. set_markup_with_mnemonic(), set_text_with_mnemonic(), or the "use_underline" property) the label can be associated with a widget that is the target of the mnemonic. When the label is inside a widget (like a GTK2.Button or GTK2.Notebook tab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is a GTK2.Entry next to the label) you need to set it explicitly using this function.
The target widget will be accelerated by emitting "mnemonic_activate" on it. The default handler for this signal will activate the widget if there are no mnemonic collisions and toggle focus between the colliding widgets otherwise.
GTK2.Label set_pattern(string pattern_string)
A string with either spaces or underscores. It should be of the same length as the text.
When a character in the text has a matching _ in the pattern, the character in the label will be underlined.
GTK2.Label set_selectable(int setting)
Selectable labels allow the user to select text from the label, for copy and past.
GTK2.Label set_single_line_mode(int mode)
Sets whether the label is in single line mode.
GTK2.Label set_text(sprintf_format text, sprintf_args ... fmt)
Set the text in the label
GTK2.Label set_text_with_mnemonic(sprintf_format text, sprintf_args ... fmt)
Sets the label's text from the string text. If characters in text are preceded by an underscore, they are underlined indicating that they represent a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chose automatically, or explicitly using set_mnemonic_widget().
GTK2.Label set_use_markup(int setting)
Sets whether the text of the label contains markup in Pango's text markup language.
GTK2.Label set_use_underline(int setting)
If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.
GTK2.Label set_width_chars(int n_chars)
Sets the desired width in characters to n_chars.
CLASS GTK2.Layout |
Properties: GTK2.Adjustment hadjustment int height GTK2.Adjustment vadjustment int width
Child properties: int x int y
Signals: set_scroll_adjustments
GTK2.Layout GTK2.Layout(GTK2.Adjustment hadjustment_or_props, GTK2.Adjustment vadjustment)
Creates a new GTK2.Layout.
GTK2.Adjustment get_hadjustment()
Gets the GTK2.Adjustment used for communicaiton between the horizontal scrollbar and this layout. This should only be called after the layout has been placed in a GTK2.ScrolledWindow or otherwise configured for scrolling.
GTK2.Adjustment get_vadjustment()
Gets the vertical GTK2.Adjustment.
inherit GTK2.Container : Container
GTK2.Layout move(GTK2.Widget widget, int x, int y)
Moves a current child to a new position.
GTK2.Layout put(GTK2.Widget widget, int x, int y)
Adds widget to the layout at position (x,y). The layout becomes the new parent.
GTK2.Layout set_hadjustment(GTK2.Adjustment adj)
Sets the horizontal scroll adjustment for the layout.
GTK2.Layout set_size(int xsize, int ysize)
Sets the size of the scrollable area of the layout.
GTK2.Layout set_vadjustment(GTK2.Adjustment adj)
Sets the vertical scroll adjustment for the layout.
CLASS GTK2.LineCommentTag |
GTK2.LineCommentTag GTK2.LineCommentTag(string id, string name, string pattern_start)
Creates a new line comment tag object with the provided arguments.
inherit GTK2.SourceTag : SourceTag
CLASS GTK2.LinkButton |
Properties:
string uri A GTK2.LinkButton is a GTK2.Button with a hyperlink, similar to the one used by web browsers, which triggers an action when clicked. It is useful to show quick links to resources.
GTK2.LinkButton GTK2.LinkButton(string|mapping uri_or_props, string|void label)
Creates a new LinkButton.
string get_uri()
Retrieves the URI set using set_uri().
inherit GTK2.Button : Button
GTK2.LinkButton set_uri(string uri)
Sets uri as the URI.
CLASS GTK2.ListStore |
A list-like data structure that can be used with W(TreeView).
GTK2.TreeIter append()
Append a new row.
GTK2.ListStore clear()
Removes all rows.
GTK2.ListStore GTK2.ListStore(array types)
Create a new list store with as many columns as there are items in the array. A type is either a string representing a type name, such as "int" or "float", or an actual widget. If it is a widget, the column in question should be a widget of the same type that you would like this column to represent.
inherit G.Object : Object
inherit GTK2.TreeDragDest : TreeDragDest
inherit GTK2.TreeDragSource : TreeDragSource
inherit GTK2.TreeModel : TreeModel
inherit GTK2.TreeSortable : TreeSortable
GTK2.TreeIter insert(int position)
Insert a row at position. If parent is valid, will create as child, otherwise at top level. If position is larger than then number of rows at that level, it will be added to the end of the list. iter will be changed to point to the new row.
GTK2.TreeIter insert_after(GTK2.TreeIter sibling)
Insert a new row after sibling. If sibling is 0, then the row will be prepended to parent's children. If parent and sibling are both 0, then the row will be prepended to the toplevel.
GTK2.TreeIter insert_before(GTK2.TreeIter sibling)
Insert a row before sibling. If sibling is 0, then the row will be appended to parent's children. If parent and sibling are 0, then the row will be appended to the toplevel.
GTK2.ListStore move_after(GTK2.TreeIter iter, GTK2.TreeIter position)
Moves iter to after position. These should be at the same level. This only works if the store is unsorted. If position is omitted, iter will be moved to the start of the level.
GTK2.ListStore move_before(GTK2.TreeIter iter, GTK2.TreeIter position)
Moves iter to before position. These should be at the same level. This only works if the store is unsorted. If position is omitted, iter will be moved to the end of the level.
GTK2.TreeIter prepend()
Prepend a new row.
GTK2.ListStore remove(GTK2.TreeIter iter)
Remove iter. iter is set to the next valid row at that level, or invalidated if it was the last one.
GTK2.ListStore set_row(GTK2.TreeIter iter, array values)
Set the data in an entire row.
GTK2.ListStore set_value(GTK2.TreeIter iter, int column, mixed value)
Set the data in the cell specified by iter and column.
GTK2.ListStore swap(GTK2.TreeIter a, GTK2.TreeIter b)
Swap 2 rows. Only works if this store is unsorted.
CLASS GTK2.Menu |
A GTK2.Menu is a W(MenuShell) that implements a drop down menu consisting of a list of W(MenuItem) objects which can be navigated and activated by the user to perform application functions.
A GTK2.Menu is most commonly dropped down by activating a W(MenuItem) in a W(MenuBar) or popped up by activating a W(MenuItem) in another GTK2.Menu.
A GTK2.Menu can also be popped up by activating a W(OptionMenu). Other composite widgets such as the W(Notebook) can pop up a GTK2.Menu as well.
Applications can display a GTK2.Menu as a popup menu by calling the popup() function. The example below shows how an application can pop up a menu when the 3rd mouse button is pressed.
GTK2.Menu menu = create_menu();
GTK2.Window window = create_window();
window->signal_connect( "button_press_event", lambda(GTK2.Menu m,
GTK2.Window w,
mapping e ) {
if( e->button == 3 )
menu->popup();
}, menu );
Properties:
int tearoff-state
string tearoff-title
Child properties: int bottom-attach int left-attach int right-attach int top-attach
Style properties: int horizontal-offset int vertical-offset int vertical-padding
Signals: move_scroll
GTK2.Menu attach(GTK2.Widget child, int left_attach, int right_attach, int top_attach, int bottom_attach)
Adds a new W(MenuItem) to a (table) menu. The number of 'cells' that an item will occupy is specified by left_attach, right_attach, top_attach, and bottom_attach. These each represent the leftmost, rightmost, uppermost and lower column row numbers of the table.
GTK2.Menu GTK2.Menu(mapping|void props)
Creates a new GTK2.Menu widget.
GTK2.Menu detach()
Detaches the menu from the widget to which it had been attached.
GTK2.AccelGroup get_accel_group()
Gets the W(AccelGroup) which holds global accelerators for the menu.
GTK2.Widget get_active()
Returns the selected menu item from the menu. This is used by the W(OptionMenu).
GTK2.Widget get_attach_widget()
Returns the W(Widget) that the menu is attached to.
array get_for_attach_widget()
Returns a list of the menus which are attached to this widget.
int get_tearoff_state()
Returns whether the menu is torn off.
string get_title()
Returns the title of the menu.
inherit GTK2.MenuShell : MenuShell
GTK2.Menu popdown()
Removes the menu from the screen.
GTK2.Menu popup(int|void button_pressed_to_show_menu)
The default button is 3.
GTK2.Menu reorder_child(GTK2.Widget child, int position)
Moves a W(MenuItem) to a new position within the GTK2.Menu.
GTK2.Menu reposition()
Repositions the menu according to its position function.
GTK2.Menu set_accel_group(GTK2.AccelGroup accelerators)
Set the W(AccelGroup) which holds global accelerators for the menu.
GTK2.Menu set_accel_path(string accel_path)
Sets an accelerator path for this menu.
GTK2.Menu set_active(int activep)
Selects the specified menu item within the menu. This is used by the W(OptionMenu).
GTK2.Menu set_screen(GTK2.GdkScreen screen)
Sets the screen on which the menu is displayed.
GTK2.Menu set_tearoff_state(int torn_off)
Changes the tearoff state of the menu. A menu is normally displayed as a drop down menu which persists as long as the menu is active. It can also be displayed as a tearoff menu which persists until it is closed or reattached.
GTK2.Menu set_title(string new_title)
Sets the title string for the menu. The title is displayed when the menu is shown as a tearoff menu.
CLASS GTK2.MenuBar |
Basically a horizontal W(Menu).
The menu image cannot be
grabbed automatically, but this is how you would create a menu all
in one line. This is not the recommended coding style.
GTK2.MenuBar()->add(GTK2.MenuItem("Menu")->set_submenu(GTK2.Menu()->add(GTK2.MenuItem("Sub")))->select()->activate())->add(GTK2.MenuItem("Bar"))
Properties: int child-pack-direction int pack-direction
Style properties: int internal-padding int shadow-type
GTK2.MenuBar GTK2.MenuBar(mapping|void props)
Create a new menu bar.
int get_child_pack_direction()
Retrieves the current child pack direction.
int get_pack_direction()
Retrieves the current pack direction of the menubar.
inherit GTK2.MenuShell : MenuShell
GTK2.MenuBar set_child_pack_direction(int setting)
Sets how widgets should be packed inside the children of a menubar.
GTK2.MenuBar set_pack_direction(int setting)
Sets how items should be packed inside a menubar. One of PACK_DIRECTION_BTT, PACK_DIRECTION_LTR, PACK_DIRECTION_RTL and PACK_DIRECTION_TTB.
CLASS GTK2.MenuItem |
Menu items, to be added to menus. Properties GTK2.Menu submenu
Style properties: int arrow-spacing int horizontal-padding int selected-shadow-type int toggle-spacing
Signals: activate
activate_item
toggle_size_allocate
toggle_size_request
GTK2.MenuItem activate()
Emulate an activate signal
GTK2.MenuItem GTK2.MenuItem(string|mapping label_or_props)
If a string is supplied, a W(Label) widget is created using that string and added to the item. Otherwise, you should add another widget to the list item with ->add().
GTK2.MenuItem deselect()
Emulate a deselect signal
int get_right_justified()
Gets whether the menu item appears justified at the right side of the menu bar.
GTK2.Widget get_submenu()
Gets the submenu underneath this menu item.
inherit GTK2.Activatable : Activatable
inherit GTK2.Item : Item
GTK2.MenuItem select()
Emulate a select signal
GTK2.MenuItem set_accel_path(string path)
Sets the accelerator path.
GTK2.MenuItem set_right_justified(int setting)
Make the menu item stick to the right edge of it's container.
GTK2.MenuItem set_submenu(GTK2.Widget menu)
Set the submenu for this menu button.
GTK2.MenuItem toggle_size_allocate(int allocation)
Emits the "toggle-size-allocate" signal on the given item.
int toggle_size_request(int requisition)
Emits the "toggle-size-request" signal on the given item.
CLASS GTK2.MenuShell |
A GTK2.MenuShell is the abstract base class used to derive the W(Menu) and W(MenuBar) subclasses.
A GTK2.MenuShell is a container of W(MenuItem) objects arranged in a list which can be navigated, selected, and activated by the user to perform application functions. A W(MenuItem) can have a submenu associated with it, allowing for nested hierarchical menus.
Signals: activate_current An action signal that activates the current menu item within the menu shell.
cancel An action signal which cancels the selection within the menu shell. Causes the selection-done signal to be emitted.
cycle_focus
deactivate This signal is emitted when a menu shell is deactivated.
move_current An action signal which moves the current menu item in the direction specified.
move_selected
selection_done This signal is emitted when a selection has been completed within a menu shell.
GTK2.MenuShell activate_item(GTK2.Widget menu_item, int force_deactivate)
Activates the menu item within the menu shell.
GTK2.MenuShell append(GTK2.Widget what)
Adds a new W(MenuItem) to the end of the menu shell's item list. Same as 'add'.
GTK2.MenuShell cancel()
Cancels the selection within the menu shell.
GTK2.MenuShell deactivate()
Deactivates the menu shell. Typically this results in the menu shell being erased from the screen.
GTK2.MenuShell deselect()
Deselects the currently selected item from the menu shell, if any.
array get_children()
This function returns all children of the menushell as an array.
int get_take_focus()
Returns TRUE if the menu shell will take the keyboard focus on popup.
inherit GTK2.Container : Container
GTK2.MenuShell insert(GTK2.Widget what, int where)
Add a widget after the specified location
GTK2.MenuShell prepend(GTK2.Widget what)
Add a menu item to the start of the widget (for a menu: top, for a bar: left)
GTK2.MenuShell select_first(int search_sensitive)
Select the first visible or selectable child of the menu shell; don't select tearoff items unless the only item is a tearoff item.
GTK2.MenuShell select_item(GTK2.Widget menuitem)
Selects the menu item from the menu shell.
GTK2.MenuShell set_take_focus(int setting)
If setting is TRUE (the default), the menu shell will take the keyboard focus so that it will receive all keyboard events which is needed to enable keyboard navigation in menus.
CLASS GTK2.MenuToolButton |
Properties to be notified. GTK2.Menu menu
Signals: show_menu
GTK2.MenuToolButton GTK2.MenuToolButton(GTK2.Widget icon, string|void label)
Create a new GTK2.MenuToolButton. If icon is a string, label should be omitted. If it isn't, it will be igrnored. The result will be a button from a stock item, one of STOCK_ABOUT, STOCK_ADD, STOCK_APPLY, STOCK_BOLD, STOCK_CANCEL, STOCK_CDROM, STOCK_CLEAR, STOCK_CLOSE, STOCK_COLOR_PICKER, STOCK_CONNECT, STOCK_CONVERT, STOCK_COPY, STOCK_CUT, STOCK_DELETE, STOCK_DIALOG_AUTHENTICATION, STOCK_DIALOG_ERROR, STOCK_DIALOG_INFO, STOCK_DIALOG_QUESTION, STOCK_DIALOG_WARNING, STOCK_DIRECTORY, STOCK_DISCONNECT, STOCK_DND, STOCK_DND_MULTIPLE, STOCK_EDIT, STOCK_EXECUTE, STOCK_FILE, STOCK_FIND, STOCK_FIND_AND_REPLACE, STOCK_FLOPPY, STOCK_FULLSCREEN, STOCK_GOTO_BOTTOM, STOCK_GOTO_FIRST, STOCK_GOTO_LAST, STOCK_GOTO_TOP, STOCK_GO_BACK, STOCK_GO_DOWN, STOCK_GO_FORWARD, STOCK_GO_UP, STOCK_HARDDISK, STOCK_HELP, STOCK_HOME, STOCK_INDENT, STOCK_INDEX, STOCK_INFO, STOCK_ITALIC, STOCK_JUMP_TO, STOCK_JUSTIFY_CENTER, STOCK_JUSTIFY_FILL, STOCK_JUSTIFY_LEFT, STOCK_JUSTIFY_RIGHT, STOCK_LEAVE_FULLSCREEN, STOCK_MEDIA_FORWARD, STOCK_MEDIA_NEXT, STOCK_MEDIA_PAUSE, STOCK_MEDIA_PLAY, STOCK_MEDIA_PREVIOUS, STOCK_MEDIA_RECORD, STOCK_MEDIA_REWIND, STOCK_MEDIA_STOP, STOCK_MISSING_IMAGE, STOCK_NETWORK, STOCK_NEW, STOCK_NO, STOCK_OK, STOCK_OPEN, STOCK_PASTE, STOCK_PREFERENCES, STOCK_PRINT, STOCK_PRINT_PREVIEW, STOCK_PROPERTIES, STOCK_QUIT, STOCK_REDO, STOCK_REFRESH, STOCK_REMOVE, STOCK_REVERT_TO_SAVED, STOCK_SAVE, STOCK_SAVE_AS, STOCK_SELECT_COLOR, STOCK_SELECT_FONT, STOCK_SORT_ASCENDING, STOCK_SORT_DESCENDING, STOCK_SPELL_CHECK, STOCK_STOP, STOCK_STRIKETHROUGH, STOCK_UNDELETE, STOCK_UNDERLINE, STOCK_UNDO, STOCK_UNINDENT, STOCK_YES, STOCK_ZOOM_100, STOCK_ZOOM_FIT, STOCK_ZOOM_IN and STOCK_ZOOM_OUT. If icon is a GTK2.Widget, it will be used as the icon, and label will be the label. The label must exist if that is the case.
GTK2.Widget get_menu()
Returns the GTK2.Menu.
inherit GTK2.ToolButton : ToolButton
GTK2.MenuToolButton set_arrow_tooltip(GTK2.Tooltips tooltips, string tip_text, string tip_private)
Sets the GTK2.Tooltips object to be used for the arrow button which pops up the menu.
GTK2.MenuToolButton set_menu(GTK2.Widget menu)
Sets the GTK2.Menu that is popped up when the user clicks on the arrow.
CLASS GTK2.MessageDialog |
A dialog with an image representing the type of message (Error, Question). alongside some message text. It's simply a convenience widget; you could construct the equivalent of GTK2.MessageDialog from GTK2.Dialog without too much effort, but GTK2.MessageDialog saves typing. Properties: int buttons GTK2.Widget image int message-type string secondary-text
Style properties: int message-border int use-separator
GTK2.MessageDialog GTK2.MessageDialog(mapping|int flags, int|void type, int|void buttons, string|void message, GTK2.Window parent)
Creates a new message dialog, which is a simple dialog with an icon indicating the dialog type (error, warning, etc) and some text the user may want to see. When the user clicks a button a "response" signal is emitted with response IDs from RESPONSE_ACCEPT, RESPONSE_APPLY, RESPONSE_CANCEL, RESPONSE_CLOSE, RESPONSE_DELETE_EVENT, RESPONSE_HELP, RESPONSE_NO, RESPONSE_NONE, RESPONSE_OK, RESPONSE_REJECT and RESPONSE_YES. See GTK2.Dialog for more details.
GTK2.MessageDialog format_secondary_markup(string text)
Sets the secondary text of the message dialog to be text, which is marked up with the Pango text markup language.
Note tha tsetting a secondary text makes the primary text become bold, unless you have provided explicit markup.
GTK2.MessageDialog format_secondary_text(string text)
Sets the secondary text of the message dialog to be text.
Note that setting a secondary text makes the primary text become bold, unless you have provided explicit markup.
inherit GTK2.Dialog : Dialog
GTK2.MessageDialog set_image(GTK2.Widget image)
Sets the dialog's image to image.
GTK2.MessageDialog set_markup(string text)
Sets the text of the message dialog to be text, which is marked up with the Pango text markup language.
CLASS GTK2.Misc |
The GTK2.Misc widget is an abstract widget which is not useful itself, but is used to derive subclasses which have alignment and padding attributes.
The horizontal and vertical padding attributes allows extra space to be added around the widget.
The horizontal and vertical alignment attributes enable the widget to be positioned within its allocated area. Note that if the widget is added to a container in such a way that it expands automatically to fill its allocated area, the alignment settings will not alter the widgets position.
GTK2.Vbox(0,0)->add(GTK2.Label("Label"))->set_size_request(100,20)
GTK2.Vbox(0,0)->add(GTK2.Label("Label")->set_alignment(1.0,0.0))->set_size_request(100,20)
GTK2.Vbox(0,0)->add(GTK2.Label("Label")->set_alignment(0.0,0.0))->set_size_request(100,20)
Properties: float xalign The horizontal alignment, from 0 (left) to 1 (right). int xpad The amount of space to add on the left and right of the widget, in pixels. float yalign The vertical alignment, from 0 (top) to 1 (bottom). int ypad The amount of space to add on the top and bottom of the widget, in pixels.
mapping get_alignment()
Gets the x and y alignment.
mapping get_padding()
Gets the x and y padding.
inherit GTK2.Widget : Widget
GTK2.Misc set_alignment(float xalign, float yalign)
Sets the alignment of the widget. 0.0 is left or topmost, 1.0 is right or bottommost.
GTK2.Misc set_padding(int xpad, int ypad)
Sets the amount of space to add around the widget. xpad and ypad are specified in pixels.
CLASS GTK2.Notebook |
The NoteBook Widget is a collection of 'pages' that overlap each other, each page contains different information. This widget has become more common lately in GUI programming, and it is a good way to show blocks similar information that warrant separation in their display.
GTK2.Notebook()->set_tab_pos(GTK2.POS_LEFT)->append_page(GTK2.Label("Page 1\nContents"),GTK2.Label("Page 1"))->append_page(GTK2.Label(""),GTK2.Label("Page 2"))->append_page(GTK2.Label("Page 3 contents\nare here!"),GTK2.Label("Page 3"))
GTK2.Notebook()->set_tab_pos(GTK2.POS_TOP)->append_page(GTK2.Label("Page 1\nContents"),GTK2.Label("Page 1"))->append_page(GTK2.Label(""),GTK2.Label("Page 2"))->append_page(GTK2.Label("Page 3 contents\nare here!"),GTK2.Label("Page 3"))
GTK2.Notebook()->set_tab_pos(GTK2.POS_RIGHT)->append_page(GTK2.Label("Page 1\nContents"),GTK2.Label("Page 1"))->append_page(GTK2.Label(""),GTK2.Label("Page 2"))->append_page(GTK2.Label("Page 3 contents\nare here!"),GTK2.Label("Page 3"))->next_page()->next_page()
Properties: int enable-popup int homogeneous int page int scrollable int show-border int show-tabs int tab-border int tab-hborder int tab-pos int tab-vborder
Child properties: string menu-label int position int tab-expand int tab-fill string tab-label int tab-pack
Style properties: int has-backward-stepper int has-forward-stepper int has-secondary-backward-stepper int has-secondary-forward-stepper int tab-curvature int tab-overlap
Signals: change_current_page
focus_tab
move_focus_out
select_page
switch_page Called when a different page is selected
GTK2.Notebook append_page(GTK2.Widget contents, GTK2.Widget label)
Add a new 'page' to the notebook. The first argument is the contents of the page, the second argument is the label.
GTK2.Notebook append_page_menu(GTK2.Widget contents, GTK2.Widget label, GTK2.Widget menu)
Add a new 'page' to the notebook. The first argument is the contents of the page, the second argument is the label, the third argument is a menu label widget.
GTK2.Notebook GTK2.Notebook(mapping|void props)
Create a W(Notebook) widget with no pages.
int get_current_page()
Returns the index of the currently selected page
int get_group_id()
Gets the current group identifier.
GTK2.Widget get_menu_label(GTK2.Widget page)
Return the menu label widget.
string get_menu_label_text(GTK2.Widget child)
Retrieves the text of the menu label for the page containing child.
int get_n_pages()
Get the number of pages.
GTK2.Widget get_nth_page(int index)
Returns the page for the specified index
int get_scrollable()
Returns whether the tab label area has arrows for scrolling.
int get_show_border()
Returns whether a bevel will be drawn around the pages.
int get_show_tabs()
Returns whether the tabs of the notebook are shown.
int get_tab_detachable(GTK2.Widget child)
Returns whether the tab contents can be detached.
GTK2.Widget get_tab_label(GTK2.Widget page)
Returns the tab label widget.
string get_tab_label_text(GTK2.Widget child)
Retrieves the text of the tab label for the page containing child.
int get_tab_pos()
Gets the edge at which the tabs are located.
int get_tab_reorderable(GTK2.Widget child)
Gets whether the tab can be reordered via drag and drop or not.
inherit GTK2.Container : Container
GTK2.Notebook insert_page(GTK2.Widget contents, GTK2.Widget label, int pos)
Insert a page at the specified location, arguments as for append_page, but an aditional integer specifies the location.
GTK2.Notebook insert_page_menu(GTK2.Widget contents, GTK2.Widget label, GTK2.Widget menu, int pos)
Insert a page at the specified location, arguments as for append_page_menu, but an additional integer specifies the location.
GTK2.Notebook next_page()
Go to the next page
int page_num(GTK2.Widget widget)
Returns the index for the specified page.
GTK2.Notebook popup_disable()
Disable the popup menu (set with insert_page_menu).
GTK2.Notebook popup_enable()
Enable the popup menu (set with insert_page_menu).
GTK2.Notebook prepend_page(GTK2.Widget contents, GTK2.Widget label)
Add a page at the end of the list of pages. The first argument is the contents of the page, the second argument is the label.
GTK2.Notebook prepend_page_menu(GTK2.Widget contents, GTK2.Widget label, GTK2.Widget menu)
Add a new 'page' at the end of the list of pages. The first argument is the contents of the page, the second argument is the label, the third argument is a menu label widget.
GTK2.Notebook prev_page()
Go to the previous page
mapping query_tab_label_packing(GTK2.Widget page)
Returns ([ "expand":expandp, "fill":fillp, "pack_type":type ])
GTK2.Notebook remove_page(int pos)
Remove a page.
GTK2.Notebook reorder_child(GTK2.Widget child, int position)
Reorders the page containing child, so that it appears at position.
GTK2.Notebook set_current_page(int pos)
Go to the specified page
GTK2.Notebook set_group_id(int id)
Sets an group identifier for notebook; notebooks sharing the same group identifier will be able to exchange tabs via drag and drop. A notebook with group identifier -1 will not be able to exchange tabs with any other notebook.
GTK2.Notebook set_menu_label(GTK2.Widget child, GTK2.Widget label)
Changes the menu label for the page containing child.
GTK2.Notebook set_menu_label_text(GTK2.Widget child, string label_text)
Creates a new label with label_text sets it as the menu label.
GTK2.Notebook set_scrollable(int scrollablep)
If true, add scrollbars if necessary.
GTK2.Notebook set_show_border(int showborderp)
If true, show the borders around the contents and tabs.
GTK2.Notebook set_show_tabs(int showtabsp)
If supplied with a true value, the tabs will be shown. Otherwise they will not be shown. The user will not be able to select the pages without them, but you can add 'next' and 'previous' buttons to create a wizard-line interface.
GTK2.Notebook set_tab_label(GTK2.Widget child, GTK2.Widget label)
Changes the tab label for child.
GTK2.Notebook set_tab_label_packing(GTK2.Widget child, int expand, int fill, int type)
Sets the packing parameters for the tab label of the page child.
GTK2.Notebook set_tab_label_text(GTK2.Widget child, string title)
Creates a new label and sets it as the tab label for the page containing child.
GTK2.Notebook set_tab_pos(int pos)
Sets the edge at which the tabs for switching pages in the notebook are drawn. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP
CLASS GTK2.Object |
The basic GTK class. All other GTK classes inherit this class. The only user-callable functions are the signal related ones. Properties: gpointer user-data
Signals: destroy
inherit G.InitiallyUnowned : InitiallyUnowned
CLASS GTK2.PageSetup |
A GtkPageSetup object stores the page size, orientation and margins. The idea is that you can get one of these from the page setup dialog and then pass it to the GTK2.PrintOperation when printing. The benefit of splitting this out of the GTK2.PrintSettings is that these affect the actual layout of the page, and thus need to be set long before user prints.
GTK2.PageSetup copy()
Returns a copy of this GTK2.PageSetup.
GTK2.PageSetup GTK2.PageSetup(mapping|void props)
Create a new GTK2.PageSetup.
float get_bottom_margin(int unit)
Gets the bottom margin in units of unit.
float get_left_margin(int unit)
Gets the left margin in units of unit.
int get_orientation()
Gets the page orientation.
float get_page_height(int unit)
Returns the page height in units of unit.
float get_page_width(int unit)
Returns the page width in units of unit.
float get_paper_height(int unit)
Returns the paper height in units of unit.
GTK2.PaperSize get_paper_size()
Gets the paper size.
float get_paper_width(int unit)
Returns the paper width in units of unit.
float get_right_margin(int unit)
Gets the right margin in units of unit.
float get_top_margin(int unit)
Gets the top margin in units of unit.
inherit G.Object : Object
GTK2.PageSetup set_bottom_margin(float margin, int unit)
Sets the bottom margin.
GTK2.PageSetup set_left_margin(float margin, int unit)
Sets the left margin.
GTK2.PageSetup set_orientation(int orientation)
Sets the page orientation.
GTK2.PageSetup set_paper_size(GTK2.PaperSize size)
Sets the paper size without changing the margins.
GTK2.PageSetup set_paper_size_and_default_margins(GTK2.PaperSize size)
Sets the paper size and modifies the margins.
GTK2.PageSetup set_right_margin(float margin, int unit)
Sets the right margin.
GTK2.PageSetup set_top_margin(float margin, int unit)
Sets the top margin.
CLASS GTK2.Paned |
GTK2.Paned is the base class for widgets with two panes, arranged either horizontally (W(HPaned)) or vertically (W(VPaned)). Child widgets are added to the panes of the widget with pack1() and pack2(). The division beween the two children is set by default from the size requests of the children, but it can be adjusted by the user.
A paned widget draws a separator between the two child widgets and a small handle that the user can drag to adjust the division. It does not draw any relief around the children or around the separator. (The space in which the separator is called the gutter). Often, it is useful to put each child inside a W(Frame) with the shadow type set to GTK2.ShadowIn so that the gutter appears as a ridge.
Each child has two options that can be set, resize and shrink. If resize is true, then when the GTK2.Paned is resized, that child will expand or shrink along with the paned widget. If shrink is true, then when that child can be made smaller than it's requisition by the user. Setting shrink to 0 allows the application to set a minimum size. If resize is false for both children, then this is treated as if resize is true for both children.
The application can set the position of the slider as if it were set by the user, by calling set_position().
Properties: int max-position int min-position int position int position-set
Child properties: int resize int shrink
Style properties: int handle-size
Signals: accept_position
cancel_position
cycle_child_focus
cycle_handle_focus
move_handle
toggle_handle_focus
GTK2.Paned add1(GTK2.Widget left_or_top)
Set the left or topmost item. This is equivalent to pack1(left_or_top,0,1)
GTK2.Paned add2(GTK2.Widget right_or_bottom)
Set the right or bottommost item This is equivalent to pack2(left_or_top,0,1)
GTK2.Widget get_child1()
Obtains the first child of the paned widget.
GTK2.Widget get_child2()
Obtains the second child of the paned widget.
int get_position()
Obtains the position of the divider between the two panes.
inherit GTK2.Container : Container
GTK2.Paned pack1(GTK2.Widget widget, int resize, int shrink)
Add a child to the top or left pane.
GTK2.Paned pack2(GTK2.Widget widget, int resize, int shrink)
Add a child to the bottom or right pane.
GTK2.Paned set_position(int position)
Set the position of the separator, as if set by the user. If position is negative, the remembered position is forgotten, and the division is recomputed from the the requisitions of the children.
CLASS GTK2.PaperSize |
A Paper Size.
GTK2.PaperSize copy()
Copy this GTK2.PaperSize.
GTK2.PaperSize GTK2.PaperSize(string|void name, string|void ppd_display_name, float|void width, float|void height, int|void unit)
Create a new GTK2.PaperSize object by parsing a PWG 5101.1-2002 PWG paper name.
GTK2.PaperSize destroy()
Destructor.
string get_default()
Returns the name of the default paper size.
float get_default_bottom_margin(int unit)
Gets the default bottom margin.
float get_default_left_margin(int unit)
Gets the default left margin.
float get_default_right_margin(int unit)
Gets the default right margin.
float get_default_top_margin(int unit)
Gets the default top margin.
string get_display_name()
Get the human-readable name.
float get_height(int unit)
Gets the paper height in units of unit.
string get_name()
Get the name.
string get_ppd_name()
Get the ppd name. May return an empty string.
float get_width(int unit)
Gets the paper width in units of unit.
int is_custom()
Returns 1 if this paper size is not a standard paper size.
int is_equal(GTK2.PaperSize size1)
Comparison.
GTK2.PaperSize set_size(float width, float height, int unit)
Changes the dimensions to width x height.
CLASS GTK2.PatternTag |
GTK2.PatternTag GTK2.PatternTag(string id, string name, string pattern)
Creates a new pattern tag object with the provided arguments.
inherit GTK2.SourceTag : SourceTag
CLASS GTK2.Plug |
Together with W(Socket), GTK2.Plug provides the ability to embed widgets from one process into another process in a fashion that is transparent to the user. One process creates a W(Socket) widget and, passes the XID of that widgets window to the other process, which then creates a GTK2.Plug window with that XID. Any widgets contained in the GTK2.Plug then will appear inside the first applications window. Properties int embedded
Signals: embedded
GTK2.Plug GTK2.Plug(int|mapping socket_id_or_props)
Create a new plug, the socket_id is the window into which this plug will be plugged.
int get_id()
Gets the window id of this widget.
inherit GTK2.Window : Window
CLASS GTK2.PrintContext |
GTK2.Pango.Context create_pango_context()
Creates a new Pango.Context that can be used with this PrintContext.
GTK2.Pango.Layout create_pango_layout()
Creates a new Pango.Layout that is suitable for use with this PrintContext.
float get_dpi_x()
Obtains the horizontal resolution, in dots per inch.
float get_dpi_y()
Obtains the vertical resolution, in dots per inch.
float get_height()
Obtains the height, in pixels.
GTK2.PageSetup get_page_setup()
Obtains the GTK2.PageSetup that determines the page dimensions.
float get_width()
Obtains the width, in pixels.
inherit G.Object : Object
CLASS GTK2.Progress |
Properties: int activity-mode int show-text float text-xalign float text-yalign
inherit GTK2.Widget : Widget
CLASS GTK2.ProgressBar |
A simple progress bar. Useful when you are doing things that take a long
time. Try to always have an 'abort' button whenever it makes sence.
GTK2.ProgressBar()->set_fraction(0.1)
GTK2.ProgressBar()->set_property("show_text", 1)->set_fraction(0.3)
GTK2.ProgressBar()->set_fraction(0.6)
GTK2.ProgressBar()->set_fraction(1.0)
Properties: int discrete-blocks int ellipsize PANGO_ELLIPSIZE_END, PANGO_ELLIPSIZE_MIDDLE, PANGO_ELLIPSIZE_NONE and PANGO_ELLIPSIZE_START float fraction int orientation PROGRESS_BOTTOM_TO_TOP, PROGRESS_CONTINUOUS, PROGRESS_DISCRETE, PROGRESS_LEFT_TO_RIGHT, PROGRESS_RIGHT_TO_LEFT and PROGRESS_TOP_TO_BOTTOM float pulse-step string text
GTK2.ProgressBar GTK2.ProgressBar(mapping|void props)
Create a new progress bar. The default values are: Min 0.0, max 1.0, current 0.0
int get_ellipsize()
Returns the ellipsizing position of the progressbar.
float get_fraction()
Returns the current fraction of the task that's been completed.
int get_orientation()
Retrieves the current progress bar orientation.
float get_pulse_step()
Retrieves the pulse step.
string get_text()
Retrieves the text displayed superimposed on the progress bar, if any.
inherit GTK2.Progress : Progress
GTK2.ProgressBar pulse()
Indicates that some progress is made, but you don't know how much. Causes the progress bar to enter "activity mode", where a block bounces back and forth. Each call to pulse() causes the block to move by a little bit (the amount of movement per pulse is determined by set_pulse_step()).
GTK2.ProgressBar set_ellipsize(int mode)
Sets the mode used to ellipsize (add an ellipsis: "...") the text if there is not enough space to render the entire string. One of PANGO_ELLIPSIZE_END, PANGO_ELLIPSIZE_MIDDLE, PANGO_ELLIPSIZE_NONE and PANGO_ELLIPSIZE_START.
GTK2.ProgressBar set_fraction(float fraction)
Causes the progress bar to "fill in" the given fraction of the bar. The fraction should be between 0.0 and 1.0, inclusive.
GTK2.ProgressBar set_orientation(int style)
Causes the progress bar to switch to a different orientation (left-to-right, right-to-left, top-to-bottom, or bottom-to-top). One of PROGRESS_BOTTOM_TO_TOP, PROGRESS_CONTINUOUS, PROGRESS_DISCRETE, PROGRESS_LEFT_TO_RIGHT, PROGRESS_RIGHT_TO_LEFT and PROGRESS_TOP_TO_BOTTOM.
GTK2.ProgressBar set_pulse_step(float fraction)
Sets the fraction of total progress bar length to move the bouncing block for each call to pulse().
GTK2.ProgressBar set_text(sprintf_format text, sprintf_args ... fmt)
Causes the given text to appear superimposed on the progress bar.
CLASS GTK2.RadioAction |
Properties int current-value GTK2.RadioAction group int value
Signals: changed
GTK2.RadioAction GTK2.RadioAction(string|mapping name_or_props, string|void label, string|void tooltip, string|void stock_id, int|void value)
Creates a new GTK2.ToggleAction object.
int get_current_value()
Obtains the value property of the currently active member.
array get_group()
Returns the list representing the radio group.
inherit GTK2.ToggleAction : ToggleAction
GTK2.RadioAction set_current_value(int value)
Sets the currently active group member to the member with value property value.
GTK2.RadioAction set_group(GTK2.RadioAction member)
Sets the radio group.
CLASS GTK2.RadioButton |
Radio buttons are similar to check buttons except they are grouped so that only one may be selected/depressed at a time. This is good for places in your application where you need to select from a short list of options. To connect the buttons, use another button in the desired group as the second argument to GTK2.RadioButton().
GTK2.RadioButton("Button");
Properties: GTK2.RadioButton group
Signals: group_changed
GTK2.RadioButton GTK2.RadioButton(string|mapping title, GTK2.RadioButton groupmember, int|void mnemonic)
Normal creation: object GTK2.RadioButton(string title) - First button (with label) object GTK2.RadioButton()->add(widget) - First button (with widget) object GTK2.RadioButton(title, another_radio_button) - Second to n:th button (with title) object GTK2.RadioButton(0,another_radio_button)->add(widget) - Second to n:th button (with widget)
array get_group()
Returns an array of members in this group.
inherit GTK2.CheckButton : CheckButton
GTK2.RadioButton set_group(GTK2.RadioButton groupmember)
the argument is another radio button to whose group this button should be added to. It is prefereable to use the second argument to the constructor instead, but if you for some reason want to move the button to another group, use this function.
CLASS GTK2.RadioMenuItem |
Exactly like W(RadioButton), but it is an menu item.
GTK2.RadioMenuItem("Menu item")
Properties:
GTK2.RadioMenuItem group
Signals: group_changed
GTK2.RadioMenuItem GTK2.RadioMenuItem(string|mapping title, GTK2.RadioMenuItem groupmember)
object GTK2.RadioMenuItem(string title) - First button (with label) object GTK2.RadioMenuItem()->add(widget) - First button (with widget) object GTK2.RadioMenuItem(title, another_radio_button) - Second to n:th button (with title) object GTK2.RadioMenuItem(0,another_radio_button)->add(widget) - Second to n:th button (with widget)
array get_group()
Returns the group to which the radio menu item belongs.
inherit GTK2.CheckMenuItem : CheckMenuItem
GTK2.RadioMenuItem set_group(GTK2.RadioMenuItem groupmember)
The argument is another radio menu item to whose group this button should be added to. It is prefereable to use the second argument to the constructor instead, but if you for some reason want to move the button to another group, use this function.
CLASS GTK2.RadioToolButton |
Properties: GTK2.RadioToolButton group
GTK2.RadioToolButton GTK2.RadioToolButton(GTK2.RadioToolButton groupmember)
Create a GTK2.RadioToolButton. Use without a parameter for a new group. Use with another GTK2.RadioToolButton to add another button to the same group as a previous button.
array get_group()
Get the group this button belongs to.
inherit GTK2.ToggleToolButton : ToggleToolButton
CLASS GTK2.Range |
The category of range widgets includes the ubiquitous scrollbar widget and the less common "scale" widget. Though these two types of widgets are generally used for different purposes, they are quite similar in function and implementation. All range widgets share a set of common graphic elements, each of which has its own X window and receives events. They all contain a "trough" and a "slider" (what is sometimes called a "thumbwheel" in other GUI environments). Dragging the slider with the pointer moves it back and forth within the trough, while clicking in the trough advances the slider towards the location of the click, either completely, or by a designated amount, depending on which mouse button is used.
As mentioned in the W(Adjustment) page, all range widgets are associated with an adjustment object, from which they calculate the length of the slider and its position within the trough. When the user manipulates the slider, the range widget will change the value of the adjustment.
All of the GTK range widgets react to mouse clicks in more or less the same way. Clicking button-1 in the trough will cause its adjustment's page_increment to be added or subtracted from its value, and the slider to be moved accordingly. Clicking mouse button-2 in the trough will jump the slider to the point at which the button was clicked. Clicking any button on a scrollbar's arrows will cause its adjustment's value to change step_increment at a time.
It may take a little while to get used to, but by default, scrollbars as well as scale widgets can take the keyboard focus in GTK. If you think your users will find this too confusing, you can always disable this by unsetting the GTK2.CanFocus flag on the scrollbar, like this:
scrollbar->unset_flag(GTK2.CanFocus);
The key bindings (which are, of course, only active when the widget has focus) are slightly different between horizontal and vertical range widgets, for obvious reasons. They are also not quite the same for scale widgets as they are for scrollbars, for somewhat less obvious reasons (possibly to avoid confusion between the keys for horizontal and vertical scrollbars in scrolled windows, where both operate on the same area).
Properties: GTK2.Adjustment adjustment float fill-level int inverted int restrict-to-fill-level int show-fill-level int update-policy
Style properties: int arrow-displacement-x int arrow-displacement-y int slider-width int stepper-size int stepper-spacing int trough-border int trough-side-details int trough-under-steppers
Signals: adjust_bounds
change_value
move_slider
value_changed
GTK2.Adjustment get_adjustment()
Gets the W(Adjustment) which is the "model" object for W(Range).
float get_fill_level()
Gets the current position of the fill level indicator.
int get_inverted()
Gets the value set by set_inverted().
GTK2.Range get_lower_stepper_sensitivity()
Gets the sensitivity policy for the stepper that points to the 'lower' end of the GTK2.Range's adjustment.
int get_restrict_to_fill_level()
Gets whether the range is restricted to the fill level.
int get_show_fill_level()
Gets whether the range displays the fill level graphically.
int get_update_policy()
Gets the update policy.
GTK2.Range get_upper_stepper_sensitivity()
Gets the sensitivity policy for the stepper that points to the 'upper' end of the GTK2.Range's adjustment.
float get_value()
Gets the current value.
inherit GTK2.Widget : Widget
GTK2.Range set_adjustment(GTK2.Adjustment pos)
set_adjustment() does absolutely nothing if you pass it the adjustment that range is already using, regardless of whether you changed any of its fields or not. If you pass it a new Adjustment, it will unreference the old one if it exists (possibly destroying it), connect the appropriate signals to the new one, and call the private function gtk_range_adjustment_changed(), which will (or at least, is supposed to...) recalculate the size and/or position of the slider and redraw if necessary.
GTK2.Range set_fill_level(float fill)
Set the new position of the fill level indicator.
GTK2.Range set_increments(float step, float page)
Sets the step and page sizes. The step size is used when the user clicks the W(Scrollbar) arrows or moves W(Scale) via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.
GTK2.Range set_inverted(int setting)
Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the right rather than on the bottom or left.
GTK2.Range set_lower_stepper_sensitivity(int sensitivity)
Sets the sensitivity policy for the stepper that points to the 'lower' end of the GTK2.Range's adjustment.
GTK2.Range set_range(float min, float max)
Sets the allowable values, and clamps the range value to be between min and max.
GTK2.Range set_restrict_to_fill_level(int rest)
Sets whether the slider is restricted to the fill level
GTK2.Range set_show_fill_level(int show)
Sets whether a graphical fill level is show on the trough.
GTK2.Range set_update_policy(int when)
The "update policy" of a range widget defines at what points during user interaction it will change the value field of its Adjustment and emit the "value_changed" signal on this Adjustment. The update policies are:
This is the default. The "value_changed" signal is emitted continuously, i.e., whenever the slider is moved by even the tiniest amount.
The "value_changed" signal is only emitted once the slider has stopped moving and the user has released the mouse button.
The "value_changed" signal is emitted when the user releases the mouse button, or if the slider stops moving for a short period of time.
GTK2.Range set_upper_stepper_sensitivity(int sensitivity)
Sets the sensitivity policy for the stepper that points to the 'upper' end of the GTK2.Range's adjustment.
GTK2.Range set_value(float value)
Sets the current value; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them. The range emits the "value-changed" signal if the value changes.
CLASS GTK2.RcStyle |
RC settings.
GTK2.RcStyle copy()
Makes a copy.
GTK2.RcStyle GTK2.RcStyle()
Creates a new W(Rc).
inherit G.Object : Object
GTK2.RcStyle set_base(array colors)
Set base.
GTK2.RcStyle set_bg(array colors)
Set bg.
GTK2.RcStyle set_bg_pixmap_name(array names)
Set bg_pixmap_name.
GTK2.RcStyle set_color_flags(array flags)
Set color_flags.
GTK2.RcStyle set_fg(array colors)
Set fg.
GTK2.RcStyle set_name(string name)
Set the name.
GTK2.RcStyle set_text(array colors)
Set text.
GTK2.RcStyle set_xthickness(int value)
Set xthickness.
GTK2.RcStyle set_ythickness(int value)
Set ythickness.
CLASS GTK2.RecentChooser |
GTK2.RecentChooser add_filter(GTK2.RecentFilter filter)
Adds filter to the list of GTK2.RecentFilter objects held by chooser.
GTK2.RecentInfo get_current_item()
Gets the GTK2.RecentInfo currently selected.
string get_current_uri()
Gets the URI currently selected.
GTK2.RecentFilter get_filter()
Gets the filter currently used.
array get_items()
Gets the list of recently used resources in form of GTK2.RecentInfo objects.
The return value of this function is affected by the "sort-type" and "limit" properties of chooser
int get_limit()
Gets the number of items returned by get_items() and get_uris().
int get_local_only()
Gets whether only local resources should be shown in the recently used resources selector.
int get_select_multiple()
Gets whether chooser can select multiple items.
int get_show_icons()
Retrieves whether chooser should show an icon near the resource.
int get_show_not_found()
Retrieves whether chooser should show the recently used resources that were not found.
int get_show_numbers()
Returns whether chooser should display recently used resources prepended by a unique number.
int get_show_private()
Returns whether chooser should display recently used resources registered as private.
int get_show_tips()
Gets whether chooser should display tooltips.
int get_sort_type()
Gets the sorting order.
array get_uris()
Gets the URI of the recently used resources.
The return value of this function is affected by the "sort-type" and "limit" properties.
array list_filters()
Gets a list of filters.
GTK2.RecentChooser remove_filter(GTK2.RecentFilter filter)
Removes filter.
GTK2.RecentChooser select_all()
Selects all the items inside chooser, if the chooser supports multiple selection.
int select_uri(string uri)
Selects uri.
int set_current_uri(string uri)
Sets uri as the current URI.
GTK2.RecentChooser set_filter(GTK2.RecentFilter filter)
Sets filter as the current GTK2.RecentFilter object to affect the displayed recently used resources.
GTK2.RecentChooser set_limit(int limit)
Sets the number of items that should be returned by get_items() and get_uris().
GTK2.RecentChooser set_local_only(int local_only)
Sets whether only local resources, that is resources using the file:// URI scheme, should be shown in the recently used resources selector. If local_only is TRUE (the default) then the shown resources are guaranteed to be accessible through the operating system native file system.
GTK2.RecentChooser set_select_multiple(int select_multiple)
Sets whether chooser can select multiple items.
GTK2.RecentChooser set_show_icons(int show_icons)
Sets whether chooser should show an icon near the resource when displaying it.
GTK2.RecentChooser set_show_not_found(int show_not_found)
Sets whether chooser should display the recently used resources that it didn't find. This only applies to local resources.
GTK2.RecentChooser set_show_numbers(int show_numbers)
Whether to show recently used resources prepended by a unique number.
GTK2.RecentChooser set_show_private(int show_private)
Whether to show recently used resources marked registered as private.
GTK2.RecentChooser set_show_tips(int show_tips)
Sets whether to show a tooltips on the widget.
GTK2.RecentChooser set_sort_type(int sort_type)
Changes the sorting order of the recently used resources list displayed by chooser.
GTK2.RecentChooser unselect_all()
Unselects all the items.
GTK2.RecentChooser unselect_uri(string uri)
Unselects uri.
CLASS GTK2.RecentChooserDialog |
GTK2.RecentChooserDialog GTK2.RecentChooserDialog(mapping|string title, GTK2.Window parent, array buttons, GTK2.RecentManager manager)
Creates a new RecentChooserDialog. Analogous to GTK2.Dialog->create().
inherit GTK2.Dialog : Dialog
inherit GTK2.RecentChooser : RecentChooser
CLASS GTK2.RecentChooserMenu |
GTK2.RecentChooserMenu GTK2.RecentChooserMenu(mapping|RecentManager props)
Create a new GTK2.RecentChooserMenu.
int get_show_numbers()
Returns true if numbers should be shown.
inherit GTK2.Activatable : Activatable
inherit GTK2.Menu : Menu
inherit GTK2.RecentChooser : RecentChooser
GTK2.RecentChooserMenu set_show_numbers(int show_numbers)
Sets whether a number should be added to the items of menu. The numbers are shown to provide a unique character for a mnemonic to be used inside the menu item's label. Only the first items get a number to avoid clashes.
CLASS GTK2.RecentChooserWidget |
GTK2.RecentChooserWidget GTK2.RecentChooserWidget(mapping|RecentManager props)
Create a new GTK2.RecentChooserWidget.
inherit GTK2.RecentChooser : RecentChooser
inherit GTK2.Vbox : Vbox
CLASS GTK2.RecentFilter |
A filter for selecting a subset of recently used files.
GTK2.RecentFilter add_age(int days)
Adds a rule that allows resources based on their age - that is, the number of days elapsed since they were last modified.
GTK2.RecentFilter add_application(string application)
Adds a rule that allows resources based on the name of the application that has registered them.
GTK2.RecentFilter add_group(string group)
Adds a rule that allows resources based on the name of the group to which they belong.
GTK2.RecentFilter add_mime_type(string mime_type)
Adds a rule that allows resources based on their registered MIME type.
GTK2.RecentFilter add_pattern(string pattern)
Adds a rule that allows resources based on a pattern matching their display name.
GTK2.RecentFilter add_pixbuf_formats()
Adds a rule allowing image files in the formats supported by GdkPixbuf.
GTK2.RecentFilter GTK2.RecentFilter(mapping|void props)
Create a new GTK2.RecentFilter.
string get_name()
Gets the human-readable name for the filter.
inherit GTK2.Object : Object
GTK2.RecentFilter set_name(string name)
Sets the human-readable name of the filter; this is the string that will be displayed in the recently used resources selector user interface if there is a selectable list of filters.
CLASS GTK2.RecentInfo |
GTK2.RecentInfo destroy()
Destructor.
int exists()
Checks whether the resource pointed by info still exists. At the moment this check is done only on resources pointing to local files.
int get_added()
Gets the timestamp (seconds from system's Epoch) when the resource was added to the recently used resources list.
int get_age()
Gets the number of days elapsed since the last update of the resource pointed by info.
string get_description()
Gets the (short) description of the resource. Gets the (short) description of the resource.
string get_display_name()
Gets the name of the resource. If none has been defined, the basename of the resource is obtained.
array get_groups()
Returns all groups registered for the recently used item.
GTK2.GdkPixbuf get_icon(int size)
Retrieves the icon of size size associated to the resource MIME type.
string get_mime_type()
Gets the MIME type of the resource.
int get_modified()
Gets the timestamp (seconds from system's Epoch) when the resource was last modified.
int get_private_hint()
Gets the value of the "private" flag. Resources in the recently used list that have this flag set to TRUE should only be displayed by the applications that have registered them.
string get_short_name()
Computes a string that can be used as the name of the item in a menu or list. For example, calling this function on an item that refers to "file:///foo/bar.txt" will yield "bar.txt".
string get_uri()
Gets the URI of the resource.
string get_uri_display()
Gets a displayable version of the resource's URI.
int get_visited()
Gets the timestamp (seconds from system's Epoch) when the resource was last visited.
int has_application()
Checks whether an application registered this resource using app_name.
int has_group(string group_name)
Checks whether group_name appears inside the groups registered for the recently used item info.
int is_local()
Checks whether the resource is local or not by looking at the scheme of its URI.
string last_application()
Gets the name of the last application that have registered the recently used resource represented by info.
int match(GTK2.RecentInfo b)
Checks whether two GTK2.RecentInfo structures point to the same resource.
CLASS GTK2.RecentManager |
int add_item(string uri)
Adds a new resource, pointed by uri, into the recently used resources list.
GTK2.RecentManager GTK2.RecentManager(mapping|int|GdkScreen props_or_def)
Create a new GTK2.RecentManager.
array get_items()
Gets the list of recently used resources.
int get_limit()
Gets the maximum number of items that the get_items() function should return.
int has_item(string uri)
Checks whether there is a recently used resource registered with uri inside the recent manager.
inherit G.Object : Object
mapping lookup_item(string uri)
Searches for a URI inside the recently used resources list, and returns a structure containing information about the resource like its MIME type, or its display name.
int move_item(string uri, string new_uri)
Changes the location of a recently used resource from uri to new_uri.
int purge_items()
Purges every item from the recently used resources list.
int remove_item(string uri)
Removes a resource pointed by uri from the recently used resources list handled by a recent manager.
GTK2.RecentManager set_limit(int limit)
Sets the maximum number of item that the get_items() function should return. If limit is set to -1, then return all the items.
GTK2.RecentManager set_screen(GTK2.GdkScreen screen)
Sets the screen for a recent manager; the screen is used to track the user's currently configured recently used documents storage.
CLASS GTK2.Scale |
The GTK2.Scale widget is an abstract class, used only for deriving the subclasses GTK2.Hscale and GTK2.Vscale.
See W(Range) for generic range documentation
Properties: int digits int draw-value int value-pos
Style properties: int slider-length int value-spacing
Signals: format_value
GTK2.Scale clear_marks()
Removes any marks that have been added with add_mark().
int get_digits()
Gets the number of decimal places that are displayed.
int get_draw_value()
Returns whether the current value is displayed as a string next to the slider.
GTK2.Pango.Layout get_layout()
Gets the Pango.Layout used to display the scale.
mapping get_layout_offsets()
Obtains the coordinates where the scale will draw the Pango.Layout representing the text in the scale. Remember when using the Pango.Layout function you need to convert to and from pixels using PANGO_SCALE.
int get_value_pos()
Gets the position in which the current value is displayed.
inherit GTK2.Range : Range
GTK2.Scale set_digits(int precision)
Sets the number of decimal places that are displayed in the value.
GTK2.Scale set_draw_value(int drawp)
Specifies whether the current value is displayed as a string next to the slider.
GTK2.Scale set_value_pos(int where)
Sets the position in which the current value is displayed. One of POS_BOTTOM, POS_LEFT, POS_RIGHT and POS_TOP
CLASS GTK2.ScaleButton |
Properties: GTK2.Adjustment adjustment string icons int size float value
Signals: popdown
popup
value_changed Scale button
GTK2.ScaleButton GTK2.ScaleButton(int|void size_or_props, float|void min, float|void max, float|void step, array|void icons)
Create a new W(ScaleButton).
GTK2.Adjustment get_adjustment()
Returns the GTK2.Adjustment associated with this scale.
float get_value()
Gets the current value.
inherit GTK2.Button : Button
GTK2.ScaleButton set_adjustment(GTK2.Adjustment adj)
Sets the GTK2.Adjustment to be used as a model.
GTK2.ScaleButton set_icons(array icons)
Sets the icons to be used.
GTK2.ScaleButton set_value(float val)
Sets the current value of the scale; if the scale is outside the minimum or maximum range values, it will be clamped to fit inside them. The button emits the "value-changed" signal if the value changes.
CLASS GTK2.Scrollbar |
These are your standard, run-of-the-mill scrollbars. These should be used only for scrolling some other widget, such as a list, a text box, or a viewport (and it's generally easier to use the scrolled window widget in most cases). For other purposes, you should use scale widgets, as they are friendlier and more featureful. Style properties: int fixed-slider-length int has-backward-stepper int has-forward-stepper int has-secondary-backward-stepper int has-secondary-forward-stepper int min-slider-length
inherit GTK2.Range : Range
CLASS GTK2.ScrolledWindow |
Scrolled windows are used to create a scrollable area with another widget inside it. You may insert any type of widget into a scrolled window, and it will be accessible regardless of its size by using the scrollbars.
GTK2.ScrolledWindow(GTK2.Adjustment(),GTK2.Adjustment())->add(GTK2.Label("A small label"))->set_policy(GTK2.POLICY_AUTOMATIC,GTK2.POLICY_AUTOMATIC)
GTK2.ScrolledWindow(GTK2.Adjustment(),GTK2.Adjustment())->add(GTK2.Label("A small label"))->set_policy(GTK2.POLICY_AUTOMATIC,GTK2.POLICY_AUTOMATIC)
GTK2.ScrolledWindow(GTK2.Adjustment(),GTK2.Adjustment())->add(GTK2.Label("A small label"))
GTK2.ScrolledWindow(GTK2.Adjustment(),GTK2.Adjustment())->add(GTK2.Label("a very huge label"))
Properties: GTK2.Adjustment hadjustment int hscrollbar-policy int shadow-type GTK2.Adjustment vadjustment int vscrollbar-policy int window-placement
Style properties: int scrollbar-spacing int scrollbars-within-bevel
Signals: move_focus_out
scroll_child
GTK2.ScrolledWindow add(GTK2.Widget victim)
Add a widget to this container. This is equivalent to the C-GTK function gtk_scrolled_window_add_with_viewport or gtk_container_add, depending on whether or not the child supports the set_scroll_adjustments signal.
What this means in practice is that you do not have to care about this at all, it's all handled automatically.
GTK2.ScrolledWindow GTK2.ScrolledWindow(GTK2.Adjustment hadjustment_or_props, GTK2.Adjustment vadjustments)
The two adjustments are most commonly set to 0.
GTK2.Adjustment get_hadjustment()
Get the horizontal adjustment.
GTK2.HScrollbar get_hscrollbar()
Returns the horizontal scrollbar.
int get_placement()
Gets the placement of the scrollbars.
mapping get_policy()
Returns the current policy values for the horizontal and vertical scrollbars. ([ "h-policy": horizontal policy, "v-policy": vertical policy ]);
int get_shadow_type()
Gets the shadow type.
GTK2.Adjustment get_vadjustment()
Get the vertical adjustment.
GTK2.VScrollbar get_vscrollbar()
Returns the vertical scrollbar.
inherit GTK2.Bin : Bin
GTK2.ScrolledWindow set_hadjustment(GTK2.Adjustment hadjustment)
Set the horizontal adjustment object.
GTK2.ScrolledWindow set_placement(int window_placement)
The location of the window relative to the scrollbars. One of CORNER_BOTTOM_LEFT, CORNER_BOTTOM_RIGHT, CORNER_TOP_LEFT and CORNER_TOP_RIGHT
GTK2.ScrolledWindow set_policy(int xpolicy, int ypolicy)
Vertical and horizontal policy. Both are one of POLICY_ALWAYS, POLICY_AUTOMATIC and POLICY_NEVER
GTK2.ScrolledWindow set_shadow_type(int type)
Changes the type of shadow drawn around the contents. One of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK2.ScrolledWindow set_vadjustment(GTK2.Adjustment vadjustment)
Set the vertical adjustment object.
CLASS GTK2.SelectionData |
Placeholder class for GtkSelectionData.
CLASS GTK2.Separator |
A generic separator. Basicaly a line, like <hr> in HTML.
inherit GTK2.Widget : Widget
CLASS GTK2.SeparatorMenuItem |
A separator menu item.
GTK2.SeparatorMenuItem GTK2.SeparatorMenuItem(mapping|void props)
Create a new GTK2.SeparatorMenuItem.
inherit GTK2.MenuItem : MenuItem
CLASS GTK2.SeparatorToolItem |
Properties: int draw
GTK2.SeparatorToolItem GTK2.SeparatorToolItem(mapping|void props)
Create a new GTK2.SeparatorToolItem.
int get_draw()
Returns whether SeparatorToolItem is drawn as a line, or just a blank
inherit GTK2.ToolItem : ToolItem
GTK2.SeparatorToolItem set_draw(int draw)
When a SeparatorToolItem is drawn as a line, or just a blank.
CLASS GTK2.Settings |
Properties: int gtk-alternative-button-order int gtk-button-images int gtk-can-change-accels string gtk-color-palette string gtk-color-scheme int gtk-cursor-blink int gtk-cursor-blink-time string gtk-cursor-theme-name int gtk-cursor-theme-size int gtk-dnd-drag-threshold int gtk-double-click-distance int gtk-double-click-time int gtk-enable-animations int gtk-entry-password-hint-timeout int gtk-entry-select-on-focus string gtk-font-name string gtk-icon-sizes string gtk-icon-theme-name string gtk-key-theme-name string gtk-menu-bar-accel gint gtk-menu-bar-popup-delay int gtk-menu-images int gtk-menu-popdown-delay int gtk-menu-popup-delay string gtk-modules int gtk-split-cursor string gtk-theme-name int gtk-toolbar-icon-size int gtk-toolbar-style int gtk-touchscreen-mode int gtk-xft-antialias int gtk-xft-dpi int gtk-xft-hinting string gtk-xft-hintstyle string gtk-xft-rgba
GTK2.Settings GTK2.Settings()
Get the default GTK2.Settings object
inherit G.Object : Object
CLASS GTK2.SizeGroup |
Provides a mechanism for grouping a number of widgets together so they all request the same amount of space. This is typically usefull when you want a column of widgets to have the same size, but you can't use a W(Table) widget.
In detail, the size requiest for each widget in a GTK2.SizeGroup is the maximum of the sizes that would have been requested for each widget in the size group if they were not in the size group. The mode of the size group (see set_mode() determines whether this applies to the horizontal size, the vertical size, or both sizes.
Note that size groups only affect the amount of space requested, not the size that the widgets finally receive. If you want the widgets in a GTK2.SizeGroup to actually be the same size, you need to pack them in such a way that they get the size they request and not more. For example, if you are packing your widgets into a table, you would not include the GTK2.FILL flag.
GTK2.SizeGroup objects are referenced by each widget in the size group, so one you have added all widgets to a GTK2.SizeGroup, you can drop the initial reference to the size group. If the widgets in the size group are subsequently destroyed, then they will be removed from the size group; when allow idgets have been removed, the size group will be freed.
Widgets can be part of multiple size groups; GTK+ will compute the horizontal size of a widget from the horizontal requisition of all widgets that can be reached from the widget by a chain of size groups of type GTK2.SIZE_GROUP_HORIZONTAL or GTK2.SIZE_GROUP_BOTH, and the vertical size from the vertical requisition of all widgets that can be reached from the widget by a chain of size groups of type GTK2.SIZE_GROUP_VERTICAL or GTK2.SIZE_GROUP_BOTH. Properties: int mode The directions in which the size group effects the requested sizes of its componenent widgets.
GTK2.SizeGroup add_widget(GTK2.Widget widget)
Adds a widget to the group. In the future, the requisition of the widget will be determined as the maximum of its requisition and the requisition of the other widgets in the size group. Whether this applies horizontally, vertically, or in both directions depends on the mode.
GTK2.SizeGroup GTK2.SizeGroup(int|mapping mode_or_props)
Create a new group.
int get_ignore_hidden()
Returns if invisible widgets are ignored when calculating the size.
int get_mode()
Gets the current mode.
array get_widgets()
Returns the list of widgets associated with this size group.
inherit G.Object : Object
GTK2.SizeGroup remove_widget(GTK2.Widget widget)
Removes a widget.
GTK2.SizeGroup set_ignore_hidden(int setting)
Sets whether invisible widgets should be ignored when calculating the size.
GTK2.SizeGroup set_mode(int mode)
Sets the mode of the size group. One of SIZE_GROUP_BOTH, SIZE_GROUP_HORIZONTAL, SIZE_GROUP_NONE and SIZE_GROUP_VERTICAL. The mode of the size group determines whether the widgets in the size group should all have the same horizontal requisition, all have the same vertical requisition, or should all have the same requisition in both directions.
CLASS GTK2.Socket |
Together with W(Plug), GTK2.Socket provides the ability to embed widgets from one process into another process in a fashion that is transparent to the user. One process creates a GTK2.Socket widget and, passes the XID of that widget's window to the other process, which then creates a W(Plug) window with that XID. Any widgets contained in the W(Plug) then will appear inside the first applications window.
Note that if you pass the XID of the socket to another process that will create a plug in the socket, you must make sure that the socket widget is not destroyed until that plug is created. Violating this rule will cause unpredictable consequences, the most likely consequence being that the plug will appear as a separate toplevel window.
A socket can also be used to swallow arbitrary pre-existing top-level windows using steal(), though the integration when this is done will not be as close as between a W(Plug) and a GTK2.Socket.
Signals: plug_added
plug_removed
GTK2.Socket add_id(int wid)
Adds an XEMBED client, such as a W(Plug), to the W(Socket).
GTK2.Socket GTK2.Socket(mapping|void props)
Create a new GTK2.Socket.
int get_id()
Gets the window id of a W(Socket) widget, which can then be used to create a client embedded inside the socket, for instance with GTK2.Plug->create().
int id()
Returns the window id, to be sent to the application providing the plug. You must realize this widget before calling this function.
inherit GTK2.Container : Container
CLASS GTK2.SourceBuffer |
Text buffer object for GTK2.SourceView
Properties: int check-brackets int escape-char int highlight GTK2.SourceLanguage language int max-undo-levels
Signals: can_redo
can_undo
highlight_updated
marker_updated
GTK2.SourceBuffer begin_not_undoable_action()
Marks the beginning of a not undoable action on the buffer, disabling the undo manager. Typically you would call this function before initially setting the contents of the buffer (e.g. when loading a file in a text editor).
You may nest begin_no_undoable_action()/end_not_undoable_action() blocks.
int can_redo()
Determines whether a source buffer can redo the last action.
int can_undo()
Determines whether a source buffer can undo the last action.
GTK2.SourceBuffer GTK2.SourceBuffer(GTK2.TextTagTable table_or_lang)
Create a new SourceBuffer.
GTK2.SourceBuffer end_not_undoable_action()
Marks the end of a not undoable action on the buffer. When the last not undoable block is closed through a call to this function, the list of undo actions is cleared and the undo manager is re-enabled.
GTK2.SourceLanguage get_language()
Determines the GTK2.SourceLanguage used by the buffer.
int get_max_undo_levels()
Determines the number of undo levels the buffer will track for buffer edits.
inherit GTK2.TextBuffer : TextBuffer
GTK2.SourceBuffer redo()
Redoes the last undo operation. Use can_redo() to check whether a call to this function will have any effect.
GTK2.SourceBuffer set_language(GTK2.SourceLanguage lang)
Sets the source language the source buffer will use, adding GTK2.SourceTag tags with the language's patterns and setting the escape character with set_escape_char(). Note that this will remove any GTK2.SourceTag tags currently in the buffer's tag table.
GTK2.SourceBuffer set_max_undo_levels(int setting)
Sets the number of undo levels for user actions the buffer will track. If the number of user actions exceeds the limit set by this funcction, older actions will be discarded.
A new action is started whenever the function begin_user_action() is called. In general, this happens whenever the user presses any key which modifies the buffer, but the undo manager will try to merge similar consecutive actions, such as multiple character insertions into one action. But, inserting a newline does start a new action.
GTK2.SourceBuffer undo()
Undoes the last user action which modified the buffer. Use can_undo() to check whether a call to this function will have any effect.
Actions are defined as groups of operations between a call to GTK2.TextBuffer->begin_user_action() and GTK2.TextBuffer->end_user_action(), or sequences of similar edits (inserts or deletes) on the same line.
CLASS GTK2.SourceIter |
array backward_search(string str, int flags, GTK2.TextIter limit)
Same as GTK2.TextIter->backward_search(), but supports case insensitive searching.
array forward_search(string str, int flags, GTK2.TextIter limit)
Same as GTK2.TextIter->backward_search(), but supports case insensitive searching.
inherit GTK2.TextIter : TextIter
CLASS GTK2.SourceLanguage |
Signals: tag_style_changed
string get_name()
Returns the localized name of the language.
string get_section()
Returns the localized section of the language. Each language belongs to a section (ex. HTML belongs to the Markup section).
inherit G.Object : Object
CLASS GTK2.SourceLanguagesManager |
GTK2.SourceLanguagesManager GTK2.SourceLanguagesManager()
Create a new language manager.
array get_available_languages()
Gets a list of available languages.
array get_lang_files_dirs()
Gets a list of language files directories.
GTK2.SourceLanguage get_language_from_mime_type(string type)
Gets the GTK2.SourceLanguage which is associated with the given type in the language manager.
GTK2.SourceLanguage get_language_from_name(string name)
Gets the GTK2.SourceLanguage which has this name.
inherit G.Object : Object
CLASS GTK2.SourceMark |
string get_category()
Gets the category type of this marker.
inherit GTK2.TextMark : TextMark
GTK2.SourceMark next(string category)
Gets the next marker of the specified category after this.
GTK2.SourceMark prev(string category)
Gets the previous marker of the specified category before this.
CLASS GTK2.SourceMarker |
string get_marker_type()
Gets the marker type of this marker.
inherit GTK2.SourceMark : SourceMark
CLASS GTK2.SourcePrintJob |
Properties: GTK2.SourceBuffer buffer Gnome.PrintConfig config string font Pango.FontDescription font-desc string header-footer-font Pango.FontDescription header-footer-font-desc int highlight string numbers-font Pango.FontDescript numbers-font-desc int print-footer int print-header int print-numbers int tabs-width int wrap-mode
Signals: begin_page
finished
GTK2.SourcePrintJob cancel()
Cancels an asynchronous printing operation. This will remove any pending print idle handler.
GTK2.SourcePrintJob GTK2.SourcePrintJob(GTK2.SourceBuffer buffer)
Creates a new print job object.
GTK2.SourceBuffer get_buffer()
Gets the GTK2.SourceBuffer the print job would print.
int get_highlight()
Determines if the job is configured to print the text highlighted with colors and font styles. Note that highlighting will happen only if the buffer to print has highlighting activated.
int get_page()
Determines the currently printing page number.
int get_page_count()
Determines the total number of pages the job will print. The returned value is only meaningful after pagination has finished. In practice, for synchronous printing this means when "begin_page" is emitted, or after print_range_async() has returned.
int get_print_footer()
Determines if a footer is set to be printed for each page. A footer will be printed if this function returns true and some format strings have been specified with set_footer_format().
int get_print_header()
Determines if a header is set to be printed for each page. A header will be printed if this function returns true and some format strings have been specified with set_header_format().
int get_print_numbers()
Determines the interval used for line number printing. If the value is 0, no line numbers will be printed. The default value is 1 (i.e. numbers printed in all lines).
int get_tabs_width()
Determines the configured width (in equivalent spaces) of tabulations. The default value is 8.
mapping get_text_margins()
Determines the user set margins for the job. The default for all four margins is 0.0.
int get_wrap_mode()
Determines the wrapping style for text lines wider than the printable width. The default is no wrapping.
inherit G.Object : Object
GTK2.SourcePrintJob print()
Print the document.
GTK2.SourcePrintJob print_range(GTK2.TextIter start, GTK2.TextIter end)
Similar to print(), except you can specify a range of text to print. start and end can be in any order.
GTK2.SourcePrintJob print_range_async(GTK2.TextIter start, GTK2.TextIter end)
Starts to print job asynchronously. This function will ready the job for printing and install an idle handler that will render one page at a time.
This function will not return immediately, as only page rendering is done asynchronously. Text retrieval and paginating happens within this function. Also, if highlighting is enabled, the whole buffer needs to be highlighted first.
To get notification when the job has finished, you must connect to the "finished" signal.
GTK2.SourcePrintJob set_buffer(GTK2.SourceBuffer buffer)
Sets the GTK2.SourceBuffer the print job will print. You need to specify a buffer to print, either by the use of this function or by creating the print job with create().
GTK2.SourcePrintJob set_footer_format(string|void left, string|void center, string|void right, int separator)
Like set_header_format(), but for the footer.
GTK2.SourcePrintJob set_header_format(string|void left, string|void center, string|void right, int separator)
Sets strftime like header format strings, to be printed on the left, center and right of the top of each page. The strings may include strftime(3) codes which will be expanded at print time. All strftime() codes are accepted, with the addition of N for the page number and Q for the page count.
separator specifies if a solid line should be drawn to separate the header from the document text.
If 0 is given for any of the three arguments, that particular string will not be printed. For the header to be printed, in addition to specifying format strings, you need to enable header printing with set_print_header().
GTK2.SourcePrintJob set_highlight(int setting)
Sets whether the printed text will be highlighted according to the buffer rules. Both color and font style are applied.
GTK2.SourcePrintJob set_print_footer(int setting)
Sets whether you want to print a footer in each page. The default footer consists of three pieces of text and an optional line separator, configurable with set_footer_format().
Note that be default the footer format is unspecified, and if it's empty it will not be printed, regardless of this setting.
GTK2.SourcePrintJob set_print_header(int setting)
Sets whether you want to print a header in each page. The default header consists of three pieces of text and an optional line separator, configurable with set_header_format().
Note that by default the header format is unspecified, and if it's empty it will not be printed, regardless of this setting.
GTK2.SourcePrintJob set_print_numbers(int interval)
Sets the interval for printed line numbers. If interval is 0 no numbers will be printed. If greater than 0, a number will be printed every interval lines (i.e. 1 will print all line numbers).
GTK2.SourcePrintJob set_tabs_width(int tabs_width)
Sets the width (equivalent spaces) of tabulations for the printed text. The width in printing units will be calculated as the width of a string containing tabs_width spaces of the default font. Tabulation stops are set for the full width of printed text.
GTK2.SourcePrintJob set_text_margins(float top, float bottom, float left, float right)
Sets the four user margins for the print job. These margins are in addition to the document margins provided in the GnomePrintConfig and will not be used for headers, footers, or line numbers (those are calculated separately). You can print in the space allocate by these margins by connecting to the "begin-page" signal. The space is around the printed text, and inside the margins specified in the GnomePrintConfig.
The margin numbers are given in device units. If any of the given values is less than 0, that particular margin is not altered by this function.
GTK2.SourcePrintJob set_wrap_mode(int setting)
Sets the wrap mode for lines of text larger than the printable width.
GTK2.SourcePrintJob setup_from_view(GTK2.SourceView view)
Convenience function to set several configuration options at once, so that the printed output matches view. The options set are buffer (if not set already), tabs width, highlighting, wrap mode and default font.
CLASS GTK2.SourceStyleScheme |
string get_name()
Gets the name of this scheme.
CLASS GTK2.SourceTag |
Properties: string id GTK2.SourceTagStyle tag-style
mapping get_style()
Gets the style associated with this tag.
inherit GTK2.TextTag : TextTag
GTK2.SourceTag set_style(mapping style)
Associates a style with this tag. See GTK2.SourceBuffer->set_bracket_match_style() for format.
CLASS GTK2.SourceTagTable |
Derived from GTK2.TextTagTable
Signals: changed
GTK2.SourceTagTable add_tags(array tags)
Adds a list of tags to the table. The added tags are assigned the highest priority in the table.
If a tag is already present in the table or has the same name as an already added tag, then it is not added to the table.
GTK2.SourceTagTable GTK2.SourceTagTable()
Creates a new table. The table contains no tags be default.
inherit GTK2.TextTagTable : TextTagTable
GTK2.SourceTagTable remove_source_tags()
Removes all source tags from the table. This will remove the table's reference to the tags, so be careful - tags will end up destroyed if you don't have a reference to them.
CLASS GTK2.SourceView |
Properties: int auto-indent int highlight-current-line int insert-spaces-instead-of-tabs int margin int show-line-markers int show-line-numbers int show-margin int smart-home-end int tabs-width
Signals: redo
undo
GTK2.SourceView GTK2.SourceView(GTK2.SourceBuffer buffer)
Create a new W(SourceView). If a buffer isn't specified, an empty default buffer will be created.
int get_auto_indent()
Returns whether auto indentation of text is enabled.
int get_insert_spaces_instead_of_tabs()
Returns whether when inserting a tabulator character it should be replaced by a group of space characters.
int get_show_line_numbers()
Returns whether line markers are displayed beside the text.
int get_smart_home_end()
Returns whether HOME and END keys will move to the first/last non-space character of the line before moving to the start/end.
inherit GTK2.TextView : TextView
GTK2.SourceView set_auto_indent(int setting)
If true, auto indentation of text is enabled.
GTK2.SourceView set_insert_spaces_instead_of_tabs(int setting)
If true, any tabulator character inserted is replaced by a group of space characters.
GTK2.SourceView set_show_line_numbers(int setting)
If true, line numbers will be displayed beside the text.
GTK2.SourceView set_smart_home_end(int setting)
If true, HOME and END keys will move to the first/last non-space character of the line before moving to the start/end.
CLASS GTK2.SpinButton |
The Spin Button widget is generally used to allow the user to select a value from a range of numeric values. It consists of a text entry box with up and down arrow buttons attached to the side. Selecting one of the buttons causes the value to "spin" up and down the range of possible values. The entry box may also be edited directly to enter a specific value.
The Spin Button allows the value to have zero or a number of decimal places and to be incremented/decremented in configurable steps. The action of holding down one of the buttons optionally results in an acceleration of change in the value according to how long it is depressed.
The Spin Button uses an W(Adjustment) object to hold information about the range of values that the spin button can take.
The attributes of an W(Adjustment) are used by the Spin Button in the following way: <ul><li>value: initial value for the Spin Button</li> <li>lower: lower range value</li> <li>upper: upper range value</li> <li>step_increment: value to increment/decrement when pressing mouse button 1 on a button</li> <li>page_increment: value to increment/decrement when pressing mouse button 2 on a button</li> <li>page_size: unused</li> </ul>
The argument order for the W(Adjustment) constructor is: value, lower, upper, step_increment, page_increment, page_size
GTK2.SpinButton(GTK2.Adjustment(),0.1, 1 )->set_size_request(60,20)
Properties: GTK2.Adjustment adjustment float climb-rate int digits int numeric int snap-to-ticks int update-policy float value int wrap
Style properties: int shadow-type
Signals: change_value
input
output
value_changed
GTK2.SpinButton configure(GTK2.Adjustment range, float climb_rate, int precision)
Adjustment (with the lower/upper/increse values), climb_rate and digits
GTK2.SpinButton GTK2.SpinButton(GTK2.Adjustment range_or_min_or_props, float climb_rate_or_max, int|float precision_or_step)
The climb_rate argument take a value between 0.0 and 1.0 and indicates the amount of acceleration that the Spin Button has. The digits argument specifies the number of decimal places to which the value will be displayed.
GTK2.Adjustment get_adjustment()
Get the adjustment associated with this spinbutton.
int get_digits()
Fetches the precision.
int get_entry()
Returns W(Entry) of this widget.
mapping get_increments()
Gets the current step and page increments.
int get_numeric()
Returns whether non-numeric text can be typed in.
mapping get_range()
Gets the range allowed.
int get_snap_to_ticks()
Returns whether the value are corrected to the nearest step.
int get_update_policy()
Gets the update behavior.
float get_value()
Get the value.
int get_value_as_int()
The current value of a Spin Button can be retrieved as a int.
int get_wrap()
Returns whether the value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.
inherit GTK2.CellEditable : CellEditable
inherit GTK2.Editable : Editable
inherit GTK2.Entry : Entry
GTK2.SpinButton set_adjustment(GTK2.Adjustment range)
Set a new adjustment.
GTK2.SpinButton set_digits(int precision)
Set the number of digits to show to the user.
GTK2.SpinButton set_increments(float step, float page)
Sets the step and page increments. This affects how quickly the value changes when the arrows are activated.
GTK2.SpinButton set_numeric(int numericp)
If true, it is a numeric value. This prevents a user from typing anything other than numeric values into the text box of a Spin Button
GTK2.SpinButton set_range(float min, float max)
Sets the minimum and maximum allowable values.
GTK2.SpinButton set_snap_to_ticks(int snapp)
Set the Spin Button to round the value to the nearest step_increment, which is set within the Adjustment object used with the Spin Button
GTK2.SpinButton set_update_policy(int policy)
The possible values of policy are either GTK2.UpdateAlways or GTK2.UpdateIfValid.
These policies affect the behavior of a Spin Button when parsing inserted text and syncing its value with the values of the Adjustment.
In the case of GTK2.UpdateIfValid the Spin Button value only gets changed if the text input is a numeric value that is within the range specified by the Adjustment. Otherwise the text is reset to the current value.
In case of GTK2.UpdateAlways errors are ignored while converting text into a numeric value.
GTK2.SpinButton set_value(float to)
Set the value.
GTK2.SpinButton set_wrap(int wrapp)
If true, the spin button will wrap from the lowest to the highest value, and the highest to the lowest.
GTK2.SpinButton spin(int direction, float increment)
If you want to alter the value of a Spin Value relative to its current value, then this function can be used.
The direction paramenter is one of SPIN_END, SPIN_HOME, SPIN_PAGE_BACKWARD, SPIN_PAGE_FORWARD, SPIN_STEP_BACKWARD, SPIN_STEP_FORWARD and SPIN_USER_DEFINED
GTK2.SpinStepForward and GTK2.SpinStepBackward change the value of the Spin Button by the amount specified by increment, unless increment is equal to 0, in which case the value is changed by the value of step_increment in theAdjustment.
GTK2.SpinPageForward and GTK2.SpinPageBackward simply alter the value of the Spin Button by increment.
GTK2.SpinHome sets the value of the Spin Button to the bottom of the Adjustments range.
GTK2.SpinEnd sets the value of the Spin Button to the top of the Adjustments range.
GTK2.SpinUserDefined simply alters the value of the Spin Button by the specified amount.
GTK2.SpinButton update()
Explicitly request that the Spin Button updates itself
CLASS GTK2.Spinner |
A @[Spinner] widget displays an icon-size spinning animation. It is often used as an alternative to a GtkProgressBar for displaying indefinite activity, instead of actual progress.
To start the animation, use @[start], to stop it use @[stop] Properties: int active
GTK2.Spinner GTK2.Spinner()
inherit GTK2.DrawingArea : DrawingArea
GTK2.Spinner start()
Start the spinner
GTK2.Spinner stop()
Stop the spinner
CLASS GTK2.StatusIcon |
The "system tray" or notification area is normally used for transient icons that indicate some special state. For example, a system tray icon might appear to tell the user that they have new mail, or have an incoming instant message, or something along those lines. The basic idea is that creating an icon in the notification area is less annoying than popping up a dialog.
A GTK2.StatusIcon object can be used to display an icon in a "system tray". The icon can have a tooltip, and the user can interact with it by activating it or popping up a context menu. Critical information should/ not solely be displayed in a GTK2.StatusIcon, since it may not be visible (e.g. when the user doesn't have a notification area on his panel). This can be checked with is_embedded().
On X11, the implementation follows the freedesktop.org "System Tray" specification. Implementations of the "tray" side of this specification can be found e.g. in the GNOME and KDE panel applications.
Note that a GTK2.StatusIcon is not a widget, but just a G.Object. Making it a widget would be impractical, since the system tray on Win32 doesn't allow to embed arbitrary widgets. Properties: int blinking string file string icon-name GDK2.Pixbuf pixbuf int size string stock int storage-type int visible
Signals: activate
popup_menu
size_changed
GTK2.StatusIcon GTK2.StatusIcon(mapping|GdkPixbuf|string arg)
Create a new GTK2.StatusIcon.
int get_blinking()
Returns whether the icon is blinking.
string get_icon_name()
Gets the name of the icon.
GTK2.GdkPixbuf get_pixbuf()
Get the pixbuf.
int get_size()
Gets the size in pixels.
string get_stock()
Gets the id of the stock icon.
int get_storage_type()
Gets the type of icon, e.g. GTK2.IMAGE_PIXMAP, GTK2.IMAGE_PIXBUF, etc.
int get_visible()
Returns whether the icon is visible or not.
inherit G.Object : Object
int is_embedded()
Returns whether the status icon is embedded in a notification area.
GTK2.StatusIcon set_blinking(int blinking)
Makes the status icon start or stop blinking.
GTK2.StatusIcon set_from_file(string filename)
Set the icon from a file.
GTK2.StatusIcon set_from_icon_name(string icon_name)
Set the icon from the icon called icon_name from the current theme.
GTK2.StatusIcon set_from_pixbuf(GTK2.GdkPixbuf pixbuf)
Set the icon from pixbuf.
GTK2.StatusIcon set_from_stock(string stock_id)
Set the icon from a stock icon.
GTK2.StatusIcon set_tooltip(string tooltip_text)
Sets the tooltip.
GTK2.StatusIcon set_visible(int visible)
Shows or hides a status icon.
CLASS GTK2.Statusbar |
Statusbars are simple widgets used to display a text message. They keep a stack of the messages pushed onto them, so that popping the current message will re-display the previous text message.
In order to allow different parts of an application to use the same statusbar to display messages, the statusbar widget issues Context Identifiers which are used to identify different 'users'. The message on top of the stack is the one displayed, no matter what context it is in. Messages are stacked in last-in-first-out order, not context identifier order.
lambda() {object sb = GTK2.Statusbar();int id = sb->get_context_id("test");sb->push(id,"A message");sb->push(id,"Another message");return sb;}()
lambda() {object sb = GTK2.Statusbar();int id = sb->get_context_id("test");sb->push(id,"A message");sb->push(id,"Another message");sb->pop(id);return sb;}()
Properties: int has-resize-grip
Style properties: int shadow-type
Signals: text_popped
text_pushed
GTK2.Statusbar GTK2.Statusbar(mapping|void props)
Create a new statusbar widget
int get_context_id(string context)
Create a new context id (or get the id of an old one). The argument is any string. The return value can be used for ->push() ->pop() and ->remove later on.
int get_has_resize_grip()
Returns whether the statusbar has a resize grip.
inherit GTK2.Hbox : Hbox
GTK2.Statusbar pop(int context)
Remove the topmost message.
int push(int context, string data)
Push a message onto the statusbar. The return value is an id that can be passed to remove later on.
GTK2.Statusbar remove(int context, int id)
Remove the specified message (the message id is the second argument).
GTK2.Statusbar set_has_resize_grip(int setting)
Sets whether the statusbar has a resize grip. TRUE by default.
CLASS GTK2.StringTag |
GTK2.StringTag GTK2.StringTag(string id, string name, string pattern_start, string pattern_end, int end_at_line_end)
Creates a new string tag object with the provided arguments.
inherit GTK2.SourceTag : SourceTag
CLASS GTK2.Style |
Style settings.
Signals: realize
unrealize
GTK2.Style attach(GTK2.Widget window)
Attaches a style to a window; this process allocates the colors and creates the GC's for the style - it specializes it to a particular visual and colormap. The process may involve the creation of a new style if the style has already been attached to a window with a different style and colormap.
GTK2.Style copy()
Copy a style.
GTK2.Style GTK2.Style()
Creates a new style.
GTK2.Style detach()
Detach a style.
inherit G.Object : Object
GTK2.IconSet lookup_icon_set(string stock_id)
Lookup the icon set.
GTK2.Style paint_arrow(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int arrow, int fill, int x, int y, int width, int height)
Draws an arrow in the given rectangle on window using the given parameters. arrow determines the direction of the arrow.
GTK2.Style paint_box(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height)
Draws a box on window with the given parameters.
GTK2.Style paint_box_gap(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height, int gap_side, int gap_x, int gap_width)
Draws a box in window using the given style and state and shadow type, leaving a gap in one side.
GTK2.Style paint_check(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height)
Draws a check button indicator in the given rectangle on window.
GTK2.Style paint_diamond(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height)
Draws a diamond in the given rectangle on window.
GTK2.Style paint_expander(GTK2.Widget window, int state, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int style)
Draws an expander as used in GTK2.TreeView. x and y specify the center of the expander. The size of the expander is determined by the "expander-size" style property of widget. (If widget is 0 or doesn't have an "expander-size" property, an unspecified default size will be used, since the caller doesn't have sufficient information to position the expander, this is likely not useful.) The expander is expander_size pixels tall in the collapsed position and expander_size pixels wide in the expanded position.
GTK2.Style paint_extension(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height, int gap_side)
Draws an extension, i.e. a notebook tab.
GTK2.Style paint_flat_box(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height)
Draws a flat box on window.
GTK2.Style paint_focus(GTK2.Widget window, int state, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height)
Draws a focus indicator around the given rectangle.
GTK2.Style paint_handle(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height, int orientation)
Draws a handle as used in GTK2.HandleBox and GTK2.Paned.
GTK2.Style paint_hline(GTK2.Widget window, int state, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x1, int x2, int y)
Draws a horizontal line from (x1,y) to (x2,y).
GTK2.Style paint_layout(GTK2.Widget window, int state, int use_text, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, GTK2.Pango.Layout layout)
Draw a pango layout. Use widget->create_pango_layout() to get a Pango.Layout.
GTK2.Style paint_option(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height)
Draws a radio button indicator in the given rectangle.
GTK2.Style paint_resize_grip(GTK2.Widget window, int state, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int edge, int x, int y, int width, int height)
Draws a resize grip in the given rectangle.
GTK2.Style paint_shadow(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height)
Draws a shadow around the given rectangle.
GTK2.Style paint_shadow_gap(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height, int gap_side, int gap_x, int gap_width)
Draws a shadow around the given rectangle in window, leaving a gap in one side.
GTK2.Style paint_slider(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height, int orientation)
Paint a slider.
GTK2.Style paint_tab(GTK2.Widget window, int state, int shadow, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int x, int y, int width, int height)
Draws an option menu tab (i.e. the up and down pointing arrows).
GTK2.Style paint_vline(GTK2.Widget window, int state, GTK2.GdkRectangle rect, GTK2.Widget widget, string detail, int y1, int y2, int x)
Draws a vertical line from (x,y1) to (x,y2).
GTK2.GdkPixbuf render_icon(GTK2.IconSource source, int direction, int state, int size, GTK2.Widget widget, string detail)
Renders the icon specified by source at the given size according to the given parameters and returns the result in a pixbuf.
GTK2.Style set_background(GTK2.Widget window, int state)
Sets the background of window to the background color or pixmap specified by style for the given state.
CLASS GTK2.SyntaxTag |
GTK2.SyntaxTag GTK2.SyntaxTag(string id, string name, string pattern_start, string pattern_end)
Creates a new syntax tag object with the provided arguments.
inherit GTK2.SourceTag : SourceTag
CLASS GTK2.Table |
The GTK2.Table allows the programmer to arrange widgets in rows and columns, making it easy to align many widgets next to each other, horizontally and vertically.
GTK2.Table(2,2,0)->attach_defaults( GTK2.Label("0,0"), 0, 1, 0, 1)->attach_defaults( GTK2.Label("0,1"), 0, 1, 1, 2)->attach_defaults( GTK2.Label("1,0"), 1, 2, 0, 1)->attach_defaults( GTK2.Label("1,1"), 1, 2, 1, 2)->set_col_spacings(10)->set_row_spacings(10)
GTK2.Table(2,2,0)->attach_defaults( GTK2.Label("0,0-1,0"), 0, 2, 0, 1)->attach_defaults( GTK2.Label("0,1"), 0, 1, 1, 2)->attach_defaults( GTK2.Label("1,1"), 1, 2, 1, 2)->set_col_spacings(10)->set_row_spacings(10)
Properties: int column-spacing int homogeneous int n-columns int n-rows int row-spacing
Child properties: int bottom-attach int left-attach int right-attach int top-attach int x-options int x-padding int y-options int y-padding
GTK2.Table attach(GTK2.Widget subwidget, int left, int right, int top, int bottom, int xoptions, int yoptions, int xpad, int ypad)
The left and right attach arguments specify where to place the widget, and how many boxes to use. If you want a button in the lower right table entry of our 2x2 table, and want it to fill that entry ONLY. left_attach would be = 1, right_attach = 2, top_attach = 1, bottom_attach = 2.
Now, if you wanted a widget to take up the whole top row of our 2x2 table, you'd use left_attach = 0, right_attach = 2, top_attach = 0, bottom_attach = 1.
The xoptions and yoptions are used to specify packing options and may be OR'ed together to allow multiple options.
These options are: <ul> <li> GTK2.Fill - If the table box is larger than the widget, and GTK_FILL is specified, the widget will expand to use all the room available.</li> <li> GTK2.Shrink - If the table widget was allocated less space then was requested (usually by the user resizing the window), then the widgets would normally just be pushed off the bottom of the window and disappear. If GTK_SHRINK is specified, the widgets will shrink with the table.</li> <li> GTK2.Expand - This will cause the table cell to expand to use up any remaining space in the window.</li> </ul>
Padding is just like in boxes, creating a clear area around the widget specified in pixels
GTK2.Table attach_defaults(GTK2.Widget subwidget, int left, int right, int top, int bottom)
As there are many options associated with attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options.
xoptions, yoptions, xpadding and ypadding are all set the their default values. For the options that is GTK2.Fill|GTK2.Expand. For the padding it is 0.
GTK2.Table GTK2.Table(int|mapping width_or_props, int|void height, int|void homogeneousp)
Used to create a new table widget. An initial size must be given by specifying how many rows and columns the table should have, although this can be changed later with resize().
There can never be more than 65535 colums nor more than 65535 rows.
setting homogeneousp to 1 forces the all tablecells to be exactly the same size.
int get_col_spacing(int col)
Gets the amound of space between col and col+1.
int get_default_col_spacing()
Gets the default column spacing for the table.
int get_default_row_spacing()
Gets the default row spacing for the table.
int get_homogeneous()
Returns whether the table cells are all constrained to the same width and height.
int get_row_spacing(int row)
Gets the amount of space between row and row+1.
inherit GTK2.Container : Container
GTK2.Table resize(int rows, int columns)
If you need to change a table's size after it has been created, this function allows you to do so.
GTK2.Table set_col_spacing(int x, int spacing)
alters the amount of space between a given table column and the adjacent columns.
GTK2.Table set_col_spacings(int spacing)
Sets the space between every column in the table equal to spacing.
GTK2.Table set_homogeneous(int homogeneousp)
Set the homogeneous flag.
GTK2.Table set_row_spacing(int y, int spacing)
alters the amount of space between a given table row and the adjacent rows.
GTK2.Table set_row_spacings(int spacing)
Sets the space between every row in the table equal to spacing.
CLASS GTK2.TearoffMenuItem |
A GTK2.TearoffMenuItem is a special W(MenuItem) which is used to tear off and reattach its menu.
When its menu is shown normally, the GTK2.TearoffMenuItem is drawn as a dotted line indicating that the menu can be torn off. Activating it causes its menu to be torn off and displayed in its own window as a tearoff menu.
When its menu is shown as a tearoff menu, the GTK2.TearoffMenuItem
is drawn as a dotted line which has a left pointing arrow graphic
indicating that the tearoff menu can be reattached. Activating it
will erase the tearoff menu window.
GTK2.TearoffMenuItem()->set_size_request(100,0)
GTK2.TearoffMenuItem GTK2.TearoffMenuItem(mapping|void props)
Create a new tearoff menu item
inherit GTK2.Activatable : Activatable
inherit GTK2.MenuItem : MenuItem
CLASS GTK2.TextAttributes |
Holds text attributes.
GTK2.TextAttributes copy()
Copies src and returns it.
GTK2.TextAttributes copy_values(GTK2.TextAttributes dest)
Copies src onto dest
GTK2.TextAttributes GTK2.TextAttributes()
Create a W(TextAttributes) widget.
CLASS GTK2.TextBuffer |
Properties: int cursor-position int has-selection GTK2.TextTagTable tag_table string text
Signals: apply_tag
begin_user_action
changed
delete_range
end_user_action
insert_child_anchor
insert_pixbuf
insert_text
mark_deleted
mark_set
modified_changed
remove_tag
GTK2.TextBuffer add_selection_clipboard(GTK2.Clipboard clipboard)
Adds clipboard to the list of clipboards in which the selection contents of the buffer are available. In most cases, clipboard will be the GTK2.Clipboard of GDK2.SELECTION_PRIMARY for a view of this buffer.
GTK2.TextBuffer apply_tag(GTK2.TextTag tag, GTK2.TextIter start, GTK2.TextIter end)
Emits the "apply-tag" signal. The default handler for the signal applies tag to the given range, start and end do not have to be in order.
GTK2.TextBuffer apply_tag_by_name(string name, GTK2.TextIter start, GTK2.TextIter end)
Calls GTK2.TextTagTable->lookup() on the buffers tag table to get a GTK2.TextTag, then calls apply_tag().
int backspace(GTK2.TextIter iter, int interactive, int default_editable)
Performs the appropriate action as if the user hit the delete key with the cursor at the position specified by iter. In the normal case a single character will be deleted, but when combining accents are involved, more than one character can be deleted, and when precomposed character and accent combinations are involved, less than one character will be deleted.
Because the buffer is modified, all outstanding iterators become invalid after calling this function; however, iter will be re-initialized to point to the location where text was deleted.
GTK2.TextBuffer begin_user_action()
Called to indicate that the buffer operations between here and call end_user_action() are part of a single user-visible operation. The operations between begin_user_action() and end_user_action() can then be grouped when creating an undo stack. W(TextBuffer) maintains a count of calls to begin_user_action() that have not been closed with a call to end_user_action(), and emits the "begin-user-action" and "end-user-action" signals only for the outermost pair of calls. This allows you to build user actions from other user actions.
The "interactive" buffer mutation functions, such as insert_interactive(), automatically call begin/end user action around the buffer operations they perform, so there's no need to add extra calls if your user action consists solely of a single call to one of those functions.
GTK2.TextBuffer copy_clipboard(GTK2.Clipboard clipboard)
Copies the currently-selected text to a clipboard.
GTK2.TextBuffer GTK2.TextBuffer(GTK2.TextTagTable table_or_props)
Creates a new text buffer.
GTK2.TextChildAnchor create_child_anchor(GTK2.TextIter iter)
This is a convenience function which simply creates a child anchor with GTK2.TextChildAnchor->create() and inserts it into the buffer with insert_child_anchor(). The new anchor is owned by the buffer; no reference count is returned.
GTK2.TextMark create_mark(GTK2.TextIter where, int left_gravity, string|void mark_name)
Creates a mark at position where. If mark_name is omitted, the mark is anonymous; otherwise, the mark can be retrieve by name using get_mark(). If a mark has left gravity, and text is inserted at the mark's current location, the mark will be moved to the left of the newly-inserted text. If the mark has right gravity, the mark will end up on the right of the newly-inserted text. The standard left-to-right cursor is a mark with right gravity (when you type, the cursor stays on the right side of the text you're typing). Emits the "mark-set" signal as notification of the mark's initial placement.
GTK2.TextTag create_tag(string tag_name, mapping props)
Creates a tag and adds it to the tag table. Equivalent to calling GTK2.TextTag->create() and then adding the tag to the tag table. The returned tag is owned by the tag table.
GTK2.TextBuffer cut_clipboard(GTK2.Clipboard clipboard, int default_editable)
Copies the currently-selected text to a clipboard, then deletes said text if it's editable.
GTK2.TextBuffer delete(GTK2.TextIter start, GTK2.TextIter end)
Deletes text between start and end. The order of start and end is not actually relevant; delete() will reorder them. This function actually emits the "delete-range" signal, and the default handler of that signal deletes the text. Because the buffer is modified, all outstanding iterators become invalid after calling this function; however, start and end will be re-initialized to point to the location where text was deleted.
int delete_interactive(GTK2.TextIter start, GTK2.TextIter end, int default_editable)
Deletes all editable text in the given range. Calls delete() for each editable sub-range of [start,end). start and end are revalidated to point to the location of the last deleted range, or left untouched if no text was deleted.
GTK2.TextBuffer delete_mark(GTK2.TextMark mark)
Deletes mark, so that it's no longer located anywhere in the buffer. Removes the reference the buffer holds to the mark. There is no way to undelete a mark. The "mark-deleted" signal will be emitted as notification after the mark is deleted.
GTK2.TextBuffer delete_mark_by_name(string name)
Deletes the mark named name; the mark must exist.
int delete_selection(int interactive, int default_editable)
Deletes the range between the "insert" and "selection_bound" marks, that is, the currently-selected text. If interactive is true, the editability of the selection will be considered (users can't delete uneditable text).
GTK2.TextBuffer end_user_action()
Should be paired with begin_user_action();
array get_bounds()
Retrieves the first and last iterators in the buffer, i.e. the entire buffer lies within the range [start,end).
int get_char_count()
Gets the number of characters in the buffer; note that characters and bytes are not the same, you can't e.g. expect the contents of the buffer in string form to be this many bytes long.
GTK2.TextIter get_end_iter()
Returns the "end iterator", one past the last valid character in the buffer. If dereferenced with W(TextIter)->get_char(), the end iterator has a character value of 0. The entire buffer lies in the range from the first position in the buffer to the end iterator.
int get_has_selection()
Indicates whether some text is currently selected.
GTK2.TextMark get_insert()
Returns the mark that represents the cursor (insertion point). Equivalent to calling get_mark() to get the mark named "insert", but very slightly more efficient, and involves less typing.
GTK2.TextIter get_iter_at_child_anchor(GTK2.TextChildAnchor anchor)
Returns the location of anchor.
GTK2.TextIter get_iter_at_line(int line)
Returns a W(TextIter) to the start of the given line.
GTK2.TextIter get_iter_at_line_index(int line, int byte_index)
Obtains an iterator point to byte_index with the given line. byte_index must be the start of a UTF-8 character, and must not be beyond the end of the line. Note bytes, not characters; UTF-8 may encode one character as multiple bytes.
GTK2.TextIter get_iter_at_line_offset(int line_number, int char_offset)
Obtains an iterator pointing to char_offset within the given line. The char_offset must exist, offsets off the end of the line are not allowed. Note characters, not bytes; UTF-8 may encode one character as multiple bytes.
GTK2.TextIter get_iter_at_mark(GTK2.TextMark mark)
Returns an iterator with the current position of mark.
GTK2.TextIter get_iter_at_offset(int offset)
Returns an iterator at position offset chars from the start of the entire buffer. If offset is -1 or greater than the number of characters in the buffer, returns the end iterator, the iterator one past the last valid character in the buffer.
int get_line_count()
Obtains the number of lines in the buffer.
GTK2.TextMark get_mark(string name)
Returns the mark named name.
int get_modified()
Indicates whether the buffer has been modified since the last call to set_modified() set the modification flag to false. Used for example to enable a "save" function in a text editor.
GTK2.TextMark get_selection_bound()
Returns the mark that represents the selection bound. Equivalent to calling get_mark() to get the mark named "selection_bound", but very slightly more efficient, and involves less typing.
The currently-selected text in the buffer is the region between the "selection_bound" and "insert" marks. If "selection_bound" and "insert" are in the same place, then there is no current selection. get_selection_bounds() is another convenient function for handling the selection, if you just want to know whether there's a selection and what its bounds are.
array get_selection_bounds()
Returns either an array with start and end W(TextIter) if some text is selected, or 0 if there's no active selection.
string get_slice(GTK2.TextIter start, GTK2.TextIter end, int include_hidden_chars)
Returns the text in the range [start,end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if include_hidden_chars is false. The returned string includes a 0xFFFC character whenever the buffer contains embedded images, so byte and character indexes into the returned string do correspond to byte and character indexes into the buffer. Contrast with get_text(). Note that 0xFFFC can occur in normal text as well, so it is not a reliable indicator that a pixbuf or widget is in the buffer.
GTK2.TextIter get_start_iter()
Returns an iterator with the first position in the text buffer. This is the same as using get_iter_at_offset() to get the iter at character offset 0.
GTK2.TextTagTable get_tag_table()
Get the W(TextTagTable) associated with this buffer.
string get_text(GTK2.TextIter start, GTK2.TextIter end, int include_hidden_chars)
Returns the text int the range [start,end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if include_hidden_chars is false. Does not include characters representing embedded images, so byte and character indexes into the returned string do not correspond to byte and character indexes into the buffer. Contrast with get_slice().
inherit G.Object : Object
GTK2.TextBuffer insert(GTK2.TextIter iter, string text, int len)
Insert len bytes of text at position iter. If len is -1, string will be inserted in its entirely. Emits the 'insert-text' signal. iter is invalidated after insertion, but the default signal handler revalidates it to point to the end of the inserted text.
GTK2.TextBuffer insert_at_cursor(string text, int len)
Simply calls insert(), using the current cursor position as the insertion point.
GTK2.TextBuffer insert_child_anchor(GTK2.TextIter iter, GTK2.TextChildAnchor anchor)
Inserts a child widget anchor into the buffer at iter. The anchor will be counted as one character in character counts, and when obtaining the buffer contents as a string, will be represented by the Unicode "object replacement character" oxFFFC. Note that the "slice" variants for obtaining portions of the buffer as a string include this character for child anchors, but the "text" variants do not. e.g. see get_slice() and get_text(). Consider create_child_anchor() as a more convenient alternative to this function. The buffer will add a reference to the anchor, so you can unref it after insertion.
int insert_interactive(GTK2.TextIter iter, string text, int len, int default_editable)
Like insert(), but the insertion will not occur if iter is at a non- editable location in the buffer. Usually you want to prevent insertions at ineditable locations if the insertion results from a user action (is interactive).
default_edtibale indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of get_editable() is appropriate here.
int insert_interactive_at_cursor(string text, int len, int default_editable)
Calls insert_interactive() at the cursor position.
GTK2.TextBuffer insert_pixbuf(GTK2.TextIter iter, GTK2.GdkPixbuf pixbuf)
Inserts an image into the text buffer at iter. The image will be counted as one character in character counts, and when obtaining the contents as a string, will be represented by the Unicode "object replacement character" 0xFFFC. Note that the "slice" variants for obtaining portions of the buffer as a string include this character for pixbufs, but the "text" variants do not. e.g. see get_slice() and get_text().
GTK2.TextBuffer insert_range(GTK2.TextIter iter, GTK2.TextIter start, GTK2.TextIter end)
Copies text, tags, and pixbufs between start and end (the order of start and end doesn't matter) and inserts the copy at iter. Used instead of simply getting/inserting text because it preserves images and tags. If start and end are in a different buffer from this buffer, the two buffers must share the same tag table.
Implemented via emissions of the insert-text and apply-tag signals, so expect those.
int insert_range_interactive(GTK2.TextIter iter, GTK2.TextIter start, GTK2.TextIter end, int default_editable)
Same as insert_range(), but does nothing if the insertion point isn't editable. The default_editable parameter indicates whether the text is editable at iter if no tags enclosing iter affect editability.
GTK2.TextBuffer insert_with_tags(GTK2.TextIter iter, string text, int len, array tags)
Inserts text into the buffer at iter, applying the list of tags to the newly-inserted text. Equivalent to calling insert(), then apply_tag() on the insert text; insert_with_tags() is just a convenience function.
GTK2.TextBuffer insert_with_tags_by_name(GTK2.TextIter iter, string text, int len, array tag_names)
Same as insert_with_tags(), but allows you to pass in tag names instead of tag objects.
GTK2.TextBuffer move_mark(GTK2.TextMark mark, GTK2.TextIter where)
Moves mark to the new location where. Emits the "mark-set" signal as notification of the move.
GTK2.TextBuffer move_mark_by_name(string name, GTK2.TextIter where)
Moves the mark named name (which must exist) to location where.
GTK2.TextBuffer paste_clipboard(GTK2.Clipboard clipboard, int|void default_editable, GTK2.TextIter location)
Pastes the contents of a clipboard at the insertion point, or at override_location.
GTK2.TextBuffer place_cursor(GTK2.TextIter where)
This function moves the "insert" and "selection_bound" marks simultaneously. If you move them to the same place in two steps with move_mark(), you will temporarily select a region in between their old and new locations, which can be pretty inefficient since the temporarily-selected region will force stuff to be recalculated. This function moves them as a unit, which can be optimized.
GTK2.TextBuffer remove_all_tags(GTK2.TextIter start, GTK2.TextIter end)
Removes all tags in the range between start and end. Be careful with this function; it could remove tags added in code unrelated to the code you're currently writing. That is, using this function is probably a bad idea if you have two or more unrelated code sections that add tags.
GTK2.TextBuffer remove_selection_clipboard(GTK2.Clipboard clipboard)
Removes a clipboard that was added with add_selection_clipboard().
GTK2.TextBuffer remove_tag(GTK2.TextTag tag, GTK2.TextIter start, GTK2.TextIter end)
Emits the "remove-tag" signal. The default handler for the signal removes all occurrences of tag from the given range. start and end do not have to be in order.
GTK2.TextBuffer remove_tag_by_name(string name, GTK2.TextIter start, GTK2.TextIter end)
Removes a tag. See apply_tag_by_name().
GTK2.TextBuffer select_range(GTK2.TextIter ins, GTK2.TextIter bound)
This function removes the "insert" and "selection_bound" marks simultaneously. If you move them in two steps with move_mark(), you will temporarily select a region in between their old and new locations, which can be pretty inefficient since the temporarily-selected region will force stuff to be recalculated. This function moves them as a unit, which can be optimized.
GTK2.TextBuffer set_modified(int setting)
Used to keep track of whether the buffer has been modified since the last time it was saved. Whenever the buffer is saved to disk, call set_modified(0). When the buffer is modified, it will automatically toggle on the modified bit again. When the modifed bit flips, the buffer emits a "modified-changed" signal.
GTK2.TextBuffer set_text(sprintf_format text, sprintf_args ... fmt)
Deletes current contents of this buffer, and inserts text instead. If multiple arguments are supplied, sprintf() is called implicitly.
CLASS GTK2.TextChildAnchor |
Anchors for embedding widgets in a TextBuffer.
GTK2.TextChildAnchor GTK2.TextChildAnchor()
Creates a new W(TextChildAnchor). Usually you would then insert it into W(TextBuffer) with W(TextBuffer)->insert_child_anchor(). To perform the creation and insertion in one step, use the convenience function W(TextBuffer)->create_child_anchor().
int get_deleted()
Determines whether a child anchor has been deleted from the buffer.
array get_widgets()
Gets a list of all widgets anchored at this child anchor.
inherit G.Object : Object
CLASS GTK2.TextIter |
A TextIter.
int backward_char()
Moves backward by one character offset. Returns true if the movement was possible; if it was the first in the buffer (character offset 0), backward_char() returns false for convenience when writing loops.
int backward_chars(int count)
Moves count characters backward, if possible (if count would mmove past the start or end of the buffer, moves to the start or end of the buffer). The return value indicates whether the iterator moved onto a dereferenceable position; if it didn't move, or moved onto the end iterator, then false is returned. If count is 0, the function does nothing and returns false.
int backward_cursor_position()
Like forward_cursor_position(), but moves backward.
int backward_cursor_positions(int count)
Moves up to count cursor positions.
int backward_line()
Moves to the start of the previous line. Returns true if this iter could be moved; i.e. if iter was at character offset 0, this function returns false. Therefore if it was already on line 0, but not at the start of the line, it is snapped to the start of the line and the function returns true. (Note that this implies that in a loop calling this function, the line number may not change on every iteration, if your first iteration is on line 0.)
int backward_lines(int count)
Moves count lines backward.
array backward_search(string str, int flags, GTK2.TextIter limit)
Same as forward_search(), but searches backward.
int backward_sentence_start()
Moves backward to the previous sentence start.
int backward_sentence_starts(int count)
Call backward_sentence_start() count times.
int backward_to_tag_toggle(GTK2.TextTag tag)
Moves backward to the next toggle. See forward_to_tag_toggle().
int backward_visible_cursor_position()
Moves backward to the previous visible cursor position.
int backward_visible_cursor_positions(int count)
Moves up to count visible cursor positions.
int backward_visible_line()
Moves to the start of the previous visible line. Returns TRUE if iter could be moved; i.e. if iter was at character offset 0, this function returns FALSE. Therefore if iter was alreayd on line 0, but not at the start of the line, iter is snapped to the start of the line and the function returns TRUE. (Note that this implies that in a loop calling this function, the line number may not change on every iteration, if your first iteration is on line 0).
int backward_visible_lines(int count)
Moves count visible lines backward, if possible (if count would move past the start or end of the buffer, moves to the start or end of the buffer). The return value indicates whether the iterator moved onto a dereferenceable position; if the iterator didn't move, or moved onto the end iterator, then FALSE is returned. If count is 0, the function does nothing and returns FALSE. If count is negative, moves forward by 0 - count lines.
int backward_visible_word_start()
Moves backward to the previous visible word start.
int backward_visible_word_starts(int count)
Call backward_visible_word_start() count times
int backward_word_start()
Moves backward to the previous word start.
int backward_word_starts(int count)
Calls backward_word_start() up to count times.
int begins_tag(GTK2.TextTag tag)
Returns true if tag is toggled on at exactly this point. If tag is omitted, returns true if any tag is toggled on at this point. Note that begins_tag() returns true if this iter is the start of the tagged range; has_tag() tells you whether an iterator is within a tagged range.
int can_insert(int default_editability)
Considering the default editability of the buffer, and tags that affect editability, determines whether text inserted here would be editabled. If text inserted here would be editabled then the user should be allowed to insert text here. insert_interactive() uses this function to decide whether insertions are allowed at a given position.
int compare(GTK2.TextIter rhs)
Returns -1 if this iterator is less than rhs, 1 if greater than, and 0 if they're equal. Ordering is in character offset order, i.e. the first character in the buffer is less than the second character in the buffer.
int editable(int default_setting)
Returns whether the character at this location is within an editable region of text. Non-editable text is "locked" and can't be changed by the user via W(TextView). This function is simply a convenience wrapper around get_attributes(). If no tags applied to this text editability, default_setting will be returned.
You don't want to use this function to decide whether text can be inserted here, because for insertion you don't want to know whether the char at iter is inside an editable range, you want to know whether a new characer inserted here would be inside an editable range. Use can_insert() to handle this case.
int ends_line()
Returns true if iter points to the start of the paragraph delimiter characters for a line (delimiters will be either a newline, a carriage return, a carriage return followed by a newline, or a Unicode paragraph separator character). Note that an iterator pointing to the \n of a \r\n pair will not be counted as the end of a line, the line ends before the \r. The end iterator is considered to be at the end of a line, even though there are no paragraph delimiter chars there.
int ends_sentence()
Determines whether this iter ends a sentence.
int ends_tag(GTK2.TextTag tag)
Returns true if tag is toggled off at exactly this point. If tag is omitted, returns true if any tag is toggled off at this point. Not that ends_tag() returns true if this iter it at the end of the tagged range; has_tag() tells you whether an iterator is within a tagged range.
int ends_word()
Determines whether this iter ends a natural-language word. Word breaks are determined by Pango and should be correct for nearly any language (if not, the correct fix would be to the Pango word break algorithms).
int equal(GTK2.TextIter rhs)
Tests whether two iterators are equal, using the fastest possible mechanism. This function is very fast; you can expect it to perform better than e.g. getting the character offset for each iterator and comparing offsets yourself. Also, it's a bit faster than compare().
int forward_char()
Moves this iterator forward by one character offset. Note that images embedded in the buffer occopy 1 character slot, to forward_char() may actually move onto an image instead of a character, if you have images in your buffer. If this iterator is the end iterator or one character before it, it will now point at the end iterator, and forward_char() returns false for convenience when writing loops.
int forward_chars(int count)
Moves count characters if possible (if count would move past the start or end of the buffer, moves to the start or end of the buffer). The return value indicates whether the new position is different from its original position, and dereferenceable (the last iterator in the buffer is not). If count is 0, the function does nothing and returns false.
int forward_cursor_position()
Moves this iterator forward by a single cursor position. Cursor positions are (unsurprisingly) positions where the cursor can appear. Perhaps surprisingly, there may not be a cursor position between all characters. The most common example for European languages would be a carriage return/newline sequence. For some Unicode characters, the equivalent of say the letter "a" with an accent mark will be represented as two characters, first the letter then a "combining mark" that causes the accent to be rendered; so the cursor can't go between those two characters. See also Pango.LogAttr and pango_break().
int forward_cursor_positions(int count)
Moves up to count cursor positions.
int forward_line()
Moves to the start of the next line. Returns true if there was a next line to move to, and false if this iter was simply moved to the end of the buffer and is now not dereferenceable, or if it was already at the end of the buffer.
int forward_lines(int count)
Moves count lines forward, if possible (if count would move past the start or end of the buffer, moves to the start or end of the buffer). The return value indicates whether the iterator moved onto a dereferenceable position; if the iterator didn't move, or moved onto the end iterator, then false is returned. If count is 0, the function does nothing and returns false. If count is negative, moves backward by 0 - count lines.
array forward_search(string str, int flags, GTK2.TextIter limit)
Searches forward for str. Returns two GTK2.TextIter objects, one pointing to the first character of the match, and the second pointing to the first character after the match. The search will not continue past limit. Note that a search is a linear or O(n) operation, so you may wish to use limit to avoid locking up your UI on large buffers.
If the GTK2.TEXT_SEARCH_VISIBLE_ONLY flag is present, the match may have invisible text interspersed in str, i.e. str will be a possibly non-contiguous subsequence of the matched range. Similarly, if you specify GTK2.TEXT_SEARCH_TEXT_ONLY, the match may have pixbufs or child widgets mixed inside the matched range. If these flags are not given, the match must be exact; the special 0xFFFC character in str will match embedded pixbufs or child widgets.
int forward_sentence_end()
Moves forward to the next sentence end.
int forward_sentence_ends(int count)
Call forward_sentence_ends() count times.
GTK2.TextIter forward_to_end()
Moves forward to the "end iterator", which points one past the last valid character in the buffer. get_char() called on the end iterator returns 0, which is convenient for writing loops.
int forward_to_line_end()
Moves the iterator to point to the paragraph delimiter characters, which will be either a newline, a carriage return, a carriage return/newline sequence, or the Unicode paragraph separator character. If the iterator is already at the paragraph delimiter characters, moves to the paragraph delimiter characters for the next line. If iter is on the last line in the buffer, which does not end in paragraph delimiters, moves to the end iterator (end of the last line), and returns false.
int forward_to_tag_toggle(GTK2.TextTag tag)
Moves forward to the next toggle (on or off) of tag, or to the next toggle of any tag if tag is omitted. If no matching tag toggles are found, returns false, otherwise true. Does not return toggles located at this iter, only toggles after. Sets this iter to the location of the toggle, or to the end of the buffer if no toggle is found.
int forward_visible_cursor_position()
Moves forward to the next visible cursor position.
int forward_visible_cursor_positions(int count)
Moves up to count visible cursor positions.
int forward_visible_line()
Moves to the start of the next visible line. Returns TRUE if there was a next line to move to, and FALSE if iter was simply moved to the end of the buffer and is now not dereferenceable, or if iter was already at the end of the buffer.
int forward_visible_lines(int count)
Moves count visible lines forward, if possible (if count would move past the start or end of the buffer, moves to the start or end of the buffer). The return value indicates whether the iterator moved onto a dereferenceable position; if the iterator didn't move, or moved onto the end iterator, then FALSE is returned. If count is 0, the function does nothing and returns FALSE. If count is negative, moves backward by 0 - count lines.
int forward_visible_word_end()
Moves forward to the next visible word end.
int forward_visible_word_ends(int count)
Call forward_visible_word_end() count times.
int forward_word_end()
Moves forward to the next word end.
int forward_word_ends(int count)
Calls forward_word_end() up to count times.
GTK2.TextBuffer get_buffer()
Returns the W(TextBuffer) this iterator is associated with.
int get_bytes_in_line()
Returns the number of bytes in the line, including the paragraph delimiters.
int get_char()
Returns the Unicode character at this iterator. If the element at this iterator is a non-character element, such as an image embedded in the buffer, the Unicode "unknown" character 0xFFFc is returned.
int get_chars_in_line()
Returns the number of characters in the line, including the paragraph delimiters.
GTK2.TextChildAnchor get_child_anchor()
If this location contains a child anchor, the anchor is returned.
int get_line()
Returns the line number containing this iterator.
int get_line_index()
Returns the byte index of the iterator, counting from the start of a newline-terminated line. Rember that W(TextBuffer) encodes text in UTF-8, and that characters can require a variable number of bytes to represent.
int get_line_offset()
Returns the character offset of the iterator, counting from the start of a newline-terminated line.
array get_marks()
Returns a list of W(TextMark) at this location. Because marks are not iterable (they don't take up any "space" in the buffer, they are just marks in between iterable locations), multiple marks can exist in the same place. The returned list is not in any meaningful order.
int get_offset()
Returns the character offset of an iterator.
GTK2.GdkPixbuf get_pixbuf()
If the element at iter is a pixbuf, it is returned.
string get_slice(GTK2.TextIter end)
Returns the text in the given range. A "slice" is an array of characters including the Unicode "unknown" character 0xFFFC for iterable non-character elements in the buffer, such as images. Because images are encoded in the slice, byte and character offsets in the returned array will correspond to bytes offsets in the text buffer. Note that 0xFFFC can occur in normal text as well, so it is not a reliable indicator that a pixbuf or widget is in the buffer.
array get_tags()
Returns a list of tags that apply to iter, in ascending order of priority (highest-priority tags are last).
string get_text(GTK2.TextIter end)
Returns text in the given range. If the range contains non-text elements such as images, the character and byte offsets in the returned string will not correspond to character and bytes offsets in the buffer.
array get_toggled_tags(int toggled_on)
Returns a list of W(TextTag) that are toggled on or off at this point. (If toggled_on is true, the list contains tags that are toggled on). If a tag is toggled on at this iterator, then some non-empty range of characters following this iter has that tag applied to it. If a tag is toggled off, then some non-empty range following this iter does not have the tag applied to it.
int get_visible_line_index()
Returns the number of bytes from the start of the line to this iter, not counting bytes that are invisible due to tags with the invisible flag toggled on.
int get_visible_line_offset()
Returns the offset in characters from the start of the line, not not counting characters that are invisible due to tags with the invisible tag toggled on.
string get_visible_slice(GTK2.TextIter end)
Like get_slice(), but invisible text is not included.
string get_visible_text(GTK2.TextIter end)
Like get_text(), but invisible text is not include.
int has_tag(GTK2.TextTag tag)
Returns true if this iterator is within a range tagged with tag.
int in_range(GTK2.TextIter start, GTK2.TextIter end)
Checks whether this iterator falls in the range [start,end). start and end must be in ascending order.
int inside_sentence()
Determines whether this is inside a sentence (as opposed to int between two sentences, e.g. after a period and before the first letter of the next sentence). Sentence boundaries are determined by Pango and should be correct for nearly language (if not, the correct fix would be to the Pango text boundary algorithms).
int inside_word()
Determines whether this iter is inside a natural-language word ass opposed to say inside some whitespace).
int is_cursor_position()
See forward_cursor_position() or Pango.LangAttr or pango_break() for details on what a cursor position is.
int is_end()
Returns true if this location is the end iterator, i.e. one past the last dereferenceable iterator in the buffer. is_end() is the most efficient way to check whether an iterator is the end iterator.
int is_start()
Returns true if this is the first iterator in the buffer, that is if it has a character offset of 0.
GTK2.TextIter order(GTK2.TextIter second)
Swaps this iter for second if second comes first in the buffer. That is, ensures that this iterator and second are in sequence. Most text buffer functions that take a range call this automatically on your behalf, so there's no real reason to call it yourself in those cases. There are some exceptions, such as in_range(), that expect a pre-sorted range.
GTK2.TextIter set_line(int line_number)
Moves the iterator to the start of the line line_number. If line_number is negative or larger than the number of lines in the buffer, moves to the start of the last line in the buffer.
GTK2.TextIter set_line_index(int index)
Same as set_line_offset(), but works with a byte index. The given byte index must be at the start of a character, it can't be in the middle of a UTF-8 encoded character.
GTK2.TextIter set_line_offset(int offset)
Moves iterator within a line, to a new character (not byte) offset. The given character offset must be less than or equal to the number of characters in the line; if equal, iterator moves to the start of the next line. See set_line_index() if you have a byte index rather than a character offset.
GTK2.TextIter set_offset(int char_offset)
Sets to point to char_offset. char_offset counts from the start of the entire text buffer, starting with 0.
GTK2.TextIter set_visible_line_index(int index)
Same as set_line_index(), but works with visible byte index. The given byte index must be at the start of a character, it can't be in the middle of a UTF-8 encoded character.
GTK2.TextIter set_visible_line_offset(int offset)
Like set_line_offset(), but the offset is in visible characters, i.e. text with a tag making it invisible is not counted in the offset.
int starts_line()
Returns true if this iter begins a paragraph, i.e. if get_line_offset() would return 0. However this function is potentially more efficient than get_line_offset() because it doesn't have to computer the offset, it just has to see whether it's 0.
int starts_sentence()
Determines whether this iter begins a sentence.
int starts_word()
Determines whether this iter begins a natural-language word. Word breaks are determined by Pango and should be correct for nearly any language (if not, the correct fix would be to the Pango word break algorithms).
int toggles_tag(GTK2.TextTag tag)
This is equivalent to begins_tag()||ends_tag(), i.e it tells you whether a range with tag applied to it beings or ends here.
CLASS GTK2.TextMark |
Marks for the text.
GTK2.TextBuffer get_buffer()
Gets the buffer this mark is located inside, or empty if the mark is deleted.
int get_deleted()
Returns true if the mark has been removed from its buffer with delete_mark(). Marks can't be used once deleted.
int get_left_gravity()
Determines whether the mark has left gravity.
string get_name()
Returns the mark name; returns empty for anonymous marks.
int get_visible()
Returns true if the mark is visible.
inherit G.Object : Object
GTK2.TextMark set_visible(int setting)
Sets the visibility of the mark; the insertion point is normally visible, i.e. you can see it as a vertical bar. Also the text widget uses a visible mark to indicate where a drop will occur when dragging-and-dropping text. Most other marks are not visible. Marks are not visible by default.
CLASS GTK2.TextTag |
Properties: string background int background-full-height int background-full-height-set GDK2.Color background-gdk int background-set GDK2.Pixmap background-stipple int background-stipple-set int direction One of TEXT_DIR_LTR, TEXT_DIR_NONE and TEXT_DIR_RTL int editable int editable-set string family int family-set string font Pango.FontDescription font-desc string foreground GDK2.Color foreground-gdk int foreground-set GDK2.Pixmap foreground-stipple int foreground-stipple-set int indent int indent-set int invisible int invisible_set int justification One of JUSTIFY_CENTER, JUSTIFY_FILL, JUSTIFY_LEFT and JUSTIFY_RIGHT int justification-set string language; int language-set; int left-margin; int left-margin-set; string name; int pixels-above-lines; int pixels-above-lines-set; int pixels-below-lines; int pixels-below-lines-set; int pixels-inside-wrap; int pixels-inside-wrap-set; int right-margin; int right-margin-set; int rise; int rise-set; float scale; int scale-set; int size; double size-points; int size-set; int stretch; One of PANGO_STRETCH_CONDENSED, PANGO_STRETCH_EXPANDED, PANGO_STRETCH_EXTRA_CONDENSED, PANGO_STRETCH_EXTRA_EXPANDED, PANGO_STRETCH_NORMAL, PANGO_STRETCH_SEMI_CONDENSED, PANGO_STRETCH_SEMI_EXPANDED, PANGO_STRETCH_ULTRA_CONDENSED and PANGO_STRETCH_ULTRA_EXPANDED int stretch-set; int strikethrough; int strikethrough-set; int style; One of PANGO_STYLE_ITALIC, PANGO_STYLE_NORMAL and PANGO_STYLE_OBLIQUE int style-set; Pango.TabArray tabs int tabs-set; int underline; One of PANGO_UNDERLINE_DOUBLE, PANGO_UNDERLINE_ERROR, PANGO_UNDERLINE_LOW, PANGO_UNDERLINE_NONE and PANGO_UNDERLINE_SINGLE int underline-set; int variant; One of PANGO_VARIANT_NORMAL and PANGO_VARIANT_SMALL_CAPS int variant-set; int weight; int weight-set; int wrap-mode; One of WRAP_CHAR, WRAP_NONE, WRAP_WORD and WRAP_WORD_CHAR int wrap-mode-set;
Signals: event
GTK2.TextTag GTK2.TextTag(string|mapping name_or_props)
Creates a new text tag.
int event(GTK2.G.Object event_object, GTK2.GdkEvent event, GTK2.TextIter iter)
Emits the 'event' signal.
int get_priority()
Gets the tag priority.
inherit G.Object : Object
GTK2.TextTag set_priority(int priority)
Sets the priority. Valid priorities start at 0 and go to 1 less than W(TextTagTable)->get_size().
CLASS GTK2.TextTagTable |
Table of text tags.
Signals: tag_added
tag_changed
tag_removed
GTK2.TextTagTable add(GTK2.TextTag tag)
Add a tag to the table. The tag is assigned the highest priority in the table.
GTK2.TextTagTable GTK2.TextTagTable()
Creates a new W(TextTagTable).
int get_size()
Returns the size of the table (number of tags).
inherit G.Object : Object
GTK2.TextTag lookup(string name)
Look up a named tag.
GTK2.TextTagTable remove(GTK2.TextTag tag)
Remove a tag from the table.
CLASS GTK2.TextView |
Properties: int accepts-tab GTK2.TextBuffer buffer int cursor-visible int editable int indent int justification int left-margin int overwrite int pixels-above-lines int pixels-below-lines int pixels-inside-wrap int right-margin Pango.TabArray tabs int wrap-mode
Style properties: GDK2.Color error-underline-color
Signals: backspace
copy_clipboard
cut_clipboard
delete_from_cursor
insert_at_cursor
move_cursor
move_focus
move_viewpoert
page_horizontally
paste_clipboard
populate_popup
select_all
set_anchor
set_scroll_adjustments
toggle_overwrite
GTK2.TextView add_child_at_anchor(GTK2.Widget child, GTK2.TextChildAnchor anchor)
Adds a child widget in the text buffer, at the given anchor.
GTK2.TextView add_child_in_window(GTK2.Widget child, int wintype, int xpos, int ypos)
Adds a child at fixed coordinates in one of the text widget's windows. The window must have nonzero size (see GTK2.TextView->set_border_window_size()). Note that the child coordinates are given relative to the GDK2.Window in question, and that these coordinates have no sane relationship to scrolling. When placing a child in GTK2.TEXT_WINDOW_WIDGET, scrolling is irrelevant, the child floats above all scrollable areas. But when placing a child in one of the scrollable windows (border windows or text window), you'll need to compute the child's correct position in buffer coordinates any time scrolling occurs or buffer changes occur, and then call GTK2.TextView->move_child() to update the child's position. Unfortunately there's no good way to detect that scrolling has occurred, using the current API; a possible hack would be to update all child positions when the scroll adjustments change or the text buffer changes.
int backward_display_line(GTK2.TextIter iter)
See forward_display_line().
int backward_display_line_start(GTK2.TextIter iter)
Moves the iter backward to the next display line start.
array buffer_to_window_coords(int wintype, int buffer_x, int buffer_y)
Converts coordinate (buffer_x,buffer_y) to coordinates for the window win, and returns the results. wintype is one of TEXT_WINDOW_BOTTOM, TEXT_WINDOW_LEFT, TEXT_WINDOW_PRIVATE, TEXT_WINDOW_RIGHT, TEXT_WINDOW_TEXT, TEXT_WINDOW_TOP and TEXT_WINDOW_WIDGET.
GTK2.TextView GTK2.TextView(GTK2.TextBuffer buffer_or_props)
Create a new W(TextView).
int forward_display_line(GTK2.TextIter iter)
Moves iter forward by one display (wrapped) line. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all view, since they depend on the contents of the W(TextBuffer).
int forward_display_line_end(GTK2.TextIter iter)
Moves the iter forward to the next display line end.
int get_accepts_tab()
Returns whether pressing the Tab key inserts a tab character.
int get_border_window_size(int wintype)
Gets the width of the specified border window.
GTK2.TextBuffer get_buffer()
Returns the buffer displayed by this view.
int get_cursor_visible()
Find out whether the cursor is being displayed.
GTK2.TextAttributes get_default_attributes()
Obtains a copy of the default text attributes. These are the attributes used for text unless a tag overrides them.
int get_editable()
Gets the default editability.
int get_indent()
Gets the default indentation for paragraphs.
GTK2.TextIter get_iter_at_location(int x, int y)
Retrieves the iterator at buffer coordinates x and y. Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portions. If you have coordinates from an event, you have to convert those to buffer coordinates with window_to_buffer_coords().
GTK2.TextIter get_iter_at_position(int x, int y)
Retrieves the iterator pointing to the character at buffer coordinates x and y.
GTK2.GdkRectangle get_iter_location(GTK2.TextIter iter)
Gets a rectangle which roughly contains the character at iter. The rectangle position is in buffer coordinates; use buffer_to_window_coords() to convert these coordinates to coordinates for one of the windows in the text view.
int get_justification()
Gets the default justification.
int get_left_margin()
Gets the default left margin size of paragraphs.
GTK2.TextIter get_line_at_y(int y)
Returns a W(TextIter) for the start of the line containing the coordinate y. y is in buffer coordinates, convert from window coordinates with window_to_buffer_coords().
mapping get_line_yrange(GTK2.TextIter iter)
Gets the y coordinate of the top of the line containing iter, and the height of the line. The coordinate is a buffer coordinate; convert to window coordinates with buffer_to_window_coords().
int get_overwrite()
Returns whether the view is in overwrite mode or not.
int get_pixels_above_lines()
Gets the default number of pixels to put above paragraphs.
int get_pixels_below_lines()
Gets the value set by set_pixels_below_lines().
int get_pixels_inside_wrap()
Gets the value set by set_pixels_inside_wrap().
int get_right_margin()
Gets the default right margin size of paragraphs.
GTK2.Pango.TabArray get_tabs()
Gets the default tabs. Tags in the buffer may override the defaults. The return value will be 0 if "standard" (8-space) tabs are used.
GTK2.GdkRectangle get_visible_rect()
Returns a rectangle with the currently-visible region of the buffer, in buffer coordinates. Convert to window coordinates with buffer_to_window_coords().
GTK2.GdkWindow get_window(int wintype)
Retrieves the GDK2.Window corresponding to an area of the text view; possible windows include the overall widget window, child windows on the left, right, top, bottom, and the window that displays the text buffer. Windows are 0 and nonexistent if their width or height is 0, and are nonexistent before the widget has been realized.
int get_window_type(GTK2.GdkWindow window)
Usually used to find out which window an event corresponds to. If you connect to an event signal, this function should be called on event->window to see which window it was. One of TEXT_WINDOW_BOTTOM, TEXT_WINDOW_LEFT, TEXT_WINDOW_PRIVATE, TEXT_WINDOW_RIGHT, TEXT_WINDOW_TEXT, TEXT_WINDOW_TOP and TEXT_WINDOW_WIDGET.
int get_wrap_mode()
Gets the line wrapping mode.
inherit GTK2.Container : Container
GTK2.TextView move_child(GTK2.Widget child, int x, int y)
Updates the position of a child.
int move_mark_onscreen(GTK2.TextMark mark)
Moves a mark within the buffer so that it's located within the currently visible text-area.
int move_visually(GTK2.TextIter iter, int count)
Move the iterator a given number of characters visually, treating it as the strong cursor position. If count is positive, then the new strong cursor position will be count positions to the right of the old cursor position. If count is negative then the new strong cursor position will be count positions to the left of the old cursor position.
In the presence of bidirection text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off the end of a run.
int place_cursor_onscreen()
Moves the cursor to the currently visible region of the buffer, if it isn't there already.
GTK2.TextView scroll_mark_onscreen(GTK2.TextMark mark)
Scrolls the view the minimum distance such that mark is contained within the visible area.
GTK2.TextView scroll_to_iter(GTK2.TextIter iter, float within_margin, int use_align, float xalign, float yalign)
Scrolls the view so that iter is on the screen as with scroll_to_mark().
GTK2.TextView scroll_to_mark(GTK2.TextMark mark, float within_margin, int use_align, float xalign, float yalign)
Scrolls the view so that mark is on the screen in the position indicated by xalign and yalign. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is false, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by the margin of size within_margin.
GTK2.TextView set_accepts_tab(int accepts_tab)
Sets the behavior of the text widget when the Tab key is pressed. If accepts_tab is true a tab character is inserted. If accepts_tab is false the keyboard focus is moved to the next widget in the focus chain.
GTK2.TextView set_border_window_size(int wintype, int size)
Sets the width of GTK2.TEXT_WINDOW_LEFT or GTK2.TEXT_WINDOW_RIGHT, or the height of GTK2.TEXT_WINDOW_TOP or GTK2.TEXT_WINDOW_BOTTOM. Automatically destroys the corresponding window if the size is set to 0, and creates the window if the size is set to non-zero. This function can only be used for the "border windows", it doesn't work with GTK2.TEXT_WINDOW_WIDGET, GTK2.TEXT_WINDOW_TEXT, or GTK2.TEXT_WINDOW_PRIVATE.
GTK2.TextView set_buffer(GTK2.TextBuffer buffer)
Sets buffer as the buffer being displayed.
GTK2.TextView set_cursor_visible(int setting)
Toggles whether the insertion point is displayed. A buffer with no editable text probably shouldn't have a visible cursor, so you may want to turn the cursor off.
GTK2.TextView set_editable(int setting)
Sets the default editability. You can override this default setting with tags in the buffer, using the "editable" attribute of tags.
GTK2.TextView set_indent(int indent)
Sets the default indentation for paragraphs. May be overridden by tags.
GTK2.TextView set_justification(int just)
Sets the default justification of text. One of JUSTIFY_CENTER, JUSTIFY_FILL, JUSTIFY_LEFT and JUSTIFY_RIGHT.
GTK2.TextView set_left_margin(int margin)
Sets the default left margin. May be overridden by tags.
GTK2.TextView set_overwrite(int overwrite)
Changes the overwrite mode, true for on, false for off.
GTK2.TextView set_pixels_above_lines(int pixels)
Sets the default number of blank pixels above paragraphs. Tags in the buffer may override the defaults.
GTK2.TextView set_pixels_below_lines(int pixels)
Sets the default number of blank pixels to put below paragraphs. May be overridden by tags applied to the buffer.
GTK2.TextView set_pixels_inside_wrap(int pixels)
Sets the default number of pixels of blank space to leave between displayed/wrapped lines within a paragraph. May be overridden by tags.
GTK2.TextView set_right_margin(int margin)
Sets the default right margin. May be overridden by tags.
GTK2.TextView set_tabs(GTK2.Pango.TabArray tabs)
Sets the default tab stops for paragraphs. Tags in the buffer may override the default.
GTK2.TextView set_wrap_mode(int wrap_mode)
Sets the line wrapping. One of WRAP_CHAR, WRAP_NONE, WRAP_WORD and WRAP_WORD_CHAR.
int starts_display_line(GTK2.TextIter iter)
Determines whether iter is at the start of a display line.
array window_to_buffer_coords(int wintype, int window_x, int window_y)
Converts coordinates on the window identified by wintype to buffer coordinates, returning the result.
CLASS GTK2.ToggleAction |
Properties int active int draw-as-radio
Signals: toggled
GTK2.ToggleAction GTK2.ToggleAction(string|mapping name_or_props, string|void label, string|void tooltip, string|void stock_id)
Creates a new GTK2.ToggleAction object.
int get_active()
Returns the checked state.
int get_draw_as_radio()
Returns whether the action should have proxies like a radio action.
inherit GTK2.Action : Action
GTK2.ToggleAction set_active(int setting)
Sets the checked state.
GTK2.ToggleAction set_draw_as_radio(int setting)
Sets whether the action should have proxies like a radio action.
GTK2.ToggleAction toggled()
Emits the "toggled" signal.
CLASS GTK2.ToggleButton |
Toggle buttons are derived from normal buttons and are very similar, except they will always be in one of two states, alternated by a click. They may be depressed, and when you click again, they will pop back up. Click again, and they will pop back down.
GTK2.ToggleButton("Toggle button")
GTK2.ToggleButton("Toggle button")->set_active( 1 )
Properties: int active int draw-indicator int inconsistent
Signals: toggled
GTK2.ToggleButton GTK2.ToggleButton(string|mapping label_or_props, int|void mnemonic)
If you supply a string, a label will be created and inserted in the button. Otherwise, use ->add(widget) to create the contents of the button.
int get_active()
Returns true if button is pressed, and false if it is raised.
int get_inconsistent()
Gets the value set by set_inconsistent().
int get_mode()
Retrieves whether the button is displayed as a separator indicator and label.
inherit GTK2.Button : Button
GTK2.ToggleButton set_active(int activep)
If activep is true, the toggle button will be activated.
GTK2.ToggleButton set_inconsistent(int setting)
If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a toggle button, and the current values in that range are inconsistent, you may want to display the toggle in an "in between" state. This function turns on "in between" display.
GTK2.ToggleButton set_mode(int mode)
If true, draw indicator
GTK2.ToggleButton toggled()
emulate a 'toggle' of the button. This will emit a 'toggled' signal.
CLASS GTK2.ToggleToolButton |
A ToolItem containing a toggle button.
Signals: toggled
GTK2.ToggleToolButton GTK2.ToggleToolButton(string|mapping stock_id)
Creates a new toggle tool button, with or without a stock id.
int get_active()
Returns the status of the toggle tool button, true if it is pressed in and false if it isn't.
inherit GTK2.ToolButton : ToolButton
GTK2.ToggleToolButton set_active(int is_active)
Sets the status of the toggle tool button. Set to true if you want the button to be pressed in, and false to raise it. This causes the toggled signal to be emitted.
CLASS GTK2.ToolButton |
Properties that can be notified: icon-widget label label-widget stock-id use-underline
Signals: clicked
GTK2.ToolButton GTK2.ToolButton(GTK2.Widget icon, string|void label)
Create a new GTK2.ToolButton. If icon is a string, label should be omitted. If it isn't, it will be ignored. The result will be a button from a stock item, one of STOCK_ABOUT, STOCK_ADD, STOCK_APPLY, STOCK_BOLD, STOCK_CANCEL, STOCK_CDROM, STOCK_CLEAR, STOCK_CLOSE, STOCK_COLOR_PICKER, STOCK_CONNECT, STOCK_CONVERT, STOCK_COPY, STOCK_CUT, STOCK_DELETE, STOCK_DIALOG_AUTHENTICATION, STOCK_DIALOG_ERROR, STOCK_DIALOG_INFO, STOCK_DIALOG_QUESTION, STOCK_DIALOG_WARNING, STOCK_DIRECTORY, STOCK_DISCONNECT, STOCK_DND, STOCK_DND_MULTIPLE, STOCK_EDIT, STOCK_EXECUTE, STOCK_FILE, STOCK_FIND, STOCK_FIND_AND_REPLACE, STOCK_FLOPPY, STOCK_FULLSCREEN, STOCK_GOTO_BOTTOM, STOCK_GOTO_FIRST, STOCK_GOTO_LAST, STOCK_GOTO_TOP, STOCK_GO_BACK, STOCK_GO_DOWN, STOCK_GO_FORWARD, STOCK_GO_UP, STOCK_HARDDISK, STOCK_HELP, STOCK_HOME, STOCK_INDENT, STOCK_INDEX, STOCK_INFO, STOCK_ITALIC, STOCK_JUMP_TO, STOCK_JUSTIFY_CENTER, STOCK_JUSTIFY_FILL, STOCK_JUSTIFY_LEFT, STOCK_JUSTIFY_RIGHT, STOCK_LEAVE_FULLSCREEN, STOCK_MEDIA_FORWARD, STOCK_MEDIA_NEXT, STOCK_MEDIA_PAUSE, STOCK_MEDIA_PLAY, STOCK_MEDIA_PREVIOUS, STOCK_MEDIA_RECORD, STOCK_MEDIA_REWIND, STOCK_MEDIA_STOP, STOCK_MISSING_IMAGE, STOCK_NETWORK, STOCK_NEW, STOCK_NO, STOCK_OK, STOCK_OPEN, STOCK_PASTE, STOCK_PREFERENCES, STOCK_PRINT, STOCK_PRINT_PREVIEW, STOCK_PROPERTIES, STOCK_QUIT, STOCK_REDO, STOCK_REFRESH, STOCK_REMOVE, STOCK_REVERT_TO_SAVED, STOCK_SAVE, STOCK_SAVE_AS, STOCK_SELECT_COLOR, STOCK_SELECT_FONT, STOCK_SORT_ASCENDING, STOCK_SORT_DESCENDING, STOCK_SPELL_CHECK, STOCK_STOP, STOCK_STRIKETHROUGH, STOCK_UNDELETE, STOCK_UNDERLINE, STOCK_UNDO, STOCK_UNINDENT, STOCK_YES, STOCK_ZOOM_100, STOCK_ZOOM_FIT, STOCK_ZOOM_IN and STOCK_ZOOM_OUT. If icon is a GTK2.Widget, it will be used as the icon, and label will be the label. The label must exists if that is the case.
string get_icon_name()
Returns the name of the themed icon for the tool button.
GTK2.Widget get_icon_widget()
Returns the widget used as the icon widget.
string get_label()
Returns the label used by the tool button, or empty if the tool button doesn't have a label.
GTK2.Widget get_label_widget()
Returns the widget used as the label.
string get_stock_id()
Returns the name of the stock item.
int get_use_underline()
Returns whether underscores in the label property are used as mnemonics on menu items on the overflow menu.
inherit GTK2.ToolItem : ToolItem
GTK2.ToolButton set_icon_name(string name)
Sets the icon for the tool button from a named themed icon. The "icon-name" property only has an effect if not overridden by non-NULL "label", "icon-widget", and "stock-id" properties.
GTK2.ToolButton set_icon_widget(GTK2.Widget icon_widget)
Sets icon_widget as the widget used as the icon on the button.
GTK2.ToolButton set_label(string label)
Sets label as the label used for the tool button.
GTK2.ToolButton set_label_widget(GTK2.Widget label_widget)
Sets label_widget as the widget used as the label.
GTK2.ToolButton set_stock_id(string stock_id)
Sets the name of the stock item.
GTK2.ToolButton set_use_underline(int use_underline)
If set, an underline in the label property indicates that the next character should be used for the mnemonic accelerator key in the overflow menu.
CLASS GTK2.ToolItem |
Properties: int is-important int visible-horizontal int visible-vertical
Signals: create_menu_proxy
set_tooltip
toolbar_reconfigured
GTK2.ToolItem GTK2.ToolItem(mapping|void props)
Creates a new GTK2.ToolItem.
int get_expand()
Returns whether this item is allocated extra space.
int get_homogeneous()
Returns whether this item is the same size as the other homogeneous items.
int get_icon_size()
Returns the icon size used for this item. One of ICON_SIZE_BUTTON, ICON_SIZE_DIALOG, ICON_SIZE_DND, ICON_SIZE_INVALID, ICON_SIZE_LARGE_TOOLBAR, ICON_SIZE_MENU and ICON_SIZE_SMALL_TOOLBAR
int get_is_important()
Returns whether this item is considered important.
int get_orientation()
Returns the orientation used for this item. One of ORIENTATION_HORIZONTAL and ORIENTATION_VERTICAL
GTK2.Widget get_proxy_menu_item(string menu_item_id)
If menu_item_id matches the string passed to set_proxy_menu_item(), then return the corresponding GTK2.MenuItem.
int get_relief_style()
Returns the relief style of this item. One of RELIEF_HALF, RELIEF_NONE and RELIEF_NORMAL
int get_toolbar_style()
Returns the toolbar style use for this item. One of TOOLBAR_BOTH, TOOLBAR_BOTH_HORIZ, TOOLBAR_ICONS, TOOLBAR_SPACE_EMPTY, TOOLBAR_SPACE_LINE and TOOLBAR_TEXT
int get_use_drag_window()
Returns whether this item has a drag window.
int get_visible_horizontal()
Returns whether this item is visible on toolbars that are docked horizontally.
int get_visible_vertical()
Returns whether this item is visible when the toolbar is docked vertically.
inherit GTK2.Activatable : Activatable
inherit GTK2.Bin : Bin
GTK2.ToolItem rebuild_menu()
Calling this function signals to the toolbar that the overflow menu item for this item has changed. If the overflow menu is visible when this function is called, the menu will be rebuilt.
GTK2.Widget retrieve_proxy_menu_item()
Returns the GTK2.MenuItem that was last set by set_proxy_menu_item().
GTK2.ToolItem set_expand(int expand)
Sets whether this item is allocated extra space when there is more room on the toolbar than needed for the items. The effect is that the item gets bigger when the toolbar gets bigger and smaller when the toolbar gets smaller.
GTK2.ToolItem set_homogeneous(int homogeneous)
Sets whether this item is to be allocated the same size as other homogeneous items. The effect is that all homogeneous items will have the same width as the widest of the items.
GTK2.ToolItem set_is_important(int is_important)
Sets whether this item should be considered important.
GTK2.ToolItem set_proxy_menu_item(string menu_item_id, GTK2.Widget menu_item)
Sets the GTK2.MenuItem used in the toolbar overflow menu. The menu_item_id is used to identify the caller of this function and should also be used with get_proxy_menu_item().
GTK2.ToolItem set_tooltip(GTK2.Tooltips tooltips, string tip_text, string tip_private)
Sets the GTK2.Tooltips object to be used for this item, the text to be displayed as tool tip on the item and the private text to be used.
GTK2.ToolItem set_use_drag_window(int use_drag_window)
Sets whether this item has a drag window. When true the toolitem can be used as a drag source. When this item has a drag window it will intercept all events, even those that would otherwise be sent to a child.
GTK2.ToolItem set_visible_horizontal(int visible_horizontal)
Sets whether toolitem is visible when the toolbar is docked horizontally.
GTK2.ToolItem set_visible_vertical(int visible_vertical)
Sets whether this item is visible when the toolbar is docked vertically. Some tool items, such as text entries, are too wide to be useful on a vertically docked toolbar. If visible_vertical is false then this item will not appear on toolbars that are docked vertically.
CLASS GTK2.Toolbar |
Toolbars are usually used to group some number of widgets in order to simplify customization of their look and layout. Typically a toolbar consists of buttons with icons, labels and tooltips, but any other widget can also be put inside a toolbar. Finally, items can be arranged horizontally or vertically and buttons can be displayed with icons, labels, or both.
Examples:
GTK2.Toolbar()->insert(GTK2.ToolItem()->add(GTK2.Button("Button 1")),-1)->insert(GTK2.ToolItem()->add(GTK2.Label(" ")),-1)->insert(GTK2.ToolItem()->add(GTK2.Button("Button 2")),-1)->insert(GTK2.ToolItem()->add(GTK2.Button("Button 3")),-1)
GTK2.Toolbar((["orientation":GTK2.ORIENTATION_VERTICAL]))->insert(GTK2.ToolItem()->add(GTK2.Button("Button 1")),-1)->insert(GTK2.ToolItem()->add(GTK2.Label(" ")),-1)->insert(GTK2.ToolItem()->add(GTK2.Button("Button 2")),-1)->insert(GTK2.ToolItem()->add(GTK2.Button("Button 3")),-1)
Properties: int icon-size int icon-size-set int orientation int show-arrow int toolbar-style int tooltips
Child properties: int expand int homogeneous
Style properties: int button-relief int internal-padding int shadow-type int space-size int space-style
Signals: orientation_changed
popup_context_menu
style_changed
GTK2.Toolbar GTK2.Toolbar(mapping|void props)
Creates a new toolbar.
int get_drop_index(int x, int y)
Returns the position corresponding to the indicated point on the toolbar. This is useful when dragging items to the toolbar: this function returns the position a new item should be inserted.
x and y are in toolbar coordinates.
int get_icon_size()
Retrieves the icon size for the toolbar. One of ICON_SIZE_BUTTON, ICON_SIZE_DIALOG, ICON_SIZE_DND, ICON_SIZE_INVALID, ICON_SIZE_LARGE_TOOLBAR, ICON_SIZE_MENU and ICON_SIZE_SMALL_TOOLBAR.
int get_item_index(GTK2.ToolItem item)
Returns the position of item on the toolbar, starting from 0.
int get_n_items()
Returns the number of items on the toolbar.
GTK2.ToolItem get_nth_item(int n)
Returns the n's item on the toolbar, or empty if the toolbar does not contain an n'th item.
int get_orientation()
Retrieves the current orientation of the toolbar.
int get_relief_style()
Returns the relief style of buttons.
int get_show_arrow()
Returns whether the toolbar has an overflow menu.
int get_style()
Retrieves whether the toolbar has text, icons, or both. One of TOOLBAR_BOTH, TOOLBAR_BOTH_HORIZ, TOOLBAR_ICONS, TOOLBAR_SPACE_EMPTY, TOOLBAR_SPACE_LINE and TOOLBAR_TEXT;
int get_tooltips()
Retrieves whether tooltips are enabled.
inherit GTK2.Container : Container
GTK2.Toolbar insert(GTK2.ToolItem item, int pos)
Insert a W(ToolItem) into the toolbar at position pos. If pos is 0 the item is prepended to the start of the toolbar. If pos is negative, the item is appended to the end of the toolbar.
GTK2.Toolbar set_drop_highlight_item(GTK2.ToolItem item, int index)
Highlights the toolbar to give an ide aof what it would like if item was added at the position indicated by index.
The item passed to this function must not be part of any widget hierarchy. When an item is set as drop highlight item it can not be added to any widget hierarchy or used as highlight item for another toolbar.
GTK2.Toolbar set_orientation(int orientation)
Sets whether a toolbar should appear horizontally or vertically. One of ORIENTATION_HORIZONTAL and ORIENTATION_VERTICAL.
GTK2.Toolbar set_show_arrow(int show_arrow)
Sets whether to show an overflow menu when the toolbar doesn't have room for all items on it. If true, items for which there are not room are are available through an overflow menu.
GTK2.Toolbar set_style(int style)
Set the style, one of TOOLBAR_BOTH, TOOLBAR_BOTH_HORIZ, TOOLBAR_ICONS, TOOLBAR_SPACE_EMPTY, TOOLBAR_SPACE_LINE and TOOLBAR_TEXT
GTK2.Toolbar set_tooltips(int enable)
Sets if the tooltips should be active or not.
GTK2.Toolbar unset_style()
Unsets a toolbar style, so that user preferences will be used to determine the toolbar style.
CLASS GTK2.Tooltips |
Tooltips are the messages that appear next to a widget when the mouse pointer is held over it for a short amount of time. They are especially helpful for adding more verbose descriptions of things such as buttons in a toolbar.
An individual tooltip belongs to a group of tooltips. A group is created with a call to GTK2.Tooltips(). Every tooltip in the group can then be turned off with a call to disable() and enabled with enable().
The length of time the user must keep the mouse over a widget before the tip is shown, can be altered with set_delay(). This is set on a 'per group of tooltips' basis.
To assign a tip to a particular W(Widget), set_tip() is used.
The default appearance of all tooltips in a program is determined by the current gtk theme that the user has selected. To change the tooltip appearance manually, use set_colors(). Again, this is per group of tooltips.
GTK2.Tooltips GTK2.Tooltips()
Creates an empty group of tooltips. This function initialises a GTK2.Tooltips structure. Without at least one such structure, you can not add tips to your application.
GTK2.Tooltips disable()
Disable this tooltip collection.
GTK2.Tooltips enable()
Enable this tooltip collection.
GTK2.Tooltips force_window()
Realize the tooltip window (as returned from get_gdkwindow())
inherit GTK2.Data : Data
GTK2.Tooltips set_tip(GTK2.Widget in, string to)
Adds a tooltip containing the message tip_text to the specified W(Widget).
CLASS GTK2.TreeDragDest |
int drag_data_received(GTK2.TreePath path, GTK2.SelectionData sel)
Asks to insert a row before the path dest, deriving the contents of the row from the sel. If this dest is outside the tree so that inserting before it is impossible, false will be returned. Also, false may be returned if the new row is not created for some model-specific reason.
int row_drop_possible(GTK2.TreePath path, GTK2.SelectionData sel)
Determines whether a drop is possible before past, at the same depth as path. i.e., can we drop the data in sel at that location. path does not have to exist; the return value will almost certainly be false if the parent of path doesn't exist, though.
CLASS GTK2.TreeDragSource |
int drag_data_delete(GTK2.TreePath path)
Asks to delete the row at path, because it was moved somewhere else via drag-and-drop. Returns false if the deletion fails because path no longer exists, or for some model-specific reason.
GTK2.SelectionData drag_data_get(GTK2.TreePath path)
Asks to return a representation of the row at path.
int row_draggable(GTK2.TreePath path)
Asks the source whether a particular row can be used as the source of a DND operation. If the source doesn't implement this interface, the row is assumed draggable.
CLASS GTK2.TreeIter |
TreeIter.
GTK2.TreeIter copy()
Creates a copy of this tree iter.
CLASS GTK2.TreeModel |
The tree interface used by TreeView.
Signals: row_changed
row_deleted
row_has_child_toggled
row_inserted
rows_reordered
int get_column_type(int index)
Returns the type of the column.
int get_flags()
Returns a set of flags supported by this interface.
GTK2.TreeIter get_iter(GTK2.TreePath path)
Returns a valid iterator pointer to path
GTK2.TreeIter get_iter_first()
Get GTK2.TreeIter with the first iterator in the tree ("0").
GTK2.TreeIter get_iter_from_string(string path)
Returns a valid iterator from a path string.
int get_n_columns()
Returns the number of columns suppported by this model.
GTK2.TreePath get_path(GTK2.TreeIter iter)
Returns a GTK2.TreePath from iter.
array get_row(GTK2.TreeIter iter)
Get the row at this iter.
string get_string_from_iter(GTK2.TreeIter iter)
Get string representation of iter.
mixed get_value(GTK2.TreeIter iter, int column)
Get value at column of iter.
GTK2.TreeIter iter_children(GTK2.TreeIter parent)
Get first child of parent.
int iter_has_child(GTK2.TreeIter iter)
Check if iter has children.
int iter_n_children(GTK2.TreeIter iter)
Returns the number of children this iter has.
int iter_next(GTK2.TreeIter iter)
Go to next node.
GTK2.TreeIter iter_nth_child(GTK2.TreeIter parent, int index)
Get the child of parent using the given index. Returns valid GTK2.TreeIter if it exists, or 0. If the index is too big, or parent is invalid, then it returns the index from the root node.
GTK2.TreeIter iter_parent(GTK2.TreeIter child)
Get parent of child, or 0 if none.
GTK2.TreeModel row_changed(GTK2.TreePath path, GTK2.TreeIter iter)
Emit "row-changed" signal.
GTK2.TreeModel row_deleted(GTK2.TreePath path)
Emit "row-deleted" signal.
GTK2.TreeModel row_has_child_toggled(GTK2.TreePath path, GTK2.TreeIter iter)
Emit "row-has-child-toggled" signal.
GTK2.TreeModel row_inserted(GTK2.TreePath path, GTK2.TreeIter iter)
Emit "row-inserted" signal.
CLASS GTK2.TreeModelFilter |
Properties: GTK2.TreeModel child-model GTK2.TreePath virtual-root
GTK2.TreeIter convert_child_iter_to_iter(GTK2.TreeIter child_iter)
Returns an iter pointing to the row in this model that corresponds to the row pointed at by child_iter.
GTK2.TreePath convert_child_path_to_path(GTK2.TreePath child_path)
Converts child_path to a path relative to this model. That is, child_path points to a path in the child mode. The returned path will point to the same row in the sorted model.
GTK2.TreeIter convert_iter_to_child_iter(GTK2.TreeIter sorted_iter)
Returns an iter pointing to the row in this model that corresponds to the row pointed at by sorted_iter.
GTK2.TreePath convert_path_to_child_path(GTK2.TreePath sorted_path)
Converts sorted_path to a path on the child model.
GTK2.TreeModelFilter GTK2.TreeModelFilter(GTK2.TreeModel model, GTK2.TreePath root)
Create a new GTK2.TreeModel, with model as the child model.
inherit G.Object : Object
inherit GTK2.TreeDragSource : TreeDragSource
inherit GTK2.TreeModel : TreeModel
GTK2.TreeModelFilter refilter()
Emits "row-changed" for each row in the child model, which causes the filter to re-evaluate whether a row is visible or not.
GTK2.TreeModelFilter set_visible_func(function(:void) f, mixed user_data)
Sets the comparison function used when sorting to be f. If the current sort column id of this sortable is the same as column, then the model will sort using this function.
CLASS GTK2.TreeModelSort |
Properties: GTK2.TreeModel model
GTK2.TreeIter convert_child_iter_to_iter(GTK2.TreeIter child_iter)
Returns an iter pointing to the row in this model that corresponds to the row pointed at by child_iter.
GTK2.TreePath convert_child_path_to_path(GTK2.TreePath child_path)
Converts child_path to a path relative to this model. That is, child_path points to a path in the child mode. The returned path will point to the same row in the sorted model.
GTK2.TreeIter convert_iter_to_child_iter(GTK2.TreeIter sorted_iter)
Returns an iter pointing to the row in this model that corresponds to the row pointed at by sorted_iter.
GTK2.TreePath convert_path_to_child_path(GTK2.TreePath sorted_path)
Converts sorted_path to a path on the child model.
GTK2.TreeModelSort GTK2.TreeModelSort(GTK2.TreeModel model)
Create a new GTK2.TreeModel, with model as the child model.
GTK2.TreeModel get_model()
Return the model this ModelSort is sorting.
inherit G.Object : Object
inherit GTK2.TreeDragSource : TreeDragSource
inherit GTK2.TreeModel : TreeModel
inherit GTK2.TreeSortable : TreeSortable
GTK2.TreeModelSort reset_default_sort_func()
This resets the default sort function to be in the 'unsorted' state. That is, it is in the same order as the child model. It will re-sort the model to be in the same order as the child model only if this model is in 'unsorted' state.
CLASS GTK2.TreePath |
TreePath.
GTK2.TreePath append_index(int index)
Appends a new index to path. As a result, the depth of the path is increased.
int compare(GTK2.TreePath b)
Compares two paths. If this path appears before b, -1 is returned. If b before this path, 1 is return. If they are equal, 0 is returned.
GTK2.TreePath copy()
Creates a new GTK2.TreePath as a copy.
GTK2.TreePath GTK2.TreePath(string|void path)
Creates a new GTK2.TreePath.
GTK2.TreePath down()
Moves path to point to the first child of the current path.
int get_depth()
Returns the current depth of path.
array get_indices()
Returns the current indices of path as an array of integers, each representing a node in a tree.
int is_ancestor(GTK2.TreePath descendant)
Returns TRUE if descendant is a descendant of this path.
int is_descendant(GTK2.TreePath ancestor)
Returns TRUE if this path is a descendant of ancestor.
GTK2.TreePath next()
Moves the path to point to the next node at the current depth.
GTK2.TreePath prepend_index(int index)
Prepends a new index to a path. As a result, the depth of the path is increased.
GTK2.TreePath prev()
Moves the path to point to the previous node at the current depth, if it exists. Returns TRUE if the move was made.
string to_string()
Generates a string representation of the path. This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.
GTK2.TreePath up()
Moves the path to point to its parent node, if it has a parent.
CLASS GTK2.TreeRowReference |
A TreeRowReference.
GTK2.TreeRowReference copy()
Copies a GTK2.TreeRowReference.
GTK2.TreeRowReference GTK2.TreeRowReference(GTK2.TreeModel model, GTK2.TreePath path)
Creates a row reference based on path. This reference will keep pointing to the node pointed to by path, so long as it exists.
GTK2.TreeModel get_model()
Returns the model which this references is monitoring.
GTK2.TreePath get_path()
Returns a path that the row reference currently points to.
int valid()
Return TRUE if the reference referes to a current valid path.
CLASS GTK2.TreeSelection |
Selections on a treestore.
Signals: changed
int count_selected_rows()
Returns the number of rows that have been selected.
int get_mode()
Gets the selectiom mode.
array get_selected()
Returns a W(TreeITer) with the currently selected node if this selection is set to GTK2.SELECTION_SINGLE or GTK2.SELECTION_BROWSE. Also returns W(TreeModel) as a convenience. This function will not work if you this selection is set to GTK2.SELECTION_MULTIPLE.
array get_selected_rows(GTK2.TreeModel model)
Creates a list of W(TreePath)'s for all selected rows. Additionally, if you are planning on modified the model after calling this function, you may want to convert the returned list into a list of W(TreeRowReference)s. To do this, you can use GTK2.TreeRowReference->create().
GTK2.TreeView get_tree_view()
Returns the tree view associated with this selection.
object get_user_data()
Returns the user data for the selection function.
inherit G.Object : Object
int iter_is_selected(GTK2.TreeIter iter)
Returns true if the row at iter is currently selected.
int path_is_selected(GTK2.TreePath path)
Returns true if the row pointed to by path is currently selected. If path does not point to a valid location, false is returned.
GTK2.TreeSelection select_all()
Selects all the nodes. This selection must be set to GTK2.SELECTION_MULTIPLE mode.
GTK2.TreeSelection select_iter(GTK2.TreeIter iter)
Selects the specified iterator.
GTK2.TreeSelection select_path(GTK2.TreePath path)
Select the row at path.
GTK2.TreeSelection select_range(GTK2.TreePath start, GTK2.TreePath end)
Selects a range of nodes, determined by start and end inclusive. This selection must be set to GTK2.SELECTION_MULTIPLE mode.
GTK2.TreeSelection set_mode(int type)
Sets the selection mode. If the previous type was GTK2.SELECTION_MULTIPLE, then the anchor is kept selected, if it was previously selected. One of SELECTION_BROWSE, SELECTION_MULTIPLE, SELECTION_NONE and SELECTION_SINGLE.
GTK2.TreeSelection unselect_all()
Unselects all the nodes.
GTK2.TreeSelection unselect_iter(GTK2.TreeIter iter)
Unselects the specified iterator.
GTK2.TreeSelection unselect_path(GTK2.TreePath path)
Unselects the row at path.
GTK2.TreeSelection unselect_range(GTK2.TreePath start, GTK2.TreePath end)
Unselects a range of nodes, determined by start and end inclusive.
CLASS GTK2.TreeSortable |
The interface for sortable models used by TreeView.
Signals: sort_column_changed
mapping get_sort_column_id()
Returns ([ "column": int, "order": int ])
int has_default_sort_func()
Returns true if the model has a default sort function.
GTK2.TreeSortable set_default_sort_func(function(:void) f, mixed user_data)
Sets the default comparison function used when sorting to be f. If the current sort column id of this sortable is GTK2.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using this function.
if f is 0, then there will be no default comparison function. This means once the model has been sorted, it can't go back to the default state. In this case, when the current sort column id of this sortable is GTK2.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
GTK2.TreeSortable set_sort_column_id(int column, int order)
Sets the current sort column to be column. The widget will resort itself to reflect this change, after emitting a "sort-column-changed" signal. If column is GTK2.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the default sort function will be used, if it is set.
GTK2.TreeSortable set_sort_func(int column, function(:void) f, mixed user_data)
Sets the comparison function used when sorting to be f. If the current sort column id of this sortable is the same as column, then the model will sort using this function.
GTK2.TreeSortable sort_column_changed()
Emits a "sort-column-changed" signal
CLASS GTK2.TreeStore |
A tree-like data structure that can be used with W(TreeView).
GTK2.TreeIter append(GTK2.TreeIter parent)
Append a new row. If parent is valid, then it will append the new row after the last child, otherwise it will append a row to the toplevel.
GTK2.TreeStore clear()
Removes all rows.
GTK2.TreeStore GTK2.TreeStore(array types)
Create a new tree store with as many columns as there are items in the array. A type is either a string representing a type name, such as "int" or "float", or an actual widget. If it is a widget, the column in question should be a widget of the same type that you would like this column to represent.
inherit G.Object : Object
inherit GTK2.TreeDragDest : TreeDragDest
inherit GTK2.TreeDragSource : TreeDragSource
inherit GTK2.TreeModel : TreeModel
inherit GTK2.TreeSortable : TreeSortable
GTK2.TreeIter insert(GTK2.TreeIter parent, int position)
Insert a row at position. If parent is valid, will create as child, otherwise at top level. If position is larger than then number of rows at that level, it will be added to the end of the list. iter will be changed to point to the new row.
GTK2.TreeIter insert_after(GTK2.TreeIter parent, GTK2.TreeIter sibling)
Insert a new row after sibling. If sibling is 0, then the row will be prepended to parent's children. If parent and sibling are both 0, then the row will be prepended to the toplevel.
GTK2.TreeIter insert_before(GTK2.TreeIter parent, GTK2.TreeIter sibling)
Insert a row before sibling. If sibling is 0, then the row will be appended to parent's children. If parent and sibling are 0, then the row will be appended to the toplevel.
int is_ancestor(GTK2.TreeIter iter, GTK2.TreeIter descendant)
Returns true if iter is an ancestor of descendant.
int iter_depth(GTK2.TreeIter iter)
Get the depth of iter. This will be 0 for anything on the root level, 1 for anything down a level, and so on.
GTK2.TreeStore move_after(GTK2.TreeIter iter, GTK2.TreeIter position)
Moves iter to after position. These should be at the same level. This only works if the store is unsorted. If position is omitted, iter will be moved to the start of the level.
GTK2.TreeStore move_before(GTK2.TreeIter iter, GTK2.TreeIter position)
Moves iter to before position. These should be at the same level. This only works if the store is unsorted. If position is omitted, iter will be moved to the end of the level.
GTK2.TreeIter prepend(GTK2.TreeIter parent)
Prepend a new row. If parent is valid, then it will prepend the new row before the first child of parent, otherwise it will prepend a new row to the toplevel.
GTK2.TreeStore remove(GTK2.TreeIter iter)
Remove iter. iter is set to the next valid row at that level, or invalidated if it was the last one.
GTK2.TreeStore set_row(GTK2.TreeIter iter, array values)
Set the data in an entire row.
GTK2.TreeStore set_value(GTK2.TreeIter iter, int column, mixed value)
Set the data in the cell specified by iter and column.
GTK2.TreeStore swap(GTK2.TreeIter a, GTK2.TreeIter b)
Swap 2 rows. Only works if this store is unsorted.
CLASS GTK2.TreeView |
Properties: int enable-search GTK2.TreeViewColumn expander-column int fixed-height-mode GTK2.Adjustment hadjustment int headers-clickable int headers-visible int hover-expand int hover-selection int level-indentation GTK2.TreeModel model int reorderable int rules-hint int search-column int show-expanders GTK2.Adjustment vadjustment
Style properties: int allow-rules GDK2.Color even-row-color int expander-size int horizontal-separator int indent-expanders GDK2.Color odd-row-color int vertical-separator
Signals: columns_changed
cursor_changed
expand_collapse_cursor_row
move_cursor
row_activated
row_collapsed
row_expanded
select_all
select_cursor_parent
select_cursor_row
set_scroll_adjustments
start_interactive_search
test_collapse_row
test_expand_row
toggle_cursor_row
unselect_all
GTK2.TreeView append_column(GTK2.TreeViewColumn column)
Appends column to the list of columns. If this tree view has "fixed_height" mode enabled, then column must have its "sizing" property set to be GTK2.TREE_VIEW_COLUMN_FIXED.
GTK2.TreeView collapse_all()
Recursively collapses all visible, expanded nodes.
int collapse_row(GTK2.TreePath path)
Collapses a row (hides its child rows, if they exist).
GTK2.TreeView columns_autosize()
Resizes all columns to their optimal width. Only works after the treeview has been realized.
mapping convert_bin_window_to_tree_coords(int bx, int by)
Convert bin_window coordinates to tree coordinates.
mapping convert_bin_window_to_widget_coords(int bx, int by)
Convert bin_window coordinates to widget coordinates.
mapping convert_tree_to_bin_window_coords(int tx, int ty)
Converts tree coordinates (coordinates in full scrollable area of the tree) to bin_window coordinates.
mapping convert_tree_to_widget_coords(int tx, int ty)
Convert tree coordinates to widget coordinates.
mapping convert_widget_to_bin_window_coords(int wx, int wy)
Convert widget coordinates to bin_window coordinates.
mapping convert_widget_to_tree_coords(int wx, int wy)
Convert widget coordinates to tree coordinates.
GTK2.TreeView GTK2.TreeView(GTK2.TreeModel model_or_props)
Create a new W(TreeView), with or without a default model.
GTK2.TreeView expand_all()
Recursively expands all nodes.
int expand_row(GTK2.TreePath path, int open_all)
Opens the row so its children are visible.
GTK2.TreeView expand_to_path(GTK2.TreePath path)
Expands the row at path. This will also expand all parent rows of path as necessary.
GTK2.GdkRectangle get_background_area(GTK2.TreePath path, GTK2.TreeViewColumn column)
Similar to get_cell_area(). The returned rectangle is equivalent to the background_area passed to GTK2.CellRenderer->render(). These background area tiles to cover the entire tree window (except for the area used for header buttons). Contrast with get_cell_area(), which returns only the cell itself, excluding surrounding borders and the tree expander area.
GTK2.GdkWindow get_bin_window()
Returns the window that this view renders to. This is used primarily to compare to event->window to confirm that the event on this view is on the right window.
GTK2.GdkRectangle get_cell_area(GTK2.TreePath path, GTK2.TreeViewColumn column)
Fills the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column. If path is omitted or 0, or points to a path not currently displayed, the y and height fields of the rectangle will be 0. If column is omitted, the x and width fields will be o. The sum of all cell rects does not cover the entire tree; there are extra pixels in between rows, for example. The returned rectangle is equivalent to the cell_area passed to GTK2.CellRenderer->render(). This function is only valid if the view is realized.
GTK2.TreeViewColumn get_column(int n)
Gets the W(TreeViewColumn) at the given position.
array get_columns()
Returns an array of all the W(TreeViewColumn)'s current in the view.
mapping get_cursor()
Returns the current path and focus column. If the cursor isn't currently set, then "path" will be 0. If no column currently has focus, then "focus_column" will be 0. Returns ([ "path": GTK2.TreePath, "column": GTK2.TreeViewColumn ]);
int get_enable_search()
Returns whether or not the tree allows to start interactive searching by typing in text.
int get_enable_tree_lines()
Returns whether or not tree lines are drawn.
GTK2.TreeViewColumn get_expander_column()
Returns the column that is the current expander column. This column has the expander arrow drawn next to it.
int get_fixed_height_mode()
Returns whether fixed height mode is turned on.
int get_grid_lines()
Returns which grid lines are enabled.
GTK2.Adjustment get_hadjustment()
Gets the W(Adjustment) currently being used for the horizontal aspect.
int get_headers_clickable()
Returns whether all header columns are clickable.
int get_headers_visible()
Returns true if the headers are visible.
int get_hover_expand()
Returns whether hover expansion mode is turned on.
int get_hover_selection()
Returns whether hover selection mode is turned on.
int get_level_indentation()
Returns the amount, in pixels, of extra indentation for child levels
GTK2.TreeModel get_model()
Returns the model this TreeView is based on.
mapping get_path_at_pos(int x, int y)
Finds the path at the point (x,y) relative to widget coordinates. That is, x and y are relative to an events coordinates. x and y must come from an event on the view only where event->window==get_bin(). It is primarily for things like popup menus. Returns GTK2.TreePath, GTK2.TreeViewColumn, and cell_x and cell_y, which are the coordinates relative to the cell background (i.e. the background_area passed to GTK2.CellRenderer->render()). This function is only meaningful if the widget is realized.
int get_reorderable()
Retrieves whether the user can reorder the tree via drag-and-drop.
int get_rubber_banding()
Returns whether rubber banding is turned on. If the selection mode is GTK2.SELECTION_MULTIPLE, rubber banding will allow the user to select multiple rows by dragging the mouse.
int get_rules_hint()
Gets the setting set by set_rules_hint().
int get_search_column()
Gets the column searched on by the interactive search code.
GTK2.Entry get_search_entry()
Returns the GTK2.Entry which is currently in use as interactive search entry. In case the built-in entry is being used, 0 will be returned.
array get_selected()
Shortcut to GTK2.TreeView->get_selection() and GTK2.TreeSelection()->get_selected().
GTK2.TreeSelection get_selection()
Gets the W(TreeSelection) associated with this TreeView.
int get_show_expanders()
Returns whether or not expanders are drawn
GTK2.Adjustment get_vadjustment()
Gets the W(Adjustment) currently being used for the vertical aspect.
array get_visible_range()
Returns the first and last visible path. Note that there may be invisible paths in between.
GTK2.GdkRectangle get_visible_rect()
Returns a GDK2.Rectangle with the currently-visible region of the buffer, in tree coordinates. Conver to widget coordinates with tree_to_widget_coords(). Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire scrollable area of the tree.
inherit GTK2.Container : Container
int insert_column(GTK2.TreeViewColumn column, int position)
This inserts the column at position. If position is -1, then the column is inserted at the end. If this tree view has "fixed_height" mode enabled, then column must have its "sizing property set to GTK2.TREE_VIEW_COLUMN_FIXED.
GTK2.TreeView move_column_after(GTK2.TreeViewColumn column, GTK2.TreeViewColumn base)
Moves column to be after base. If base is omitted, then column is placed in the first position.
int remove_column(GTK2.TreeViewColumn column)
Removes column.
GTK2.TreeView row_activated(GTK2.TreePath path, GTK2.TreeViewColumn column)
Activates the cell determined by path and column.
int row_expanded(GTK2.TreePath path)
Returns true if the node pointed to by path is expanded.
GTK2.TreeView scroll_to_cell(GTK2.TreePath path, GTK2.TreeViewColumn column, float|void row_align, float|void col_align)
Moves the alignments of the view to the position specified by column and path. If column is 0, then no horizontal scrolling occurs. Likewise, if path is 0, no vertical scrolling occurs. At a minimum, one of column or path needs to be non-zero. row_align determines where the row is placed, and col_align determines where column is placed. Both are expected to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means center.
If row_align exists, then col_align must exist, otherwise neither will be used. If neither are used, the tree does the minimum amount of work to scroll the cell onto the screen. This means that the cell will be scrolled to the edge closest to its current position. If the cell is currently visible on the screen, nothing is done.
This function only works if the model is set, and path is a valid row on the model. If the model changes before the view is realized, the centered path will be modifed to reflect this change.
GTK2.TreeView scroll_to_point(int x, int y)
Scrolls the tree view such that the top-left corner of the visible area is x,y, where x and y are specified in tree window coordinates. The view must be realized before this function is called. If it isn't, you probably want to be using scroll_to_cell().
If either x or y are -1, then that direction isn't scrolled.
GTK2.TreeView set_cursor(GTK2.TreePath path, GTK2.TreeViewColumn focus_column, int|void start_editing)
Sets the current keyboard focus to be at path, and selects it. This is useful when you want to focus the user's attention on a particular row. If focus_column is present, then focus is given to the column specified by it. Additionally, if focus_column is specified, and start_editing is true, then editing should be started in the specified cell. This function is often followed by grab_focus() in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.
GTK2.TreeView set_cursor_on_cell(GTK2.TreePath path, GTK2.TreeViewColumn focus_column, int|void start_editing, GTK2.CellRenderer focus_cell)
Sets the current keyboard focus to be at path, and selects it. This is useful when you want to focus the user's attention on a particular row. If focus_column is present, then focus is given to the column specified by it. If focus_column and focus_cell are present, and focus_column contains 2 or more editable or activatable cells, then focus is given to the cell specified by focus_cell. Additionally, if focus_column is specified, and start_editing is true, then editing should be started in the specified cell. This function is often followed by grab_focus() in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.
GTK2.TreeView set_enable_search(int enable_search)
If enable_search is set, then the user can type in text to search through the tree interactively (this is sometimes called "typeahead find").
Note that even if this is false, the user can still initiate a search using the "start-interactive-search" key binding.
GTK2.TreeView set_enable_tree_lines(int enabled)
Sets whether to draw lines interconnecting the expanders. This does not have any visible effects for lists.
GTK2.TreeView set_expander_column(GTK2.TreeViewColumn column)
Sets the column to draw the expander arrow at. It must be in the view. If column is omitted, then the expander arrow is always at the first visible column.
GTK2.TreeView set_fixed_height_mode(int enable)
Enables or disables the fixed height mode. Fixed height mode speeds up W(TreeView) by assuming that all rows have the same height. Only enable this option if all rows are the same height and all columns are of type GTK2.TREE_VIEW_COLUMN_FIXED.
GTK2.TreeView set_grid_lines(int grid_lines)
Sets which grid lines to draw.
GTK2.TreeView set_hadjustment(GTK2.Adjustment hadj)
Sets the W(Adjustment) for the current horizontal aspect.
GTK2.TreeView set_headers_clickable(int setting)
Allow the column title buttons to be clicked.
GTK2.TreeView set_headers_visible(int headers_visible)
Sets the visibility state of the headers.
GTK2.TreeView set_hover_expand(int expand)
Enables or disables the hover expansion mode. Hover expansion makes rows expand or collapse if the pointer moves over them.
GTK2.TreeView set_hover_selection(int hover)
Enables or disables the hover selection mode. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes GTK2.SELECTION_SINGLE and GTK2.SELECTION_BROWSE.
GTK2.TreeView set_model(GTK2.TreeModel model)
Sets the model. If this TreeView already has a model set, it will remove it before setting the new model.
GTK2.TreeView set_reorderable(int reorderable)
This function is a convenience function to allow you to reorder models. If reorderable is true, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model's "row-inserted" and "row-deleted" signals.
This function does not give you any degree of control over the order -- any reordering is allowed. If more control is needed, you should probably handle drag and drop manually.
GTK2.TreeView set_row_separator_func(function(:void) f, mixed user_data)
Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is 0 no separators are drawn. This is the default value.
GTK2.TreeView set_rubber_banding(int enable)
Enables or disables rubber banding.
GTK2.TreeView set_rules_hint(int setting)
This function tells GTK2+ that the user interface for your application requires users to read across tree rows and associate cells with one another. By default, GTK2+ will then render the tree with alternating row colors. Do not use it just because you prefer the appearance of the ruled tree; that's a question for the theme. Some themes will draw tree rows in alternating colors even when rules are turned off, and users who prefer that appearance all the time can choose those themes. You should call this function only as a semantic hint to the theme engine that your tree makes alternating colors usefull from a functional standpoint (since it has lots of columns, generally).
GTK2.TreeView set_search_column(int column)
Sets column as the column where the interactive search code should search in.
If the sort column is set, users can use the "start-interactive-search" key binding to bring up search popup. The enable-search property controls whether simply typing text will also start an interactive search.
Note that column refers to a column of the model.
GTK2.TreeView set_search_entry(GTK2.Entry entry)
Sets the entry which the interactive search code will use. This is useful when you want to provide a search entry in your interface at all times at a fixed position. Passing 0 will make the interactive search code use the built-in popup entry again.
GTK2.TreeView set_show_expanders(int show)
Sets whether to draw and enable expanders and indent child rows.
GTK2.TreeView set_vadjustment(GTK2.Adjustment vadj)
Sets the W(Adjustment) for the current vertical aspect.
CLASS GTK2.TreeViewColumn |
Properties: float alignment int clickable int expand int fixed-width int max-width int min-width int reorderable int resizable int sizing TREE_VIEW_COLUMN_AUTOSIZE, TREE_VIEW_COLUMN_FIXED and TREE_VIEW_COLUMN_GROW_ONLY int sort-indicator int sort-order SORT_ASCENDING and SORT_DESCENDING int spacing string title int visible GTK2.Widget widget int width
Signals: clicked
GTK2.TreeViewColumn add_attribute(GTK2.CellRenderer cell_renderer, string attribute, int column)
Adds an attribute mapping to the list. The column is the column of the model to get a value from, and the attribute is the parameter on cell_rendere to be set from the value. So for example if column 2 of the model contains strings, you could have the "text" attribute of a W(CellRendererText) get its values from column 2.
mapping cell_get_position(GTK2.CellRenderer cell_renderer)
Obtains the horizontal position and size of a cell in a column. If the cell is not found in the column, returns -1 for start_pos and width.
mapping cell_get_size(GTK2.GdkRectangle cell_area)
Obtains the width and height needed to render the column.
int cell_is_visible()
Returns true if any of the cells packed into the colum are visible. For this to be meaningful, you must first initialize the cells with cell_set_cell_data().
GTK2.TreeViewColumn cell_set_cell_data(GTK2.TreeModel model, GTK2.TreeIter iter, int is_expander, int is_expanded)
Sets the cell renderer based on the model and iter. That is, for every attribute mapping in this column, it will get a value from the set column on the iter, and use that value to set the attribute on the cell renderer. This is used primarily by the W(TreeView).
GTK2.TreeViewColumn clear()
Unsets all the mappings on all renderers.
GTK2.TreeViewColumn clear_attributes(GTK2.CellRenderer cell_renderer)
Clears all existing attributes previously set.
GTK2.TreeViewColumn clicked()
Emits the "clicked" signal on the column. This function will only work if this column is clickable.
GTK2.TreeViewColumn GTK2.TreeViewColumn(string|mapping title_or_props, GTK2.CellRenderer renderer, string|void property, int|void col)
Creates a new W(TreeViewColumn).
GTK2.TreeViewColumn focus_cell(GTK2.CellRenderer cell)
Sets the current keyboard focus to be at cell, if the column contains 2 or more editable and activatable cells.
float get_alignment()
Returns the current x alignment. This value can range between 0.0 and 1.0.
array get_cell_renderers()
Returns an array of all the cell renderers in the column, in no partciular order.
int get_clickable()
Returns true if the user can click on the header for the column.
int get_expand()
Return true if the column expands to take any available space.
int get_fixed_width()
Gets the fixed width of the column.
int get_max_width()
Returns the maximum width in pixels, or -1 if no maximum width is set.
int get_min_width()
Returns the minimum width in pixels, or -1 if no minimum width is set.
int get_reorderable()
Returns true if the column can be reordered by the user.
int get_resizable()
Returns true if the column can be resized by the end user.
int get_sizing()
Returns the current type.
int get_sort_column_id()
Gets the logical column_id that the model sorts on when this column is selected for sorting.
int get_sort_indicator()
Gets the value set by set_sort_indicator();
int get_sort_order()
Gets the value set by set_sort_order().
int get_spacing()
Returns the spacing.
string get_title()
Returns the title of the widget.
GTK2.Widget get_tree_view()
Returns the W(TreeView) that this TreeViewColumn has been inserted into.
int get_visible()
Returns true if the column is visible.
GTK2.Widget get_widget()
Returns the W(Widget) in the button on the column header. If a custom widget has not been set then 0 is returned.
int get_width()
Returns the current size in pixels.
inherit GTK2.CellLayout : CellLayout
inherit GTK2.Data : Data
GTK2.TreeViewColumn pack_end(GTK2.CellRenderer cell, int expand)
Packs the cell to the end of the column.
GTK2.TreeViewColumn pack_start(GTK2.CellRenderer cell, int expand)
Packs the cell into the beginning of the column. If expand is false, then the cell is allocated no more space than it needs. Any unused space is divied evenly between cels for which expand is true.
GTK2.TreeViewColumn queue_resize()
Flags the column, and the cell renderers added to this column, to have their sizes renegotiated.
GTK2.TreeViewColumn set_alignment(float xalign)
Sets the alignment of the title or custom widget inside the column header. The alignment determines its location inside the button - 0.0 for left, 0.5 for center, 1.0 for right.
GTK2.TreeViewColumn set_clickable(int clickable)
Sets the header to be active if clickable is true. When the header is active, then it can take keyboard focus, and can be clicked.
GTK2.TreeViewColumn set_expand(int expand)
Sets the column to take available extra space. This space is shared equally amongst all columns that have the expand set to true. If no column has this option set, then the last column gets all extra space. By default, every column is created with this false.
GTK2.TreeViewColumn set_fixed_width(int fixed_width)
Sets the size of the column in pixels. The is meaningful only if the sizing type is GTK2.TREE_VIEW_COLUMN_FIXED. The size of the column is clamped to the min/max width for the column. Please note that the min/max width of the column doesn't actually affect the "fixed-width" property of the widget, just the actual size when displayed.
GTK2.TreeViewColumn set_max_width(int max_width)
Sets the maximum width. If max_width is -1, then the maximum width is unset. Note, the column can actually be wider than max width if it's the last column in a view. In this case, the column expands to fill any extra space.
GTK2.TreeViewColumn set_min_width(int min_width)
Sets the minimum width. If min_width is -1, then the minimum width is unset.
GTK2.TreeViewColumn set_reorderable(int reorderable)
If reorderable is true, then the column can be reorderd by the end user dragging the header.
GTK2.TreeViewColumn set_resizable(int resizable)
If resizable is true, then the user can explicitly resize the column by grabbing the outer edge of the column button. If resizable is ture and the sizing mode of the column is GTK2.TREE_VIEW_COLUMN_AUTOSIZE, then the sizing mode is changed to GTK2.TREE_VIEW_COLUMN_GROW_ONLY.
GTK2.TreeViewColumn set_sizing(int type)
Sets the growth behavior of this columnt to type. One of TREE_VIEW_COLUMN_AUTOSIZE, TREE_VIEW_COLUMN_FIXED and TREE_VIEW_COLUMN_GROW_ONLY.
GTK2.TreeViewColumn set_sort_column_id(int column_id)
Sets the logical column_id that this column sorts on when this column is selected for sorting. Doing so makes the column header clickable.
GTK2.TreeViewColumn set_sort_indicator(int setting)
Call this function with a setting of true to display an arrow in the header button indicating the column is sorted. Call set_sort_order() to change the direction of the arrow.
GTK2.TreeViewColumn set_sort_order(int order)
Changes the appearance of the sort indicator.
This does not actually sort the model. Use set_sort_column_id() if you wnat automatic sorting support. This function is primarily for custom sorting behavior, and should be used in conjunction with GTK2.TreeSortable->set_sort_column() to do that. For custom models, the mechanism will vary.
The sort indicator changes direction to indicate normal sort or reverse sort. Note that you must have the sort indicator enabled to see anything when calling this function. One of SORT_ASCENDING and SORT_DESCENDING.
GTK2.TreeViewColumn set_spacing(int spacing)
Sets the spacing field, which is the number of pixels to place between cell renderers packed into it.
GTK2.TreeViewColumn set_title(string title)
Sets the title. If a custom widget has been set, then this value is ignored.
GTK2.TreeViewColumn set_visible(int visible)
Sets the visibility.
GTK2.TreeViewColumn set_widget(GTK2.Widget widget)
Sets the widget in the header to be widget. If widget is omitted, then the header button is set with a W(Label) set to the title.
CLASS GTK2.UiManager |
Constructing menus and toolbars from an XML description. Properties: int add-tearoffs string ui
Signals: actions_changed Emitted whenever the actions changes.
add_widget Emitted for each generated menubar and toolbar, but not for generated popup menus.
connect_proxy Emitted after connecting a proxy to an action.
disconnect_proxy Emitted after disconnecting a proxy from an action.
post_activate Emitted just after the action is activated.
pre_activate Emitted just before the action is activated. A UI definition: <ui> <menubar> <menu name="FileMenu" action="FileMenuAction"> <menuitem name="New" action="New2Action" /> <placeholder name="FileMenuAdditions" /> </menu> <menu name="JustifyMenu" action="JustifyMenuAction"> <menuitem name="Left" action="justify-left"/> <menuitem name="Centre" action="justify-center"/> <menuitem name="Right" action="justify-right"/> <menuitem name="Fill" action="justify-fill"/> </menu> </menubar> <toolbar action="toolbar1"> <placeholder name="JustifyToolItems"> <separator/> <toolitem name="Left" action="justify-left"/> <toolitem name="Centre" action="justify-center"/> <toolitem name="Right" action="justify-right"/> <toolitem name="Fill" action="justify-fill"/> <separator/> </placeholder> </toolbar> </ui>
GTK2.UiManager add_ui(int merge_id, string path, string name, string action, int type, int top)
Adds a ui element to the current contents.
If type is GTK2.UI_MANAGER_AUTO, GTK2+ inserts a menuitem, toolitem or separator if such an element can be inserted at the place determined by path. Otherwise type must indicate an element that can be inserted at the place determined by path.
int add_ui_from_file(string filename)
Parses a file containing a ui definition.
int add_ui_from_string(string buffer)
Parses a string containing a ui definition and merges it with the current contents. An enclosing >ui< element is added if it is missing.
GTK2.UiManager GTK2.UiManager(mapping|void props)
Creates a new ui manager object.
GTK2.UiManager ensure_update()
Makes sure that all pending updates to the ui have been completed.
GTK2.AccelGroup get_accel_group()
Returns the GTK2.AccelGroup associated with this.
GTK2.Action get_action(string path)
Looks up an action by following a path.
array get_action_groups()
Returns the list of action groups.
int get_add_tearoffs()
Returns whether menus generated by this manager will have tearoff menu items.
array get_toplevels(int types)
Obtains a list of all toplevel widgets of the requested types. Bitwise or of UI_MANAGER_ACCELERATOR, UI_MANAGER_AUTO, UI_MANAGER_MENU, UI_MANAGER_MENUBAR, UI_MANAGER_MENUITEM, UI_MANAGER_PLACEHOLDER, UI_MANAGER_POPUP, UI_MANAGER_SEPARATOR, UI_MANAGER_TOOLBAR and UI_MANAGER_TOOLITEM.
string get_ui()
Creates a ui definition of the merged ui.
GTK2.Widget get_widget(string path)
Looks up a widget by following a path. The path consists of the names specified in the xml description of the ui, separated by '/'. Elements which don't have a name or action attribute in the xml (e.g. >popup<) can be addressed by their xml element name (e.g. "popup"). The root element ("/ui") can be omitted in the path.
Note that the widget found be following a path that ends in a >menu< element is the menuitem to which the menu is attached, not the menu itself.
inherit G.Object : Object
GTK2.UiManager insert_action_group(GTK2.ActionGroup group, int pos)
Inserts an action group into the list of action groups. Actions in earlier groups hide actions with the same name in later groups.
int new_merge_id()
Returns an unused merge id, suitable for use with add_ui().
GTK2.UiManager remove_action_group(GTK2.ActionGroup group)
Removes an action group from the list of action groups.
GTK2.UiManager remove_ui(int merge_id)
Unmerges the part of the content identified by merge_id.
GTK2.UiManager set_add_tearoffs(int setting)
Sets the "add-tearoffs" property, which controls whether menus generated by this manager will have tearoff menu items.
Note that this only affects regular menus. Generated popup menus never have tearoff menu items.
CLASS GTK2.VScrollbar |
General documentation: See W(Scrollbar)
GTK2.VScrollbar(GTK2.Adjustment())->set_size_request(15,60)
GTK2.VScrollbar GTK2.VScrollbar(GTK2.Adjustment pos_or_props)
Used to create a new vscrollbar widget.
inherit GTK2.Scrollbar : Scrollbar
CLASS GTK2.Vbox |
Most packing is done by creating boxes. These are invisible widget containers that we can pack our widgets into which come in two forms, a horizontal box, and a vertical box. This is the vertical one. When packing widgets into a vertical box, the objects are inserted horizontally from top to bottom or bottom to top depending on the call used.
GTK2.Vbox(0,0)->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->pack_end_defaults(GTK2.Button("From right"))->pack_start_defaults(GTK2.Button("From left"))
GTK2.Vbox(1,0)->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->pack_end_defaults(GTK2.Button("From right"))->pack_start_defaults(GTK2.Button("From left"))
GTK2.Vbox(1,40)->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->pack_end_defaults(GTK2.Button("From right"))->pack_start_defaults(GTK2.Button("From left"))
GTK2.Vbox GTK2.Vbox(int|mapping uniformp_or_props, int|void padding)
Create a new vertical box widget. If all_same_size is true, all widgets will have exactly the same size. padding is added to the top and bottom of the children.
inherit GTK2.Box : Box
CLASS GTK2.VbuttonBox |
A Vbutton_box is very similar to a Vbox. The major diffference is that the button box is made to pack buttons in, and has a few convenience function for normal button layouts.
GTK2.VbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_size_request(100,300)
GTK2.VbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_layout(GTK2.BUTTONBOX_SPREAD)->set_size_request(100,300)
GTK2.VbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_layout(GTK2.BUTTONBOX_EDGE)->set_size_request(100,300)
GTK2.VbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_layout(GTK2.BUTTONBOX_START)->set_size_request(100,300)
GTK2.VbuttonBox()->add(GTK2.Button("Hello"))->add(GTK2.Button("World"))->set_layout(GTK2.BUTTONBOX_END)->set_size_request(100,300)
GTK2.VbuttonBox GTK2.VbuttonBox(mapping|void props)
Create a new vertical button box
inherit GTK2.ButtonBox : ButtonBox
CLASS GTK2.Viewport |
This is a container that can be scrolled around, but it has no scrollbars.
You can connect scrollbars to it using the adjustment objects.
GTK2.Viewport(GTK2.Adjustment(),GTK2.Adjustment())->set_size_request(100,100)
GTK2.Viewport(GTK2.Adjustment(),GTK2.Adjustment())->set_size_request(100,100)->set_shadow_type(GTK2.SHADOW_ETCHED_IN)
GTK2.Viewport(GTK2.Adjustment(),GTK2.Adjustment())->set_size_request(100,100)->add(GTK2.Label("A label with a very long text on it, it will not fit"))->set_shadow_type(GTK2.SHADOW_ETCHED_IN)
lambda(){ object a1;object v = GTK2.Viewport(a1=GTK2.Adjustment(),GTK2.Adjustment())->set_size_request(100,100)->add(GTK2.Label("A label with a very long text on it, it will not fit"))->set_shadow_type(GTK2.SHADOW_ETCHED_IN);call_out(a1->set_value,0,100.0);return v;}()
Properties: GTK2.Adjustment hadjustment int shadow-type GTK2.Adjustment vadjustment
Signals: set_scroll_adjustments
GTK2.Viewport GTK2.Viewport(GTK2.Adjustment xscroll_or_props, GTK2.Adjustment yscroll)
Create a new viewport. The adjustments are used to select what part of the viewport to view to the user. They are normally connected to a scrollbar or something similar.
GTK2.Adjustment get_hadjustment()
Return the current horizontal adjustment object
int get_shadow_type()
Get the shadow type. One Of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK2.Adjustment get_vadjustment()
Return the current vertical adjustment object
inherit GTK2.Bin : Bin
GTK2.Viewport set_hadjustment(GTK2.Adjustment xscroll)
Set a new horizontal adjustment object.
GTK2.Viewport set_shadow_type(int type)
Set the shadow style. One of SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_NONE and SHADOW_OUT
GTK2.Viewport set_vadjustment(GTK2.Adjustment yscroll)
Set a new vertical adjustment object.
CLASS GTK2.VolumeButton |
Volume Button
GTK2.VolumeButton GTK2.VolumeButton(mapping|void props)
Create a new W(VolumeButton).
inherit GTK2.ScaleButton : ScaleButton
CLASS GTK2.Vpaned |
The paned window widgets are useful when you want to divide an area into two parts, with the relative size of the two parts controlled by the user. A groove is drawn between the two portions with a handle that the user can drag to change the ratio. This widgets makes a vertical division
GTK2.Vpaned()->add1(GTK2.Label("Top Side Of Pane"))->add2(GTK2.Label("Bottom"))->set_size_request(100,100)
GTK2.Vpaned GTK2.Vpaned(mapping|void props)
Create a new W(Vpaned) widget.
inherit GTK2.Paned : Paned
CLASS GTK2.Vscale |
The GTK2.HScale widget is used to allow the user to select a value using a horizontal slider. A GTK2.Adjustment is used to set the initial value, the lower and upper bounds, and the step and page increments.
See W(Scale) for details
The position to show the current value, and the number of decimal places shown can be set using the parent W(Scale) class's functions.
GTK2.Vscale(GTK2.Adjustment())->set_size_request(300,30)
GTK2.Vscale GTK2.Vscale(GTK2.Adjustment settings_or_min_props, float|void max, float|void step)
Used to create a new hscale widget. Either pass an W(Adjustment), or three floats representing min, max, and step values.
inherit GTK2.Scale : Scale
CLASS GTK2.Vseparator |
Simply creates a vertical separator. No bells or whistles.
GTK2.Vseparator()->set_size_request(3,50)
GTK2.Vseparator GTK2.Vseparator(mapping|void props)
Used to create a new vseparator widget.
inherit GTK2.Separator : Separator
CLASS GTK2.Widget |
The basic widget, inherited (directly or indirectly) by all widgets. Thus, all functions and signals defined in this widget work on all widgets.
One of the most important functions in this class is 'show', it lets GTK2 know that we are done setting the attributes of the widget, and it is ready to be displayed. You may also use hide to make it disappear again. The order in which you show the widgets is not important, but I suggest showing the toplevel window last so the whole window pops up at once rather than seeing the individual widgets come up on the screen as they're formed. The children of a widget (a window is a widget too) will not be displayed until the window itself is shown using the show() function.
Properties: int app-paintable int can-default int can-focus int composite-child int events (GDK2.EventMask) int extension-events (GDK_EXTENSION_EVENTS_ALL, GDK_EXTENSION_EVENTS_CURSOR and GDK_EXTENSION_EVENTS_NONE) int has-default int has-focus int has-tooltip int height-request int is-focus string name int no-show-all GTK2.Container parent int receives-default int sensitive GTK2.Style style string tooltip-markup string tooltip-text int visible int width-request
Style properties: float cursor-aspect-ratio GDK2.Color cursor-color int draw-border string focus-line-pattern int focus-line-width int focus-padding int interior-focus GDK2.Color link-color int scroll-arrow-hlength int scroll-arrow-vlength int separator-height int separator-width GDK2.Color visited-link-color int wide-separators
Signals: accel_closures_changed
button_press_event Called when a mouse button is pressed
button_release_event Called when a mouse button is released
can_activate_accel
child_notify
client_event An event sent by another client application
composited_changed
configure_event The size, position or stacking order of the widget has changed
delete_event Called when the user has requested that the widget should be closed
destroy_event Called when the widget is destroyed
direction_changed
drag_begin Called when the drag is initiated, on the sending side
drag_data_delete Called when the data can be safely deleted (there is no need to use this function in pigtk, it's all handled automatically)
drag_data_get Called on the sending side when the drop is initiated
drag_data_received Called on the receiving side when the drop is finished
drag_drop Called on the receiving side when the drop is initiated
drag_end Called when the drag is finished, on the sending side
drag_failed
drag_leave Called when the mouse leaves the widget while the user is dragging something
drag_motion Called on the receiving side when the cursor is moved over the widget while dragging something
enter_notify_event Calls when the mouse enters the widget
event Called for all events
event_after
expose_event Called when the widget, or a part of the widget, gets an expose event
focus
focus_in_event The keyboard focus has entered the widget
focus_out_event The keyboard focus has left the widget
grab_broken_event
grab_focus
grab_notify
hide Called when the widget is hidden
hierarchy_changed
key_press_event Called when a keyboard key is pressed
key_release_event Called when a keyboard key is released
keynav_failed
leave_notify_event Called when the mouse leaves the widget
map Called when the window associated with the widget is mapped
map_event Called just before the 'map' signal
mnemonic_activate
motion_notify_event Called when the mouse is moved inside the widget
no_expose_event
parent_set Called when the parent widget is changed
popup_menu
property_notify_event Called when a property of the GDK window associated with the widget is changed
proximity_in_event
proximity_out_event
query_tooltip
realize Called when the widget is realized. Some methods cannot be used until the widget has been realized; if you get assertion errors related to 'w->window' or similar, this is probably the cause.
screen_changed
scroll_event
selection_clear_event
selection_get
selection_notify_event
selection_received
selection_request_event
show Called when the widget is shown
show_help
size_allocate Called when the widget gets the size it should be
size_request Called when the widget should calculate how big it wants to be
state_changed
style_set Called when the style is changed
unmap Called when the window associated with the widget is unmapped
unmap_event Called just before the 'unmap' signal
unrealize Called when the widget is unrealized;
visibility_notify_event The widget has been mapped, unmapped, hidden, or otherwise had it's visibility modified
window_state_event
GTK2.Widget APP_PAINTABLE()
Returns if the GTK2.APP_PAINTABLE flag has been set on this widget.
GTK2.Widget CAN_DEFAULT()
Returns if this widget is allowed to receive the default action.
GTK2.Widget CAN_FOCUS()
Returns if this widget is able to handle focus grabs.
GTK2.Widget COMPOSITE_CHILD()
Returns if this widget is a composite child of its parent.
GTK2.Widget DOUBLE_BUFFERED()
Returns if the GTK2.DOUBLE_BUFFERED flag has been set on this widget.
GTK2.Widget DRAWABLE()
Returns if this widget is mapped and visible.
GTK2.Widget FLAGS()
Returns flags.
GTK2.Widget HAS_DEFAULT()
Returns if this widget is currently receiving the default action.
GTK2.Widget HAS_FOCUS()
Returns if this widget has grabbed the focus and no other widget has done so more recently.
GTK2.Widget HAS_GRAB()
Returns if this widget is in the grab_widgets stack, and will be the preferred one for receiving events other than ones of cosmetic value.
GTK2.Widget IS_SENSITIVE()
Returns if this widget is effectively sensitive.
GTK2.Widget MAPPED()
Returns if this widget is mapped.
GTK2.Widget NO_WINDOW()
Returns if this widget doesn't have its own GDK2.Window.
GTK2.Widget PARENT_SENSITIVE()
Returns if the GTK2.PARENT_SENSITIVE flag is set.
GTK2.Widget RC_STYLE()
Returns if the widget's style has been looked up through the rc mechanism.
GTK2.Widget REALIZED()
Returns if this widget is realized.
GTK2.Widget RECEIVES_DEFAULT()
Returns if this widget when focused will receive the default action even if there is a different widget set as default.
GTK2.Widget SAVED_STATE()
Get the saved state.
GTK2.Widget SENSITIVE()
Returns if this widget is sensitive.
GTK2.Widget STATE()
Get the state.
GTK2.Widget TOPLEVEL()
Returns if this is a toplevel widget.
GTK2.Widget VISIBLE()
Returns if this widget is visible.
int activate()
For widgets that can be "activated" (buttons, menu items, etc.) this functions activates them. Activation is what happens when you press Enter on a widget during key navigation.
GTK2.Widget add_accelerator(string accel_signal, GTK2.AccelGroup accel_group, int accel_key, int accel_mods, int accel_flags)
Installs an accelerator in accel_group that causes accel_signal to be emitted if the accelerator is activated. The signal must be of type G_RUN_ACTION.
GTK2.Widget add_events(int events)
Adds the events in the bitfield events to the event mask.
GTK2.Widget add_mnemonic_label(GTK2.Widget label)
Adds a widget to the list of mnemonic lables for this widget. Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update it's internal state at this point as well, by using a connection to the destroy signal.
mapping allocation()
Returns ([ "x": xoffset, "y":yoffset, "width":xsize, "height":ysize ])
int can_activate_accel(int signal_id)
Determines whether an accelerator that activates the signal signal_id can currently be activated.
GTK2.Widget child_notify(string prop)
Emits a "child-notify" signal for the child property prop.
string class_path()
Same as path() but uses type rather than name.
GTK2.Pango.Context create_pango_context()
Creates a new Pango.Context with the appropriate colormap, font description, and base direction for drawing text for this widget.
GTK2.Pango.Layout create_pango_layout(string text)
Creates a new Pango.Layout with the appropriate colormap, font description, and base direction for drawing text.
GTK2.Widget error_bell()
Notifies the user about an input-related error on this widget. If the "gtk-error-bell" setting is TRUE, it calls gdk_window_beep(), otherwise it does nothing
GTK2.Widget freeze_child_notify()
Stops emission of "child-notify" signals. The signals are queued until thaw_child_notify() is called on the widget.
GTK2.Action get_action()
Returns the GTK2.Action that this widget is a proxy for.
GTK2.Clipboard get_clipboard(GDK2.Atom selection)
Returns the clipboard object for the given selection.
string get_composite_name()
Get the composite name.
int get_direction()
Gets the reading direction.
GTK2.GdkDisplay get_display()
Get the GDK2.Display for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a GTK2.Window at the top.
int get_events()
Returns the event mask for the widget.
int get_extension_events()
Retrieves the extension events the widget will receive.
GTK2.RcStyle get_modifier_style()
Returns the current modifier style.
string get_name()
Retrieves the name.
int get_no_show_all()
Returns the current value of the "no-show-all" property.
GTK2.Pango.Context get_pango_context()
Gets a Pango.Context with the appropriate colormap, font description, and base direction for this widget.
GTK2.Widget get_parent()
Returns the parent container.
GTK2.GdkWindow get_parent_window()
Get the parent window.
mapping get_pointer()
Obtains the location of the mouse pointer in widget coordinates.
GTK2.GdkWindow get_root_window()
Get the root window.
GTK2.GdkScreen get_screen()
Get the GDK2.Screen from the toplevel window associated with this widget.
GTK2.Settings get_settings()
Gets the settings object holding the settings (global property settings, RC file information, etc) used for this widget.
mapping get_size_request()
Gets the size request that was explicityly set for the widget using set_size_request(). A value of -1 for width or height indices that that dimension has not been set explicityly and the natural requisition of the widget will be used instead. To get the size a widget will actually use, call size_request() instead.
GTK2.GdkPixmap get_snapshot(GTK2.GdkRectangle clip_rect)
Create a GDK2.Pixmap of the contents of the widget and its children
Works even if the widget is obscured. The depth and visual of the resulting pixmap is dependent on the widget being snapshot and likely differs from those of a target widget displaying the pixmap. The function GDK2.Pixbuf->get_from_drawable() can be used to convert the pixmap to a visual independent representation.
The snapshot are used by this function is the widget's allocation plus any extra space occupied by additional windows belonging to this widget (such as the arrows of a spin button). Thus, the resulting snapshot pixmap is possibly larger than the allocation.
If clip_rect is non-null, the resulting pixmap is shrunken to match the specified clip_rect. The (x,y) coordinates of clip_rect are interpreted widget relative. If width or height of clip_rect are 0 or negative, the width or height of the resulting pixmap will be shurnken by the respective amount. For instance, a clip_rect (+5,+5,-10,-10) will chop off 5 pixels at each side of the snapshot pixmap. If non-null, clip_rect will contain the exact widget-relative snapshot coordinates upon return. A clip_rect of (-1,-1,0,0) can be used to preserve the auto-grown snapshot area and use clip_rect as a pure output parameter.
The return pixmap can be 0, if the resulting clip_area was empty.
GTK2.Style get_style()
Returns the style.
string get_tooltip_markup()
Gets the contents of the tooltip
string get_tooltip_text()
Gets the contents of the tooltip
GTK2.Window get_tooltip_window()
Returns the GtkWindow of the current tooltip
GTK2.Widget get_toplevel()
This function returns the topmost widget in the container hierarchy this widget is a part of. If this widget has no parent widgets, it will be returned as the topmost widget.
GTK2.GdkWindow get_window()
Returns the widget's window if it is realized, other NULL.
GTK2.Widget grab_default()
Causes this widget to become the default widget.
GTK2.Widget grab_focus()
Causes this widget to have the keyboard focus. This widget must be a focusable widget, such as a GTK2.Entry; something like GTK2.Frame won't work.
int has_screen()
Checks whether there is a GDK2.Screen associated with this widget.
GTK2.Widget hide()
Hide the widget.
GTK2.Widget hide_all()
Hide this widget, and all child widgets.
int hide_on_delete()
Utility function
inherit GTK2.Object : Object
GTK2.Widget input_shape_combine_mask(GTK2.GdkBitmap shape_mask, int offset_x, int offset_y)
Sets an input shape for this widget's GDK2.Window.
int is_ancestor(GTK2.Widget ancestor)
Determines whether this widget is somewhere inside ancestor.
int is_composited()
Whether this widget can rely on having its alpha channel drawn correctly.
int is_focus()
Determines if the widget is the focus widget within its toplevel. (This does not mean that the HAS_FOCUS flag is necessarily set; HAS_FOCUS will only be set if the toplevel widget additionally has the input focus.
int keynav_failed(int direction)
This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the "keynav-changed" signal on the widget and its return value should be interpreted in a way similar to the return value of widget->child_focus():
When TRUE is returned, stay in the widget, the failed keyboard navigation is Ok and/or there is nowhere we can/should move the focus to.
When FALSE is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling widget->child_focus() on the widget's toplevel.
The default ::keynav-failed handler returns TRUE for GTK_DIR.TAB_FORWARD and GTK_DIR.TAB_BACKWARD. For the other values of GtkDirectionType, it looks at the "gtk-keynav-cursor-only"" setting and returns FALSE if the setting is TRUE. This way the entire user interface becomes cursor-navigatable on input devices such as mobile phones which only have cursor keys but no tab key.
Whenever the default handler returns TRUE, it also calls widget->error_bell() to notify the user of the failed keyboard navigation.
array list_mnemonic_lables()
Returns a list of the widgets, normally labels, for which this widget is the target of a mnemonic.
GTK2.Widget map()
Causes this widget to be mapped.
int mnemonic_activate(int group_cycling)
Not documented.
GTK2.Widget modify_base(int state, GTK2.GdkColor color)
Sets the base color of the widget in a particular state. See modify_fg().
GTK2.Widget modify_bg(int state, GTK2.GdkColor color)
Sets the background color of the widget in a particular state. See modify_fg().
GTK2.Widget modify_cursor(GTK2.GdkColor primary, GTK2.GdkColor secondary)
Sets the cursor color to use in a widget.
GTK2.Widget modify_fg(int state, GTK2.GdkColor color)
Sets the foreground color of the widget in a particular state. state is one of STATE_ACTIVE, STATE_INSENSITIVE, STATE_NORMAL, STATE_PRELIGHT and STATE_SELECTED. color can be omitted to undo the effect of a previous call.
GTK2.Widget modify_font(GTK2.Pango.FontDescription font)
Sets the font.
GTK2.Widget modify_style(GTK2.RcStyle style)
Modifies style values.
GTK2.Widget modify_text(int state, GTK2.GdkColor color)
Sets the text color of the widget in a particular state. See modify_fg().
string path()
Obtains the full path. The path is simply the name of a widget and all its parents in the container hierarchy, separated by periods.
GTK2.Widget queue_draw()
Equivalent to calling queue_draw_area() for the entire area of the widget.
GTK2.Widget queue_draw_area(int x, int y, int width, int height)
Invalidates the rectangular area defined by x,y,width,height by calling GDK2.Window->invalidate_rect() on the widget's window and all its child windows. Once the main loop becomse idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated.
GTK2.Widget queue_resize()
This function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a W(Label), GTK2.Label queues a resize to ensure there's enough space for the new text.
GTK2.Widget queue_resize_no_redraw()
This function works like queue_resize(), except that the widget is not invalidated.
int remove_accelerator(GTK2.AccelGroup accel_group, int accel_key, int accel_mods)
Removes an accelerator.
GTK2.Widget remove_mnemonic_label(GTK2.Widget label)
Removes a widget from the list of mnemonic labels for this widget.
GTK2.GdkPixbuf render_icon(string stock_id, int size, string detail)
A convenience function that uses the theme engine and rc file settings to look up stock_id and render it to a pixbuf. stock_id should be a stock icon ID such as GTK2.STOCK_OPEN or GTK2.STOCK_OK. size should be a size such as GTK2.ICON_SIZE_MENU. detail should be a string that identifies the widget or code doing the rendering, so that theme engines can special-case rendering for that widget or code.
The pixels in the returned GDK2.Pixbuf are shared with the rest of the application and should not be modified.
GTK2.Widget reparent(GTK2.Widget new_parent)
Moves a widget from one W(Container) to another.
GTK2.Widget reset_shapes()
Recursively resets the shape on this widget and its descendants.
GTK2.Widget set_accel_path(string accel_path, GTK2.AccelGroup accel_group)
Sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, this widget will be activated.
GTK2.Widget set_composite_name(string name)
Sets a widget's composite name.
GTK2.Widget set_direction(int dir)
Sets the reading direction. This direction controls the primary direction for widgets containing text, and also the direction in which the children of the container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitly visual rather than logical (such as buttons for text justification).
GTK2.Widget set_events(int events)
Sets the event mask for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget's functionality, so be careful. This function must be called while a widget is unrealized. Consider add_events() for widgets that are already realized, or if you want to preserve the existing event mask. This function can't be used with GTK2.NO_WINDOW widgets; to get events on those widgets, place them inside a GTK2.EventBox and receive events on the event box.
GTK2.Widget set_extension_events(int mode)
Sets the extension events mask to mode. One of GDK_EXTENSION_EVENTS_ALL, GDK_EXTENSION_EVENTS_CURSOR and GDK_EXTENSION_EVENTS_NONE
GTK2.Widget set_flags(int flags)
Set certain flags, such as GTK2.CAN_DEFAULT.
GTK2.Widget set_name(string name)
Widgets can be named, which allows you to refer to them from a gtkrc file. You can apply a style to widgets with a particular name in the gtkrc file.
GTK2.Widget set_no_show_all(int no_show_all)
Sets the "no-show-all" property, which determines whether calls to show_all() and hide_all() will affect this widget.
GTK2.Widget set_parent(GTK2.Widget parent)
Sets the container as the parent of this widget.
GTK2.Widget set_parent_window(GTK2.GdkWindow parent)
Sets a non default parent window for this widget.
GTK2.Widget set_scroll_adjustments(GTK2.Adjustment hadj, GTK2.Adjustment vadj)
For widgets that support scrolling, sets the scroll adjustments. For widgets that don't support scrolling, does nothing. Widgets that don't support scrolling can be scrolled by placing them in a W(Viewport), which does support scrolling.
GTK2.Widget set_sensitive(int sensitive)
Sets the sensitivity. A widget is sensitive is the user can interact with it. Insensitive widgets are "grayed out" and the user can't interact with them. Insensitive widgets are known as "inactive", "disabled", or "ghosted" in some other toolkits.
GTK2.Widget set_size_request(int width, int height)
Sets the minimum size of a widget; that is, the widget's size request will be width by height. You can use this function to force a widget to be either larger or smaller than it normally would be.
In most cases, set_default_size() is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, set_geometry_hints() can be a useful function as well.
Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct.
The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it request.
If the size request in a given direction is -1 (unset), then the "natural" size request of the widget will be used instead.
Widgets can't actually be allocated a size less than 1x1, but you can pass 0,0 to this function to mean "as small as possible".
GTK2.Widget set_style(GTK2.Style style)
Sets the style.
GTK2.Widget set_tooltip_markup(string markup)
Sets markup as the contents of the tooltip
GTK2.Widget set_tooltip_text(string text)
Sets text as the contents of the tooltip.
GTK2.Widget set_tooltip_window(GTK2.Window window)
Replaces the default, usually yellow, window used for displaying tooltips.
GTK2.Widget shape_combine_mask(GTK2.GdkBitmap shape_mask, int offset_x, int offset_y)
Sets a shape for a widget's GDK2.Window. This allows for transparent window, etc.
GTK2.Widget show()
Show the widget. Most (almost all) widgets must be shown to be visible on the screen.
GTK2.Widget show_all()
Show this widget, and all child widgets.
GTK2.Widget show_now()
Shows a widget. If the widget is an unmapped toplevel widget (i.e. a GTK2.Window that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function.
mapping size_request()
Get the size allocated to a widget.
mixed style_get_property(string name)
Gets the value of the style property called name.
GTK2.Widget thaw_child_notify()
Reverts the effect of a previous call to freeze_child_notify().
GTK2.Widget trigger_tooltip_query()
Triggers a tooltip query
GTK2.Widget unmap()
Causes this widget to be unmapped.
GTK2.Widget unset_flags(int flags)
Unset flags.
CLASS GTK2.Window |
The basic window. Nothing much to say about it. It can only contain one child widget. Show the main window last to avoid annoying flashes when the subwidget (and it's subwidgets) are added to it, this is done automatically by calling 'window->show_all' when you are done with your widget packing. Properties: int accept-focus int allow-grow int allow-shrink int decorated int default-height int default-width int deletable int destroy-with-parent int focus-on-map int gravity GDK_GRAVITY_CENTER, GDK_GRAVITY_EAST, GDK_GRAVITY_NORTH, GDK_GRAVITY_NORTH_EAST, GDK_GRAVITY_NORTH_WEST, GDK_GRAVITY_SOUTH, GDK_GRAVITY_SOUTH_EAST, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_STATIC and GDK_GRAVITY_WEST int has-toplevel-focus GDK2.Pixbuf icon string icon-name int is-active int modal float opacity int resizable string role GDK2.Screen screen int skip-pager-hint int skip-taskbar-hint string startup-id string title GTK2.Window transient-for int type WINDOW_POPUP and WINDOW_TOPLEVEL int type-hint GDK_WINDOW_TYPE_HINT_DESKTOP, GDK_WINDOW_TYPE_HINT_DIALOG, GDK_WINDOW_TYPE_HINT_DOCK, GDK_WINDOW_TYPE_HINT_MENU, GDK_WINDOW_TYPE_HINT_NORMAL, GDK_WINDOW_TYPE_HINT_SPLASHSCREEN, GDK_WINDOW_TYPE_HINT_TOOLBAR and GDK_WINDOW_TYPE_HINT_UTILITY int urgency-hint int window-position WIN_POS_CENTER, WIN_POS_CENTER_ALWAYS, WIN_POS_CENTER_ON_PARENT, WIN_POS_MOUSE and WIN_POS_NONE
Signals: activate_default
activate_focus
frame_event
keys_changed
move_focus
set_focus
int activate_default()
Activates the default widget, unless the current focused widget has been configured to receive the default action, in which case the focuses widget is activated.
int activate_focus()
Activates the current focused widget.
GTK2.Window add_accel_group(GTK2.AccelGroup group)
This function adds an accelerator group to the window. The shortcuts in the table will work in the window, it's child, and all children of it's child that do not select keyboard input.
GTK2.Window add_mnemonic(int keyval, GTK2.Widget target)
Adds a mnemonic to this window.
GTK2.Window begin_move_drag(int button, int root_x, int root_y, int timestamp)
Starts moving a window. This function is used if an application has window movement grips.
GTK2.Window begin_resize_drag(int edge, int button, int root_x, int root_y, int timestamp)
Starts resizing a window. This function is used if an application has window resizing controls. When GDK can support it, the resize will be done using the standard mechanism for the window manager or windowing system.
GTK2.Window GTK2.Window(int|mapping props)
Argument is one of WINDOW_POPUP and WINDOW_TOPLEVEL, or a mapping of allowed properties.
GTK2.Window deiconify()
Opposite of iconify().
GTK2.Window fullscreen()
Asks to place this window in the fullscreen state. Same caveats iconify().
int get_accept_focus()
Gets the value set by set_accept_focus().
int get_decorated()
Returns whether the window has been set to have decorations such as a title bar.
mapping get_default_size()
Gets the default size of the window. A value of -1 for the width or height indicates that a default size has not been explicitly set for that dimeension, so the "natural" size of the window will be used.
int get_deletable()
Returns whether the window has been set to have a close button.
int get_destroy_with_parent()
Returns whether the window will be destroyed with its transient parent.
GTK2.Widget get_focus()
Retrieves the current focused widget within the window. Note that this is the widget that would have the focus if the toplevel window focused; if the toplevel window is not focused then has_focus() will not be true for the widget.
int get_focus_on_map()
Gets the value set by set_focus_on_map().
GTK2.Window get_gravity()
Gets the value set by set_gravity().
GTK2.WindowGroup get_group()
Returns the group for this widget or the default group.
GTK2.GdkPixbuf get_icon()
Gets the value set by set_icon().
array get_icon_list()
Retrieves the list of icons set by set_icon_list().
string get_icon_name()
Returns the name of the themed icon for the window.
int get_mnemonic_modifier()
Returns the mnemonic modifier for this window.
int get_modal()
Returns whether the window is modal.
float get_opacity()
Fetches the requested opacity.
mapping get_position()
This function returns the position you need to pass to move() to keep this window in its current position. This means that the meaning of the returned value varies with window gravity.
If you haven't changed the window gravity, its gravity will be GDK2.GRAVITY_NORTH_WEST. This means that get_position() gets the position of the top-left corner of the window manager frame for the window. move() sets the position of this same top-left corner.
get_position() is not 100% reliable because X does not specify a way to obtain the geometry of the decorations placed on a window by the window manager. Thus GTK+ is using a "best guess" that works with most window managers.
Moreover, nearly all window managers are historically broken with respect to their handling of window gravity. So moving a window to its current position as returned by get_position() tends to result in moving the window slightly. Window managers are slowly getting better over time.
If a window has gravity GDK2.GRAVITY_STATIC the window manager frame is not relevant, and thus get_position() will always produc accurate results. However you can't use static gravity to do things like place a window in a corner of the screen, because static gravity ignores the window manager decorations.
If you are saving and restoring your application's window positions, you should know that it's impossible for applications to do this without getting it somewhat wrong because applications do not have sufficient knowledge of window manager state.
GTK2.Window get_resizable()
Gets the whether this window is resizable.
mapping get_size()
Obtains the current size of window.
int get_skip_pager_hint()
Gets the value set by set_skip_pager_hint().
int get_skip_taskbar_hint()
Gets the value set by set_skip_taskbar_hint().
string get_title()
Retrieves the title of the window.
GTK2.Window get_transient_for()
Fetches the transient parent for this window.
int get_type_hint()
Gets the type hint.
int get_urgency_hint()
Gets the value set by set_urgency_hint().
int has_toplevel_focus()
Returns whether the input focus is within this window. For real toplevel windows, this is identical to is_active(), but for embedded windows, like W(Plug), the results will differ.
GTK2.Window iconify()
Asks to iconify (minimize) this window. Note that you shouldn't assume the window is definitely iconified afterward, because other entities (e.g. the user or window manager) could deiconify it again, or there may not be a window manager in which case iconification isn't possible, etc.
inherit GTK2.Bin : Bin
int is_active()
Returns whether the window is part of the current active toplevel. (That is, the toplevel window receiving keystrokes.) The return value is true if the window is active toplevel itself, but also if it is, say, a W(Plug) embedded in the active toplevel. You might use this function if you wanted to draw a widget differently in an active window from a widget in an inactive window().
GTK2.Window lower()
Lower this window if the window manager allows that.
GTK2.Window maximize()
Maximize a window. Same caveats as iconify().
int mnemonic_activate(int keyval, int modifier)
Activates the targets associated with the mnemonic. modifier is one of GDK2.SHIFT_MASK, GDK2.LOCK_MASK, GDK2.CONTROL_MASK, GDK2.MOD1_MASK, GDK2.MOD2_MASK, GDK2.MOD3_MASK, GDK2.MOD4_MASK, GDK2.MOD5_MASK, GDK2.BUTTON1_MASK, GDK2.BUTTON2_MASK, GDK2.BUTTON3_MASK, GDK2.BUTTON4_MASK GDK2.BUTTON5_MASK, GDK2.RELEASE_MASK, GDK2.MODIFIER_MASK
GTK2.Window move(int x, int y)
Asks the window manage to move the window to the given position. Window managers are free to ignore this; most window managers ignore request for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown.
Note: the position is the position of the gravity-determined reference point for the window. The gravity determines two things: first, the location of the reference point in root window coordinates; and second, which point on the window is position at the reference point.
By default the gravity is GDK2.GRAVITY_NORTH_WEST, so the reference point is simply the x,y supplied to move(). The top-left corner of the window decorations (aka window frame or border) will be place at x,y. Therefore, to position a window at the top left of the screen, you want to use the default gravity (which is GDK2.GRAVITY_NORTH_WEST) and move the window to 0,0.
To position a window at the bottom right corner of the screen, you would set GDK2.GRAVITY_SOUTH_EAST, which means that the reference point is at x + the window width and y + the window height, and the bottom-right corner of the window border will be placed at that reference point.
int parse_geometry(string geometry)
Parses a standard X geometry string.
GTK2.Window present()
Presents this window to the user. This may mean raising the window in the stacking order, deiconifying it, moving it to the current desktop, and/or giving it the keyboard focus, possibly dependent on the user's platform, window manager, and preferences.
If hidden, it calls show() as well.
GTK2.Window present_with_time(int timestamp)
Presents a window to the user with a timestamp. See present().
GTK2.Window raise()
Raise this window if the window manager allows that.
GTK2.Window remove_accel_group(GTK2.AccelGroup group)
Reverses the effects of add_accel_group().
GTK2.Window remove_mnemonic(int keyval, GTK2.Widget target)
Removes a mnemonic from this window.
GTK2.Window reshow_with_initial_size()
Hides the window, then reshows it, resetting the default size and position of the window.
GTK2.Window resize(int width, int height)
Resizes the window as if the user had done so, obeying geometry constraints.
GTK2.Window set_accept_focus(int setting)
Windows may set a hint asking the desktop environment not to receive the input focus.
GTK2.Window set_decorated(int setting)
Add title bar, resize controls, etc. Default is true, so you may only need to use this function if you want to remove decorations. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling show().
GTK2.Window set_default(GTK2.Widget child)
The default widget is the widget that's activated when the user presses Enter in a dialog (for example). This function sets or unsets the default widget. When setting (rather than unsetting) the default widget it's generally easier to call GTK2.Widget->grab_focus() on the widget.
GTK2.Window set_default_size(int width, int height)
Sets the default size of a window. If the window's "natural" size (its size request) is larger than the default, the default will be ignored. more generally, if the default size does not obey the geometry hints for the window (set_geometry_hints() can be used to set these explicitly), the default size will be clamped to the nearest permitted size.
Unlike set_size_request(), which sets a size request for a widget and thus would keep users from shrinking the window, this function only sets the initial size, just as if the user had resized the window themselves. Users can still shrink the window again as they normally would. Setting a default size of -1 means to use the "natural" default size (the size request of the window).
For more control over a window's initial size and how resizing works, investigate set_geometry_hints().
For some uses, resize() is a more appropriate function. resize() changes the current size of the window, rather than the size to be used on initial display. resize() always affects the window itself, not the geometry widget.
The default size of a window only affects the first time a window is shown; if a window is hidden and re-shown, it will remember the size it had prior to hiding, rather than using the default size.
Window scan't actually be 0x0 in size, they must be at least 1x1, but passing 0 for width and height is OK, resulting in a 1x1 default size.
GTK2.Window set_deletable(int setting)
By default, windows have a close button in the window frame. Some window managers allow GTK+ to disable this button. If you set the deletable property to FALSE using this function, GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling show().
On Windows, this function always works, since there's no window manager policy involved.
GTK2.Window set_destroy_with_parent(int setting)
If setting is true, then destroying the transient parent of this window will also destroy the window itself. This is useful for dialogs that shouldn't persist beyond the lifetime of the main window they're associated with, for example.
GTK2.Window set_focus(GTK2.Widget child)
If child is not the current focus widget, and is focusable, sets it as the focus widget for the window. If child is 0, unsets the focus widget for this window. To set the focus to a particular widget in the toplevel, it is usually more convenient to use GTK2.Widget->grab_focus() instead of this function.
GTK2.Window set_focus_on_map(int setting)
Windows may set a hint asking the desktop environment not to receive the input focus when the window is mapped.
GTK2.Window set_geometry_hints(GTK2.Widget widget, mapping geometry)
This function sets up hints about how a window can be resized by the user. You can set a minimum and maximum size; allowed resized increments (e.g. for xterm, you can only resize by the size of a character); aspect ratios; and more. geometry is a mapping with the following fields. Any field which is omitted is left as the default: ([ "min_width": int, "min_height": int, "max_width": int, "max_height": int, "base_width": int, "base_height": int, "width_inc": int, "height_inc": int, "min_aspect": float, "max_aspect": float, "win_gravity": int, GDK_GRAVITY_CENTER, GDK_GRAVITY_EAST, GDK_GRAVITY_NORTH, GDK_GRAVITY_NORTH_EAST, GDK_GRAVITY_NORTH_WEST, GDK_GRAVITY_SOUTH, GDK_GRAVITY_SOUTH_EAST, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_STATIC and GDK_GRAVITY_WEST ]); min_width/min_height/max_width/max_height may be set to -1, and it will substitute the size request of the window or geometry widget. If the minimum size hint is not provided, it will use its requisition as the minimum size. If the minimum size is provided and a geometry widget is set, it will take the minimum size as the minimum size of the geometry widget rather than the entire window. The base size is treat similarly. min_width: minimum width of the window (-1 to use requisition) min_height: minimum height of window (-1 to use requisition) max_width: maximum width of window (-1 to use requisition) max_height: maximum height of window (-1 to use requisition) base_width: allow window widths are base_width+width_inc*N (-1 allowed) base_height: allowed window widths are base_height+height_inc*N (-1 allowed) width_inc: width resize increment height_inc: height resize increment min_aspect: minimum width/height ratio max_aspect: maximum width/height ratio win_gravity: window gravity
GTK2.Window set_gravity(int gravity)
Window gravity defines the meaning of coordinates passed to move().
The default window gravity is GDK2.GRAVITY_NORTH_WEST, which will typically "do what you mean."
GTK2.Window set_icon(GTK2.GdkPixbuf icon)
Sets up the icon representing this window. This icon is used when the window is minimized (also know as iconified). Some window managers or desktop environments may also place it in the window frame, or display it in other contexts.
The icon should be provided in whatever size it was naturally drawn; that is, don't scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
If you have your icon hand-drawn in multiple sizes, use set_icon_list(). Then the best size will be used.
int set_icon_from_file(string filename)
Sets the icon from a file.
GTK2.Window set_icon_list(array list)
Set up the icons for minimizing.
set_icon_list() allows you to pass in the same icon in several hand-drawn sizes. The list should contain the natural sizes your icon is avilable in; that is, don't scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
By passing several sizes, you may improve the final image quality of the icon, by reducing or eliminating automatic image scaling.
Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and larger images (64x64, 128x128) if you have them.
GTK2.Window set_icon_name(string name)
Sets the icon for the window from a named themed icon.
GTK2.Window set_keep_above(int setting)
Keep window above.
GTK2.Window set_keep_below(int setting)
Keep window below.
GTK2.Window set_mnemonic_modifier(int modifier)
Sets the mnemonic modifer for this window.
GTK2.Window set_modal(int setting)
Sets a window modal or non-modal. Modal windows prevent interaction with other windows in the same application. To keep modal dialogs on top of main application windows, use set_transient_for() to make the dialog transient for the parent; most window managers will then disallow lowering the dialog below the parent.
GTK2.Window set_opacity(float opacity)
Request the windowing system to make this window partially transparent, with opacity 0 being full transparent and 1 fully opaque.
GTK2.Window set_position(int pos)
Sets a position contraint for this window. If the old or new constraint is GTK2.WIN_POS_CENTER_ALWAYS, this will also cause the window to be repositioned to satisfy the new constraint.
GTK2.Window set_resizable(int setting)
Sets whether the user can resize a window. Windows are user resizable by default.
GTK2.Window set_skip_pager_hint(int setting)
Windows may set a hint asking the desktop environment not to display the window in the pager.
GTK2.Window set_skip_taskbar_hint(int setting)
Windows may set a hint asking the desktop environment not to display the window in the task bar. This function sets this hint.
GTK2.Window set_startup_id(string id)
Startup notification identifiers are used by desktop environment to track application startup, to provide user feedback and other features. This function changes the corresponding property on the underlying GDK2.Window. Normally, startup identifier is managed automatically and you should only use this function in special cases like transferring focus from other processes. You should use this function before calling window->present() or any equivalent function generating a window map event.
GTK2.Window set_title(string title)
Set the window title. The default title is the value sent to setup_gtk, or if none is sent, Pike GTK.
GTK2.Window set_transient_for(GTK2.Window parent)
Dialog window should be set transient for the main application window they were spawned from. This allows window managers to e.g. keep the dialog on top of the main window, or center the dialog over the main window. W(Dialog) and other convenience objects in GTK+ will sometimes call set_transient_for on your behalf.
GTK2.Window set_type_hint(int hint)
Set type of window. Values are GDK_WINDOW_TYPE_HINT_DESKTOP, GDK_WINDOW_TYPE_HINT_DIALOG, GDK_WINDOW_TYPE_HINT_DOCK, GDK_WINDOW_TYPE_HINT_MENU, GDK_WINDOW_TYPE_HINT_NORMAL, GDK_WINDOW_TYPE_HINT_SPLASHSCREEN, GDK_WINDOW_TYPE_HINT_TOOLBAR and GDK_WINDOW_TYPE_HINT_UTILITY
GTK2.Window set_urgency_hint(int setting)
Windows may set a hint asking the desktop environment to draw the users attention to the window. This function sets this hint.
GTK2.Window set_wmclass(string name, string class)
Set the window manager application name and class.
GTK2.Window stick()
Makes this window sticky. Same caveats as iconify().
GTK2.Window unfullscreen()
Opposite of fullscreen().
GTK2.Window unmaximize()
Opposite of maximize().
GTK2.Window unstick()
Opposite of stick().
CLASS GTK2.WindowGroup |
Limit the effect of grabs.
GTK2.WindowGroup add_window(GTK2.Window window)
Add a window.
GTK2.WindowGroup GTK2.WindowGroup()
Creates a new GTK2.WindowGroup object. Grabs added with GTK2.grab_add() only affect windows with the same GTK2.WindowGroup.
inherit G.Object : Object
GTK2.WindowGroup remove_window(GTK2.Window window)
Remove a window.
Module GTK2.G |
CLASS GTK2.G.InitiallyUnowned |
Abstract class - do not instantiate
inherit G.Object : Object
CLASS GTK2.G.Object |
The base object. All GDK and GTK classes inherit from this. The Pango classes also inherit from this class.
Signals: notify
G.Object accel_groups_activate(int accel_key, int accel_mods)
Finds the first accelerator in an GTK.AccelGroup attached to this object that matches accel_key and accel_mods, and activates that accelerator.
G.Object destroy()
Destroy this object. This is the normal way to (eg) close a window.
object get_data(string name)
Gets a named field from the object.
string get_docs()
Get documentation on object
mixed get_property(string property)
Get a property.
int is_floating()
Checks whether this object has a floating reference.
int new_signal(string name, array types, string return_type)
Create a new signal.
G.Object notify(string property)
Emits a "notify" signal for the named property on the object.
object set_data(string name, mixed arg)
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
If the object already had an association with that name, the old association will be destroyed.
G.Object set_property(string property, mixed value)
Set a property on a G.Object (and any derived types) to value.
G.Object signal_block(int signal_id)
Temporarily block a signal handler. No signals will be received while the handler is blocked. See signal_connect() for more info.
int signal_connect(string signal, function(:void) callback, mixed|void callback_arg, string|void detail, int|void connect_before)
Connect a signal to a pike function. The function will be called with the last argument to this function as its last argument (defaults to 0); the first argument is always the widget, and any other arguments are the ones supplied by GTK. If connect_before is nonzero, the callback will be called prior to the normal handling of the signal (and can return true to suppress that handling), otherwise it will be called after.
The return value of this function can be used to remove a signal with signal_disconnect(), and block and unblock the signal with signal_block() and signal_unblock().
G.Object signal_disconnect(int signal_id)
Remove a signal formerly added by signal_connect. The argument is the return value of signal_connect(). See signal_connect() for more info.
G.Object signal_emit(string signal_name, string|void detail)
Send the current named signal.
G.Object signal_stop(string signal_name)
Stop the emission of a signal.
G.Object signal_unblock(int signal_id)
Unblock a formerly blocked signal handler. See signal_block() and signal_connect() for more info.
Module GTK2.Pango |
CLASS GTK2.Pango.AttrList |
A PangoAttrList.
GTK2.Pango.AttrList copy()
Copy the list.
GTK2.Pango.AttrList GTK2.Pango.AttrList()
Create a new empty attribute list.
CLASS GTK2.Pango.Context |
PangoContext.
inherit G.Object : Object
CLASS GTK2.Pango.FontDescription |
Pango Font Description.
int better_match(GTK2.Pango.FontDescription new, GTK2.Pango.FontDescription old)
Determines if the style attributes of new are a closer match than old, or if old is omitted, determines if new is a match at all. Approximate matching is done for weight and style; other attributes must match exactly.
GTK2.Pango.FontDescription copy()
Copy a font description.
GTK2.Pango.FontDescription GTK2.Pango.FontDescription(string|void desc)
Create a new font description. If desc is present, creates a new font description from a string representation in the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE-OPTIONS is a whitespace separated list of words where each word describes one of style, variant, weight, or stretch, and size is a decimal number (size in points). Any one of the options may be absent. If FAMILY-LIST is absent, then the family name will be blank. If STYLE-OPTIONS is missing, then all style options will be set to the default values. If SIZE is missing, the size in the resulting font description will be set to 0.
int equal(GTK2.Pango.FontDescription desc)
Compares two font descriptions for equality.
string get_family()
Gets the family name.
int get_size()
Gets the size.
int get_stretch()
Get the stretch.
int get_style()
Gets the style.
int get_variant()
Gets the variant.
int get_weight()
Gets the weight.
Pango.FontDescription merge(GTK2.Pango.FontDescription desc, int replace)
Merges the fields that are set int desc to the fields in this description. If replace is false, only fields in this description that are not already set are affected. If true, then fields that are already set will be replaced as well.
Pango.FontDescription set_family(string family)
Sets the family name. The family name represents a family of related fonts styles, and will resolve to a particular PangoFontFamily.
Pango.FontDescription set_size(int size)
Sets the size in fractional points. This is the size of the font in points, scaled by PANGO_SCALE. (That is, a size value of 10*PANGO_SCALE) is a 10 point font. The conversion factor between points and device units depends on system configuration and the output device. For screen display, a logical DPI of 96 is common, in which case a 10 point font corresponds to a 1o*(96.72) = 13.3 pixel font. Use set_absolute_size() if you need a particular size in device units.
Pango.FontDescription set_stretch(int stretch)
Sets the stretch. This specifies how narrow or wide the font should be. One of PANGO_STRETCH_CONDENSED, PANGO_STRETCH_EXPANDED, PANGO_STRETCH_EXTRA_CONDENSED, PANGO_STRETCH_EXTRA_EXPANDED, PANGO_STRETCH_NORMAL, PANGO_STRETCH_SEMI_CONDENSED, PANGO_STRETCH_SEMI_EXPANDED, PANGO_STRETCH_ULTRA_CONDENSED and PANGO_STRETCH_ULTRA_EXPANDED.
Pango.FontDescription set_style(int style)
Sets the style. This describes whether the font is slanted and the manner in which is is slanted. One of PANGO_STYLE_ITALIC, PANGO_STYLE_NORMAL and PANGO_STYLE_OBLIQUE. Most fonts will either have an italic style or an oblique style, but not both, and font matching in Pango will match italic specifications with oblique fonts and vice-versa if an exact match is not found.
Pango.FontDescription set_variant(int variant)
Sets the variant. One of PANGO_VARIANT_NORMAL and PANGO_VARIANT_SMALL_CAPS.
Pango.FontDescription set_weight(int weight)
Sets the weight. The weight specifies how bold or light the font should be. In addition to the values of PANGO_WEIGHT_BOLD, PANGO_WEIGHT_HEAVY, PANGO_WEIGHT_LIGHT, PANGO_WEIGHT_NORMAL, PANGO_WEIGHT_ULTRABOLD and PANGO_WEIGHT_ULTRALIGHT, other intermediate numeric values are possible.
string to_filename()
Creates a filename representation. The filename is identical to the result from calling to_string(), but with underscores instead of characters that are untypical in filenames, and in lower case only.
string to_string()
Creates a string representation. The family list in the string description will only have a terminating comm if the last word of the list is a valid style option.
CLASS GTK2.Pango.Layout |
Pango Layout.
Pango.Layout context_changed()
Forces recomputation of any state in the layout that might depend on the layout's context. This function should be called if you make changes to the context subsequent to creating the layout.
GTK2.Pango.Layout copy(GTK2.Pango.Layout src)
Does a copy of the src.
GTK2.Pango.Layout GTK2.Pango.Layout(GTK2.Pango.Context context)
Create a new layout with attributes initialized to default values for a particular Pango.Context
int get_alignment()
Gets the alignment.
int get_auto_dir()
Gets whether to calculate the bidirectional base direction for the layout according to the contents of the layout.
GTK2.Pango.Context get_context()
Returns the Pango.Context.
array get_cursor_pos(int index)
Given an index within a layout, determines the positions of the strong and weak cursors if the insertion point is at that index. The position of each cursor is stored as a zero-width rectangle. The strong cursor is the location where characters of the directionality equal to the base direction of the layout are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction of the layout are inserted. Returns: array of mappings, each mapping is the same as index_to_pos().
int get_indent()
Gets the paragraph indent in pango units. A negative value indicates a hanging indent.
int get_justify()
Gets whether or not each complete line should be stretched to fill the entire width of the layout.
GTK2.Pango.LayoutLine get_line(int line)
Retrieves a specific line.
int get_line_count()
Retrieves the count of lines.
int get_single_paragraph_mode()
Gets the value set by set_single_paragraph_mode().
mapping get_size()
Determines the logical width and height in Pango units.
int get_spacing()
Gets the amount of spacing between the lines.
GTK2.Pango.TabArray get_tabs()
Gets the current W(TabArray) used by this layout. If no W(TabArray) has been set, then the default tabs are in use and 0 is returned. Default tabs are every 8 spaces.
string get_text()
Gets the text.
int get_width()
Gets the line wrap width.
int get_wrap()
Gets the wrap mode for the layout.
mapping index_to_pos(int index)
Converts from an index to the onscreen position corresponding to the grapheme at that index, which is represented as a rectangle. Note that x is always the leading edge of the grapheme and x+width the trailing edge of the grapheme. If the direction of the grapheme is right-to-left, then width will be negative.
Returns: ([ "x": x coordinate, "y": y coordinate, "width": width of the rectangle, "height": height of the rectangle ])
inherit G.Object : Object
mapping move_cursor_visually(int strong, int old_index, int old_trailing, int dir)
Computes a new cursor position from an old position and a count of positions to move visually. If count is positive, then the new strong cursor position will be one position to the right of the old cursor position. If count is negative, then the new strong cursor position will be one position to the left of the old cursor position.
In the presence of bidirectional text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off the end of a run.
Motion here is in cursor positions, not in characters, so a single call to move_cursor_visually() may move the cursor over multiple characters when multiple characters combine to form a single grapheme.
Pango.Layout set_alignment(int alignment)
Sets the alignment for the layout (how partial lines are positioned within the horizontal space available.) One of PANGO_ALIGN_CENTER, PANGO_ALIGN_LEFT and PANGO_ALIGN_RIGHT.
Pango.Layout set_auto_dir(int auto_dir)
Sets whether to calculate the bidirectional base direction for the layout according to the contents of the layout; when this flag is on (the default), then paragraphs that begin with strong right-to-left characters (Arabic and Hebrew principally), will have right-left-layout, paragraphs with letters from other scripts will have left-to-right layout. Paragraphs with only neutral characters get their direction from the surrounding paragraphs.
When false, the choice between left-to-right and right-to-left layout is done by according to the base direction of the Pango.Context.
Pango.Layout set_font_description(GTK2.Pango.FontDescription desc)
Sets the default font description for the layout. If no font description is set on the layout, the font descriptions from the layout's context is used.
Pango.Layout set_indent(int indent)
Sets the width in pango units to indent each paragraph. A negative value of indent will produce a hanging indent. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent.
Pango.Layout set_justify(int justify)
Sets whether or not each complete line should be stretched to fill the entire width of the layout. This stretching is typically done by adding whitespace, but for some scripts (such as Arabic), the justification is done by extending the characters.
Pango.Layout set_markup(string markup, int length)
Same as set_markup_with_accel(), but the markup text isn't scanned for accelerators.
Pango.Layout set_markup_with_accel(string markup, int length, int|void accel_marker)
Sets the layout text and attribute from marked-up text. Replaces the current text and attribute list.
If accel_marker is nonzero, the given character will mark the character following it as an accelerator. For example, the accel marker might be an ampersand or underscore. All characters marked as an acclerator will receive a GTK2.PANGO_UNDERLINE_LOW attribute, and the first character so marked will be returned. Two accel_marker characters following each other produce a single literal accel_marker character.
Pango.Layout set_single_paragraph_mode(int setting)
If setting is true, do not treat newlines and similar characters as paragraph separators; instead, keep all text in a single paragraph, and display a glyph for paragraph separator characters. Used when you want to allow editing of newlines on a single text line.
Pango.Layout set_spacing(int spacing)
Sets the amount of spacing between the lines.
Pango.Layout set_tabs(GTK2.Pango.TabArray tabs)
Sets the tabs to use, overriding the default tabs (by default, tabs are every 8 spaces). If tabs is omitted, the default tabs are reinstated.
Pango.Layout set_text(sprintf_format text, sprintf_args ... fmt)
Sets the text of the layout.
Pango.Layout set_width(int width)
Sets the width to which the lines should be wrapped.
Pango.Layout set_wrap(int wrap)
Sets the wrap mode; the wrap mode only has an effect if a width is set on the layout with set_width(). To turn off wrapping, set the width to -1. One of PANGO_WRAP_CHAR, PANGO_WRAP_WORD and PANGO_WRAP_WORD_CHAR.
mapping xy_to_index(int x, int y)
Converts from x and y position within a layout to the byte index to the character at that logical position. If the y position is not inside the layout, the closest position is chosen (the position will be clamped inside the layout). If the X position is not within the layout, then the start or the end of the line is chosen as describe for x_to_index(). If either the x or y positions were not inside the layout, then returns 0.
Returns: ([ "index": byte index, "trailing": where in grapheme user clicked ]).
CLASS GTK2.Pango.LayoutIter |
PangoLayoutIter.
int at_last_line()
Determines whether this iter is on the last line of the layout.
int get_baseline()
Gets the y position of the current line's baseline, in layout coordinates (origin at top left of the entire layout).
mapping get_char_extents()
Gets the extents of the current character, in layout coordinates (origin is the top left of the entire layout).
array get_cluster_extents()
Gets the extents of the current cluster, in layout coordinates.
int get_index()
Gets the current byte index. Note that iterating forward by char moves in visual order, not logical order, so indexes may not be sequential. Also, the index may be equal to the length of the text in the layout.
array get_layout_extents()
Obtains the extents of the layout.
GTK2.Pango.LayoutLine get_line()
Gets the current line.
array get_line_extents()
Obtains the extents of the current line.
array get_line_yrange()
Divides the vertical space being iterated over between the lines in the layout, and returns the space belonging to the current line. A line's range includes the line's logical extents, plus half of the spacing above and below the line, if Pango.Layout->set_spacing() has been called to set layout spacing. The y positions are in layout coordinates.
array get_run_extents()
Gets the extents of the current run in layout coordinates.
int next_char()
Moves forward to the next character in visual order. If it was already at the end of the layout, returns false.
int next_cluster()
Moves forward to the next cluster in visual order. If it was already at the end of the layout, returns false.
int next_line()
Moves forward to the start of the next line. If it is already on the last line, returns false.
int next_run()
Moves forward to the next run in visual order. If it was already at the end of the layout, returns false.
CLASS GTK2.Pango.LayoutLine |
PangoLayoutLine.
array get_extents()
Computes the logical and ink extents of a layout line.
array get_pixel_extents()
Computes the logical and ink extents of a layout line, in device units.
int index_to_x(int index, int trailing)
Converts an index within a line to an x position.
mapping x_to_index(int x_pos)
Converts from x offset to the byte index of the corresponding character within the text of the layout. If x_pos is outside the line, index and trailing will point to the very first or very last position in the line. This determination is based on the resolved direction of the paragraph; for example, if the resolved direction is right-to-left, then an X position to the right of the line (after it) results in 0 being stored in index and trailing. An X position to the left of the line results in index pointing to the (logical) last grapheme in the line and trailing set to the number of characters in that grapheme. The reverse is true for a left-to-right line.
CLASS GTK2.Pango.TabArray |
A set of tab stops for laying out text that includes tab characters.
GTK2.Pango.TabArray copy()
Returns a copy.
GTK2.Pango.TabArray GTK2.Pango.TabArray(int initial_size, int position_in_pixels)
Creates an array of initial_size tab stops. Tab stops are specified in pixel units if positions_in_pixels is true, otherwise in Pango units. All stops are initially at position 0.
int get_positions_in_pixels()
Returns true if the tab positions are in pixels, false if they are in Pango units.
int get_size()
Gets the number of tab stops.
mapping get_tab(int tab_index)
Gets the alignment and position of a tab stop.
array get_tabs()
Gets alignments and locations of all tab stops.
inherit G.Object : Object
Pango.TabArray resize(int new_size)
Resizes the array. You must subsequently initialize any tabs that were added as a result of growing the array.
Pango.TabArray set_tab(int tab_index, int alignment, int location)
Sets the alignment and location of a tab stop. Alignment must always be PANGO_TAB_LEFT.