Class Widget
- Direct Known Subclasses:
Caret, Control, DragSource, DropTarget, IME, Item, Menu, ScrollBar, TaskBar, ToolTip, Tracker, Tray
- Styles:
- (none)
- Events:
- Dispose
IMPORTANT: This class is intended to be subclassed only within the SWT implementation. However, it has not been marked final to allow those outside of the SWT development team to implement patched versions of the class in order to get around specific limitations in advance of when those limitations can be addressed by the team. Any class built using subclassing to access the internals of this class will likely fail to compile or run between releases and may be strongly platform specific. Subclassing should not be attempted without an intimate and detailed understanding of the workings of the hierarchy. No support is provided for user-written classes which are implemented as subclasses of this class.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) Object(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) Display(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) EventTable(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static Callback(package private) static final int(package private) static final int(package private) static final intlongthe handle to the OS resource (Warning: This field is platform dependent)(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final String(package private) static final String(package private) static final String(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) int(package private) static final int(package private) int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void_addListener(int eventType, Listener listener) voidaddDisposeListener(DisposeListener listener) Adds the listener to the collection of listeners who will be notified when the widget is disposed.voidaddListener(int eventType, Listener listener) Adds the listener to the collection oflistenerswho will be notified when an event of the given type occurs.protected voidaddTypedListener(EventListener listener, int... eventTypes) Adds thetyped listenerto the collection of listeners who will be notified when an event of the given types occurs.(package private) longcellDataProc(long tree_column, long cell, long tree_model, long iter, long data) (package private) static intcheckBits(int style, int int0, int int1, int int2, int int3, int int4, int int5) (package private) void(package private) voidcheckOrientation(Widget parent) (package private) voidcheckParent(Widget parent) Throws an exception if the specified widget can not be used as a parent for the receiver.protected voidChecks that this class can be subclassed.protected voidThrows anSWTExceptionif the receiver can not be accessed by the caller.(package private) StringconvertPangoFontDescriptionToCss(long fontDescription) (package private) voidcreateHandle(int index) (package private) voidcreateWidget(int index) (package private) long(package private) void(package private) voidvoiddispose()Disposes of the operating system resources associated with the receiver and all its descendants.(package private) longdpiChanged(long object, long arg0) (package private) voidenterMotionProc(long controller, double x, double y, long user_data) (package private) voiderror(int code) (package private) longfilterProc(long xEvent, long gdkEvent, long data2) (package private) booleanfilters(int eventType) (package private) char[]fixMnemonic(String string) (package private) char[]fixMnemonic(String string, boolean replace) (package private) char[]fixMnemonic(String string, boolean replace, boolean removeAppended) (package private) voidfocusProc(long controller, long user_data) (package private) intfontHeight(long font, long widgetHandle) (package private) voidgdk_event_free(long event) GTK4 does not hand out copies of events anymore, only references.(package private) intgdk_event_get_state(long event) Wrapper function for gdk_event_get_state()(package private) longgdk_event_get_surface_or_window(long event) Wrapper function for gdk_event_get_surface() on GTK4, and gdk_event_get_window() on GTK3.(package private) intgdk_pointer_grab(long gdkResource, int grab_ownership, boolean owner_events, int event_mask, long confine_to, long cursor, int time_) (package private) voidgdk_pointer_ungrab(long gdkResource, int time_) (package private) voidgdk_surface_get_size(long surface, int[] width, int[] height) (package private) voidgdk_window_get_size(long drawable, int[] width, int[] height) (package private) static longGdkSeatGrabPrepareFunc(long gdkSeat, long gdkResource, long userData_gdkResource) (package private) voidgesturePressReleaseProc(long gesture, int n_press, double x, double y, long user_data) getData()Returns the application defined widget data associated with the receiver, or null if it has not been set.Returns the application defined property of the receiver with the specified name, or null if it has not been set.Returns theDisplaythat is associated with the receiver.Listener[]getListeners(int eventType) Returns an array oflistenerswho will be notified when an event of the given type occurs.(package private) StringgetName()(package private) StringintgetStyle()Returns the receiver's style information.<L extends EventListener>
Stream<L> getTypedListeners(int eventType, Class<L> listenerType) Returns the typed listeners who will be notified when an event of the given type occurs.(package private) longgtk_activate(long widget) (package private) voidgtk_adjustment_get(long adjustmentHandle, GtkAdjustment adjustment) (package private) longgtk_box_new(int orientation, boolean homogeneous, int spacing) (package private) voidgtk_box_pack_end(long box, long child, boolean expand, boolean fill, int padding) (package private) voidgtk_box_set_child_packing(long box, long child, boolean expand, boolean fill, int padding, int pack_type) (package private) longgtk_button_press_event(long widget, long event) (package private) longgtk_button_release_event(long widget, long event) (package private) voidgtk_cell_renderer_get_preferred_size(long cell, long widget, int[] width, int[] height) (package private) booleangtk_change_value(long widget, int scroll, double value, long user_data) (package private) longgtk_changed(long widget) (package private) longgtk_clicked(long widget) (package private) longgtk_close_request(long widget) (package private) longgtk_commit(long imcontext, long text) (package private) longgtk_configure_event(long widget, long event) (package private) intgtk_container_get_border_width_or_margin(long handle) Retrieves the amount of space around the outside of the container.(package private) voidgtk_container_set_border_width(long handle, int border_width) Sets the border width of the container to all sides of the container.(package private) longgtk_create_menu_proxy(long widget) (package private) longgtk_day_selected(long widget) (package private) longgtk_day_selected_double_click(long widget) (package private) longgtk_delete_event(long widget, long event) (package private) longgtk_delete_range(long widget, long iter1, long iter2) (package private) longgtk_delete_text(long widget, long start_pos, long end_pos) (package private) longgtk_draw(long widget, long cairo) (package private) longgtk_enter_notify_event(long widget, long event) (package private) longgtk_expand_collapse_cursor_row(long widget, long logical, long expand, long open_all) (package private) longgtk_focus(long widget, long event) (package private) longgtk_focus_in_event(long widget, long event) (package private) longgtk_focus_out_event(long widget, long event) (package private) intgtk_gesture_press_event(long gesture, int n_press, double x, double y, long event) (package private) intgtk_gesture_release_event(long gesture, int n_press, double x, double y, long event) (package private) longgtk_grab_focus(long widget) (package private) longgtk_hide(long widget) (package private) longgtk_icon_release(long widget, long icon_pos, long event) (package private) longgtk_input(long widget, long arg1) (package private) longgtk_insert_text(long widget, long new_text, long new_text_length, long position) (package private) longgtk_leave_notify_event(long widget, long event) (package private) longgtk_map(long widget) (package private) longgtk_map_event(long widget, long event) (package private) longgtk_menu_popped_up(long widget, long flipped_rect, long final_rect, long flipped_x, long flipped_y) GTK3.22+ has API which allows clients of GTK to connect a menu to the "popped-up" signal.(package private) longgtk_mnemonic_activate(long widget, long arg1) (package private) longgtk_month_changed(long widget) (package private) longgtk_motion_notify_event(long widget, long event) (package private) longgtk_move_focus(long widget, long event) (package private) longgtk_output(long widget) (package private) longgtk_populate_popup(long widget, long menu) (package private) longgtk_preedit_changed(long imcontext) (package private) longgtk_realize(long widget) (package private) longgtk_row_activated(long tree, long path, long column) (package private) longgtk_row_has_child_toggled(long model, long path, long iter) (package private) longgtk_scroll_child(long widget, long scrollType, long horizontal) (package private) longgtk_scroll_event(long widget, long event) (package private) longgtk_select(long item) (package private) longgtk_selection_done(long menushell) (package private) longgtk_show(long widget) (package private) longgtk_size_allocate(long widget, long allocation) (package private) longgtk_start_interactive_search(long widget) (package private) longgtk_status_icon_popup_menu(long handle, long button, long activate_time) (package private) longgtk_style_updated(long widget) (package private) longgtk_switch_page(long notebook, long page, int page_num) (package private) longgtk_test_collapse_row(long tree, long iter, long path) (package private) longgtk_test_expand_row(long tree, long iter, long path) (package private) longgtk_text_buffer_insert_text(long widget, long iter, long text, long length) (package private) long(package private) longgtk_toggled(long renderer, long pathStr) (package private) booleangtk_tree_view_column_cell_get_position(long column, long cell_renderer, int[] start_pos, int[] width) (package private) longgtk_unmap(long widget) (package private) longgtk_unmap_event(long widget, long event) (package private) longgtk_unrealize(long widget) (package private) longgtk_value_changed(long range) (package private) voidgtk_widget_get_preferred_size(long widget, GtkRequisition requisition) (package private) longgtk_widget_get_surface(long widget) (package private) longgtk_widget_get_window(long widget) (package private) voidgtk_widget_hide(long widget) (package private) voidgtk_widget_show(long widget) (package private) voidgtk_widget_size_allocate(long widget, GtkAllocation allocation, int baseline) (package private) longgtk_window_state_event(long widget, long event) (package private) longgtk3_event_after(long widget, long event) (package private) longgtk3_key_press_event(long widget, long event) (package private) longgtk3_key_release_event(long widget, long event) (package private) longgtk3_popup_menu(long widget) (package private) longgtk3_show_help(long widget, long helpType) (package private) void(package private) voidgtk4_enter_event(long controller, double x, double y, long event) (package private) voidgtk4_focus_enter_event(long controller, long event) (package private) voidgtk4_focus_leave_event(long controller, long event) (package private) voidgtk4_focus_window_event(long handle, long event) (package private) booleangtk4_key_press_event(long controller, int keyval, int keycode, int state, long event) (package private) voidgtk4_key_release_event(long controller, int keyval, int keycode, int state, long event) (package private) voidgtk4_leave_event(long controller, long event) (package private) voidgtk4_motion_event(long controller, double x, double y, long event) (package private) booleangtk4_scroll_event(long controller, double dx, double dy, long event) (package private) void(package private) booleanhooks(int eventType) (package private) longhoverProc(long widget) (package private) booleanisActive()booleanReturnstrueif the widget has auto text direction, andfalseotherwise.booleanReturnstrueif the widget has been disposed, andfalseotherwise.booleanisListening(int eventType) Returnstrueif there are any listeners for the specified event type associated with the receiver, andfalseotherwise.(package private) boolean(package private) boolean(package private) booleankeyPressReleaseProc(long controller, int keyval, int keycode, int state, long user_data) (package private) voidleaveProc(long controller, long handle, long user_data) (package private) booleanmnemonicHit(long mnemonicHandle, char key) (package private) booleanmnemonicMatch(long mnemonicHandle, char key) (package private) void(package private) voidvoidnotifyListeners(int eventType, Event event) Notifies all of the receiver's listeners for events of the given type that one such event has occurred by invoking theirhandleEvent()method.(package private) longnotifyProc(long object, long arg0, long user_data) (package private) longnotifyState(long object, long argo0) (package private) long(package private) long(package private) voidpostEvent(int eventType) (package private) void(package private) voidregister()(package private) voidrelease(boolean destroy) (package private) voidreleaseChildren(boolean destroy) (package private) void(package private) void(package private) voidvoidremoveDisposeListener(DisposeListener listener) Removes the listener from the collection of listeners who will be notified when the widget is disposed.protected voidremoveListener(int eventType, EventListener listener) Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.protected voidremoveListener(int eventType, SWTEventListener listener) Deprecated, for removal: This API element is subject to removal in a future version.voidremoveListener(int eventType, Listener listener) Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.protected voidremoveTypedListener(int eventType, EventListener listener) Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.(package private) longrendererGetPreferredWidthProc(long cell, long handle, long minimun_size, long natural_size) (package private) longrendererRenderProc(long cell, long cr, long handle, long background_area, long cell_area, long flags) (package private) longrendererSnapshotProc(long cell, long snapshot, long handle, long background_area, long cell_area, long flags) voidreskin(int flags) Marks the widget to be skinned.(package private) voidreskinChildren(int flags) (package private) void(package private) booleanscrollProc(long controller, double dx, double dy, long user_data) (package private) voidsendEvent(int eventType) (package private) void(package private) void(package private) void(package private) char[]sendIMKeyEvent(int type, long event, char[] chars) (package private) booleansendKeyEvent(int type, long event) (package private) voidsendSelectionEvent(int eventType) (package private) voidsendSelectionEvent(int eventType, Event event, boolean send) (package private) voidsetButtonState(Event event, int eventButton) voidSets the application defined widget data associated with the receiver to be the argument.voidSets the application defined property of the receiver with the specified name to the given value.(package private) voidsetFontDescription(long widget, long fontDescription) (package private) booleansetInputState(Event event, int state) (package private) booleansetKeyState(Event javaEvent, long event) On Linux, the most common way to handle keyboard input is XKB.(package private) voidsetLocationState(Event event, long eventPtr) (package private) voidsetOrientation(boolean create) (package private) booleansetTabGroupFocus(boolean next) (package private) booleansetTabItemFocus(boolean next) (package private) voidsetToolTipText(long tipWidget, String string) (package private) longshellMapProc(long handle, long arg0, long user_data) (package private) longsizeAllocateProc(long handle, long arg0, long user_data) (package private) longsizeRequestProc(long handle, long arg0, long user_data) (package private) voidsnapshotToDraw(long handle, long snapshot) Converts an incoming snapshot into a gtk_draw() call, complete with a Cairo context.(package private) longtimerProc(long widget) (package private) longtoString()Returns a string containing a concise, human-readable description of the receiver.(package private) booleantranslateTraversal(int event) (package private) voidwindowActiveProc(long handle, long user_data) (package private) longwindowProc(long handle, long user_data) (package private) longwindowProc(long handle, long arg0, long user_data) (package private) longwindowProc(long handle, long arg0, long arg1, long user_data) (package private) longwindowProc(long handle, long arg0, long arg1, long arg2, long user_data) (package private) longwindowProc(long handle, long arg0, long arg1, long arg2, long arg3, long user_data)
-
Field Details
-
handle
public long handlethe handle to the OS resource (Warning: This field is platform dependent)IMPORTANT: This field is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code.
-
style
int style -
state
int state -
display
Display display -
eventTable
EventTable eventTable -
data
Object data -
DISPOSED
static final int DISPOSED- See Also:
-
CANVAS
static final int CANVAS- See Also:
-
KEYED_DATA
static final int KEYED_DATA- See Also:
-
HANDLE
static final int HANDLE- See Also:
-
DISABLED
static final int DISABLED- See Also:
-
MENU
static final int MENU- See Also:
-
OBSCURED
static final int OBSCURED- See Also:
-
MOVED
static final int MOVED- See Also:
-
RESIZED
static final int RESIZED- See Also:
-
ZERO_WIDTH
static final int ZERO_WIDTH- See Also:
-
ZERO_HEIGHT
static final int ZERO_HEIGHT- See Also:
-
HIDDEN
static final int HIDDEN- See Also:
-
FOREGROUND
static final int FOREGROUND- See Also:
-
BACKGROUND
static final int BACKGROUND- See Also:
-
FONT
static final int FONT- See Also:
-
PARENT_BACKGROUND
static final int PARENT_BACKGROUND- See Also:
-
THEME_BACKGROUND
static final int THEME_BACKGROUND- See Also:
-
LAYOUT_NEEDED
static final int LAYOUT_NEEDED- See Also:
-
LAYOUT_CHANGED
static final int LAYOUT_CHANGED- See Also:
-
LAYOUT_CHILD
static final int LAYOUT_CHILD- See Also:
-
RELEASED
static final int RELEASED- See Also:
-
DISPOSE_SENT
static final int DISPOSE_SENT- See Also:
-
FOREIGN_HANDLE
static final int FOREIGN_HANDLE- See Also:
-
DRAG_DETECT
static final int DRAG_DETECT- See Also:
-
SKIN_NEEDED
static final int SKIN_NEEDED- See Also:
-
CHECK_SUBWINDOW
static final int CHECK_SUBWINDOW- See Also:
-
HAS_AUTO_DIRECTION
static final int HAS_AUTO_DIRECTION- See Also:
-
AUTO_TEXT_DIRECTION
static final int AUTO_TEXT_DIRECTION- See Also:
-
DEFAULT_WIDTH
static final int DEFAULT_WIDTH- See Also:
-
DEFAULT_HEIGHT
static final int DEFAULT_HEIGHT- See Also:
-
ACTIVATE
static final int ACTIVATE- See Also:
-
BUTTON_PRESS_EVENT
static final int BUTTON_PRESS_EVENT- See Also:
-
BUTTON_PRESS_EVENT_INVERSE
static final int BUTTON_PRESS_EVENT_INVERSE- See Also:
-
BUTTON_RELEASE_EVENT
static final int BUTTON_RELEASE_EVENT- See Also:
-
BUTTON_RELEASE_EVENT_INVERSE
static final int BUTTON_RELEASE_EVENT_INVERSE- See Also:
-
CHANGED
static final int CHANGED- See Also:
-
CHANGE_VALUE
static final int CHANGE_VALUE- See Also:
-
CLICKED
static final int CLICKED- See Also:
-
COMMIT
static final int COMMIT- See Also:
-
CONFIGURE_EVENT
static final int CONFIGURE_EVENT- See Also:
-
DELETE_EVENT
static final int DELETE_EVENT- See Also:
-
DELETE_RANGE
static final int DELETE_RANGE- See Also:
-
DELETE_TEXT
static final int DELETE_TEXT- See Also:
-
ENTER_NOTIFY_EVENT
static final int ENTER_NOTIFY_EVENT- See Also:
-
EVENT
static final int EVENT- See Also:
-
EVENT_AFTER
static final int EVENT_AFTER- See Also:
-
EXPAND_COLLAPSE_CURSOR_ROW
static final int EXPAND_COLLAPSE_CURSOR_ROW- See Also:
-
EXPOSE_EVENT
static final int EXPOSE_EVENT- See Also:
-
DRAW
static final int DRAW- See Also:
-
EXPOSE_EVENT_INVERSE
static final int EXPOSE_EVENT_INVERSE- See Also:
-
FOCUS
static final int FOCUS- See Also:
-
FOCUS_IN_EVENT
static final int FOCUS_IN_EVENT- See Also:
-
FOCUS_OUT_EVENT
static final int FOCUS_OUT_EVENT- See Also:
-
GRAB_FOCUS
static final int GRAB_FOCUS- See Also:
-
HIDE
static final int HIDE- See Also:
-
INPUT
static final int INPUT- See Also:
-
INSERT_TEXT
static final int INSERT_TEXT- See Also:
-
KEY_PRESS_EVENT
static final int KEY_PRESS_EVENT- See Also:
-
KEY_RELEASE_EVENT
static final int KEY_RELEASE_EVENT- See Also:
-
LEAVE_NOTIFY_EVENT
static final int LEAVE_NOTIFY_EVENT- See Also:
-
MAP
static final int MAP- See Also:
-
MAP_EVENT
static final int MAP_EVENT- See Also:
-
MNEMONIC_ACTIVATE
static final int MNEMONIC_ACTIVATE- See Also:
-
MOTION_NOTIFY_EVENT
static final int MOTION_NOTIFY_EVENT- See Also:
-
MOTION_NOTIFY_EVENT_INVERSE
static final int MOTION_NOTIFY_EVENT_INVERSE- See Also:
-
MOVE_FOCUS
static final int MOVE_FOCUS- See Also:
-
OUTPUT
static final int OUTPUT- See Also:
-
POPULATE_POPUP
static final int POPULATE_POPUP- See Also:
-
POPUP_MENU
static final int POPUP_MENU- See Also:
-
PREEDIT_CHANGED
static final int PREEDIT_CHANGED- See Also:
-
REALIZE
static final int REALIZE- See Also:
-
ROW_ACTIVATED
static final int ROW_ACTIVATED- See Also:
-
SCROLL_CHILD
static final int SCROLL_CHILD- See Also:
-
SCROLL_EVENT
static final int SCROLL_EVENT- See Also:
-
SELECT
static final int SELECT- See Also:
-
SHOW
static final int SHOW- See Also:
-
SHOW_HELP
static final int SHOW_HELP- See Also:
-
SIZE_ALLOCATE
static final int SIZE_ALLOCATE- See Also:
-
STYLE_UPDATED
static final int STYLE_UPDATED- See Also:
-
SWITCH_PAGE
static final int SWITCH_PAGE- See Also:
-
TEST_COLLAPSE_ROW
static final int TEST_COLLAPSE_ROW- See Also:
-
TEST_EXPAND_ROW
static final int TEST_EXPAND_ROW- See Also:
-
TEXT_BUFFER_INSERT_TEXT
static final int TEXT_BUFFER_INSERT_TEXT- See Also:
-
TOGGLED
static final int TOGGLED- See Also:
-
UNMAP
static final int UNMAP- See Also:
-
UNMAP_EVENT
static final int UNMAP_EVENT- See Also:
-
UNREALIZE
static final int UNREALIZE- See Also:
-
VALUE_CHANGED
static final int VALUE_CHANGED- See Also:
-
WINDOW_STATE_EVENT
static final int WINDOW_STATE_EVENT- See Also:
-
ACTIVATE_INVERSE
static final int ACTIVATE_INVERSE- See Also:
-
DAY_SELECTED
static final int DAY_SELECTED- See Also:
-
MONTH_CHANGED
static final int MONTH_CHANGED- See Also:
-
STATUS_ICON_POPUP_MENU
static final int STATUS_ICON_POPUP_MENU- See Also:
-
ROW_INSERTED
static final int ROW_INSERTED- See Also:
-
ROW_DELETED
static final int ROW_DELETED- See Also:
-
DAY_SELECTED_DOUBLE_CLICK
static final int DAY_SELECTED_DOUBLE_CLICK- See Also:
-
ICON_RELEASE
static final int ICON_RELEASE- See Also:
-
SELECTION_DONE
static final int SELECTION_DONE- See Also:
-
START_INTERACTIVE_SEARCH
static final int START_INTERACTIVE_SEARCH- See Also:
-
BACKSPACE
static final int BACKSPACE- See Also:
-
BACKSPACE_INVERSE
static final int BACKSPACE_INVERSE- See Also:
-
COPY_CLIPBOARD
static final int COPY_CLIPBOARD- See Also:
-
COPY_CLIPBOARD_INVERSE
static final int COPY_CLIPBOARD_INVERSE- See Also:
-
CUT_CLIPBOARD
static final int CUT_CLIPBOARD- See Also:
-
CUT_CLIPBOARD_INVERSE
static final int CUT_CLIPBOARD_INVERSE- See Also:
-
PASTE_CLIPBOARD
static final int PASTE_CLIPBOARD- See Also:
-
PASTE_CLIPBOARD_INVERSE
static final int PASTE_CLIPBOARD_INVERSE- See Also:
-
DELETE_FROM_CURSOR
static final int DELETE_FROM_CURSOR- See Also:
-
DELETE_FROM_CURSOR_INVERSE
static final int DELETE_FROM_CURSOR_INVERSE- See Also:
-
MOVE_CURSOR
static final int MOVE_CURSOR- See Also:
-
MOVE_CURSOR_INVERSE
static final int MOVE_CURSOR_INVERSE- See Also:
-
DIRECTION_CHANGED
static final int DIRECTION_CHANGED- See Also:
-
CREATE_MENU_PROXY
static final int CREATE_MENU_PROXY- See Also:
-
ROW_HAS_CHILD_TOGGLED
static final int ROW_HAS_CHILD_TOGGLED- See Also:
-
POPPED_UP
static final int POPPED_UP- See Also:
-
FOCUS_IN
static final int FOCUS_IN- See Also:
-
FOCUS_OUT
static final int FOCUS_OUT- See Also:
-
IM_UPDATE
static final int IM_UPDATE- See Also:
-
KEY_PRESSED
static final int KEY_PRESSED- See Also:
-
KEY_RELEASED
static final int KEY_RELEASED- See Also:
-
DECELERATE
static final int DECELERATE- See Also:
-
SCROLL
static final int SCROLL- See Also:
-
SCROLL_BEGIN
static final int SCROLL_BEGIN- See Also:
-
SCROLL_END
static final int SCROLL_END- See Also:
-
ENTER
static final int ENTER- See Also:
-
LEAVE
static final int LEAVE- See Also:
-
MOTION
static final int MOTION- See Also:
-
MOTION_INVERSE
static final int MOTION_INVERSE- See Also:
-
CLOSE_REQUEST
static final int CLOSE_REQUEST- See Also:
-
GESTURE_PRESSED
static final int GESTURE_PRESSED- See Also:
-
GESTURE_RELEASED
static final int GESTURE_RELEASED- See Also:
-
NOTIFY_STATE
static final int NOTIFY_STATE- See Also:
-
SIZE_ALLOCATE_GTK4
static final int SIZE_ALLOCATE_GTK4- See Also:
-
DPI_CHANGED
static final int DPI_CHANGED- See Also:
-
NOTIFY_DEFAULT_HEIGHT
static final int NOTIFY_DEFAULT_HEIGHT- See Also:
-
NOTIFY_DEFAULT_WIDTH
static final int NOTIFY_DEFAULT_WIDTH- See Also:
-
NOTIFY_MAXIMIZED
static final int NOTIFY_MAXIMIZED- See Also:
-
COMPUTE_SIZE
static final int COMPUTE_SIZE- See Also:
-
LAST_SIGNAL
static final int LAST_SIGNAL- See Also:
-
IS_ACTIVE
- See Also:
-
KEY_CHECK_SUBWINDOW
- See Also:
-
KEY_GTK_CSS
- See Also:
-
gdkSeatGrabPrepareFunc
-
-
Constructor Details
-
Widget
Widget()Prevents uninitialized instances from being created outside the package. -
Widget
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.The style value is either one of the style constants defined in class
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
parent- a widget which will be the parent of the new instance (cannot be null)style- the style of widget to construct- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
- ERROR_INVALID_ARGUMENT - if the parent is disposed
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
-
-
Method Details
-
_addListener
-
addListener
Adds the listener to the collection oflistenerswho will be notified when an event of the given type occurs. When the event does occur in the widget, the listener is notified by sending it thehandleEvent()message. The event type is one of the event constants defined in classSWT.- Parameters:
eventType- the type of event to listen forlistener- the listener which should be notified when the event occurs- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
addTypedListener
Adds thetyped listenerto the collection of listeners who will be notified when an event of the given types occurs. When the event does occur in the widget, the listener is notified by calling the type's handling methods. The event type is one of the event constants defined in classSWTand must correspond to the listeners type. If for example aSelectionListeneris passed theeventTypescan beSWT.SelectionorSWT.DefaultSelection.- Parameters:
listener- the listener which should be notified when the event occurseventTypes- the types of event to listen for- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.126
- See Also:
-
addDisposeListener
Adds the listener to the collection of listeners who will be notified when the widget is disposed. When the widget is disposed, the listener is notified by sending it thewidgetDisposed()message.- Parameters:
listener- the listener which should be notified when the receiver is disposed- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
paintWindow
long paintWindow() -
paintSurface
long paintSurface() -
cssHandle
long cssHandle() -
checkBits
static int checkBits(int style, int int0, int int1, int int2, int int3, int int4, int int5) -
cellDataProc
long cellDataProc(long tree_column, long cell, long tree_model, long iter, long data) -
checkOpen
void checkOpen() -
checkOrientation
-
checkParent
Throws an exception if the specified widget can not be used as a parent for the receiver.- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
- ERROR_INVALID_ARGUMENT - if the parent is disposed
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
-
checkSubclass
protected void checkSubclass()Checks that this class can be subclassed.The SWT class library is intended to be subclassed only at specific, controlled points (most notably,
CompositeandCanvaswhen implementing new widgets). This method enforces this rule unless it is overridden.IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
- Throws:
SWTException-- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
-
checkWidget
protected void checkWidget()Throws anSWTExceptionif the receiver can not be accessed by the caller. This may include both checks on the state of the receiver and more generally on the entire execution context. This method should be called by widget implementors to enforce the standard SWT invariants.Currently, it is an error to invoke any method (other than
isDisposed()) on a widget that has had itsdispose()method called. It is also an error to call widget methods from any thread that is different from the thread that created the widget.In future releases of SWT, there may be more or fewer error checks and exceptions may be thrown for different reasons.
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
createHandle
void createHandle(int index) -
createWidget
void createWidget(int index) -
deregister
void deregister() -
destroyWidget
void destroyWidget() -
dispose
public void dispose()Disposes of the operating system resources associated with the receiver and all its descendants. After this method has been invoked, the receiver and all descendants will answertruewhen sent the messageisDisposed(). Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection. This method does nothing if the widget is already disposed.NOTE: This method is not called recursively on the descendants of the receiver. This means that, widget implementers can not detect when a widget is being disposed of by re-implementing this method, but should instead listen for the
Disposeevent.- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
dpiChanged
long dpiChanged(long object, long arg0) -
error
void error(int code) -
getData
Returns the application defined widget data associated with the receiver, or null if it has not been set. The widget data is a single, unnamed field that is stored with every widget.Applications may put arbitrary objects in this field. If the object stored in the widget data needs to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.
- Returns:
- the widget data
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - when the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread
- See Also:
-
getData
Returns the application defined property of the receiver with the specified name, or null if it has not been set.Applications may have associated arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.
- Parameters:
key- the name of the property- Returns:
- the value of the property or null if it has not been set
- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the key is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
getDisplay
Returns theDisplaythat is associated with the receiver.A widget's display is either provided when it is created (for example, top level
Shells) or is the same as its parent's display.- Returns:
- the receiver's display
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
getListeners
Returns an array oflistenerswho will be notified when an event of the given type occurs. The event type is one of the event constants defined in classSWT.- Parameters:
eventType- the type of event to listen for- Returns:
- an array of listeners that will be notified when the event occurs
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.4
- See Also:
-
getTypedListeners
Returns the typed listeners who will be notified when an event of the given type occurs. The event type is one of the event constants defined in classSWTand the specified listener-type must correspond to that event. If for example theeventTypeisSWT.Selection, the listeners type should beSelectionListener.- Parameters:
eventType- the type of event to listen for- Returns:
- a stream of typed listeners that will be notified when the event occurs
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.126
- See Also:
-
getName
String getName() -
getNameText
String getNameText() -
getStyle
public int getStyle()Returns the receiver's style information.Note that the value which is returned by this method may not match the value which was provided to the constructor when the receiver was created. This can occur when the underlying operating system does not support a particular combination of requested styles. For example, if the platform widget used to implement a particular SWT widget always has scroll bars, the result of calling this method would always have the
SWT.H_SCROLLandSWT.V_SCROLLbits set.- Returns:
- the style bits
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
gtk_activate
long gtk_activate(long widget) -
gtk_adjustment_get
-
gtk_button_press_event
long gtk_button_press_event(long widget, long event) -
gtk_button_release_event
long gtk_button_release_event(long widget, long event) -
gtk_gesture_press_event
int gtk_gesture_press_event(long gesture, int n_press, double x, double y, long event) - Parameters:
gesture- the corresponding controller responsible for capturing the eventn_press- how many touch/button presses happened with this onex- the x coordinate, in widget allocation coordinatesy- the y coordinate, in widget allocation coordinatesevent- the GdkEvent captured
-
gtk_gesture_release_event
int gtk_gesture_release_event(long gesture, int n_press, double x, double y, long event) - Parameters:
gesture- the corresponding controller responsible for capturing the eventn_press- how many touch/button presses happened with this onex- the x coordinate, in widget allocation coordinatesy- the y coordinate, in widget allocation coordinatesevent- the GdkEvent captured
-
gtk4_motion_event
void gtk4_motion_event(long controller, double x, double y, long event) - Parameters:
controller- the corresponding controller responsible for capturing the eventx- the x coordinatey- the y coordinateevent- the GdkEvent captured
-
gtk4_key_press_event
boolean gtk4_key_press_event(long controller, int keyval, int keycode, int state, long event) - Parameters:
controller- the corresponding controller responsible for capturing the eventkeyval- the pressed keykeycode- raw code of the pressed keystate- the bitmask, representing the state of the modifier keys and pointer buttonsevent- the GdkEvent captured- Returns:
- TRUE if the event has been fully/properly handled, otherwise FALSE
-
gtk4_key_release_event
void gtk4_key_release_event(long controller, int keyval, int keycode, int state, long event) - Parameters:
controller- the corresponding controller responsible for capturing the eventkeyval- the released keykeycode- raw code of the released keystate- the bitmask, representing the state of the modifier keys and pointer buttonsevent- the GdkEvent captured
-
gtk4_focus_enter_event
void gtk4_focus_enter_event(long controller, long event) - Parameters:
controller- the corresponding controller responsible for capturing the eventevent- the GdkEvent captured
-
gtk4_focus_window_event
void gtk4_focus_window_event(long handle, long event) - Parameters:
handle- the handle of the window that caused the eventevent- the type of event, should be FocusIn or FocusOut
-
gtk4_focus_leave_event
void gtk4_focus_leave_event(long controller, long event) - Parameters:
controller- the corresponding controller responsible for capturing the eventevent- the GdkEvent captured
-
gtk4_enter_event
void gtk4_enter_event(long controller, double x, double y, long event) - Parameters:
controller- the corresponding controller responsible for capturing the eventx- x coordinate of pointer locationy- y coordinate of pointer locationevent- the GdkEvent captured
-
gtk4_leave_event
void gtk4_leave_event(long controller, long event) - Parameters:
controller- the corresponding controller responsible for capturing the eventevent- the GdkEvent captured
-
gtk4_scroll_event
boolean gtk4_scroll_event(long controller, double dx, double dy, long event) - Parameters:
controller- the corresponding controller responsible for capturing the eventdx- x deltady- y deltaevent- the GdkEvent captured- Returns:
- TRUE if the scroll event was handled, FALSE otherwise
-
gtk_changed
long gtk_changed(long widget) -
gtk_change_value
boolean gtk_change_value(long widget, int scroll, double value, long user_data) -
gtk_clicked
long gtk_clicked(long widget) -
gtk_close_request
long gtk_close_request(long widget) -
gtk_commit
long gtk_commit(long imcontext, long text) -
gtk_configure_event
long gtk_configure_event(long widget, long event) -
gtk_day_selected
long gtk_day_selected(long widget) -
gtk_day_selected_double_click
long gtk_day_selected_double_click(long widget) -
gtk_delete_event
long gtk_delete_event(long widget, long event) -
gtk_delete_range
long gtk_delete_range(long widget, long iter1, long iter2) -
gtk_delete_text
long gtk_delete_text(long widget, long start_pos, long end_pos) -
gtk_enter_notify_event
long gtk_enter_notify_event(long widget, long event) -
gtk3_event_after
long gtk3_event_after(long widget, long event) -
gtk_expand_collapse_cursor_row
long gtk_expand_collapse_cursor_row(long widget, long logical, long expand, long open_all) -
gtk_draw
long gtk_draw(long widget, long cairo) -
gtk4_draw
-
gtk_focus
long gtk_focus(long widget, long event) -
gtk_focus_in_event
long gtk_focus_in_event(long widget, long event) -
gtk_focus_out_event
long gtk_focus_out_event(long widget, long event) -
gtk_grab_focus
long gtk_grab_focus(long widget) -
gtk_hide
long gtk_hide(long widget) -
gtk_icon_release
long gtk_icon_release(long widget, long icon_pos, long event) -
gtk_input
long gtk_input(long widget, long arg1) -
gtk_insert_text
long gtk_insert_text(long widget, long new_text, long new_text_length, long position) -
gtk3_key_press_event
long gtk3_key_press_event(long widget, long event) -
gtk3_key_release_event
long gtk3_key_release_event(long widget, long event) -
gtk_leave_notify_event
long gtk_leave_notify_event(long widget, long event) -
gtk_map
long gtk_map(long widget) -
gtk_map_event
long gtk_map_event(long widget, long event) -
gtk_mnemonic_activate
long gtk_mnemonic_activate(long widget, long arg1) -
gtk_month_changed
long gtk_month_changed(long widget) -
gtk_motion_notify_event
long gtk_motion_notify_event(long widget, long event) -
gtk_move_focus
long gtk_move_focus(long widget, long event) -
gtk_output
long gtk_output(long widget) -
gtk_populate_popup
long gtk_populate_popup(long widget, long menu) -
gtk_preedit_changed
long gtk_preedit_changed(long imcontext) -
gtk_realize
long gtk_realize(long widget) -
gtk_row_activated
long gtk_row_activated(long tree, long path, long column) -
gtk_row_has_child_toggled
long gtk_row_has_child_toggled(long model, long path, long iter) -
gtk_scroll_child
long gtk_scroll_child(long widget, long scrollType, long horizontal) -
gtk_scroll_event
long gtk_scroll_event(long widget, long event) -
gtk_select
long gtk_select(long item) -
gtk_selection_done
long gtk_selection_done(long menushell) -
gtk_show
long gtk_show(long widget) -
gtk3_show_help
long gtk3_show_help(long widget, long helpType) -
gtk_size_allocate
long gtk_size_allocate(long widget, long allocation) -
gtk_start_interactive_search
long gtk_start_interactive_search(long widget) -
gtk_style_updated
long gtk_style_updated(long widget) -
gtk_switch_page
long gtk_switch_page(long notebook, long page, int page_num) -
gtk_test_collapse_row
long gtk_test_collapse_row(long tree, long iter, long path) -
gtk_test_expand_row
long gtk_test_expand_row(long tree, long iter, long path) -
gtk_text_buffer_insert_text
long gtk_text_buffer_insert_text(long widget, long iter, long text, long length) -
gtk_timer
long gtk_timer() -
gtk_toggled
long gtk_toggled(long renderer, long pathStr) -
gtk_tree_view_column_cell_get_position
boolean gtk_tree_view_column_cell_get_position(long column, long cell_renderer, int[] start_pos, int[] width) -
gtk_unmap
long gtk_unmap(long widget) -
gtk_unmap_event
long gtk_unmap_event(long widget, long event) -
gtk_unrealize
long gtk_unrealize(long widget) -
gtk_value_changed
long gtk_value_changed(long range) -
gtk_window_state_event
long gtk_window_state_event(long widget, long event) -
fontHeight
int fontHeight(long font, long widgetHandle) -
filterProc
long filterProc(long xEvent, long gdkEvent, long data2) -
filters
boolean filters(int eventType) -
fixMnemonic
-
fixMnemonic
-
fixMnemonic
-
isActive
boolean isActive() -
isAutoDirection
public boolean isAutoDirection()Returnstrueif the widget has auto text direction, andfalseotherwise.- Returns:
truewhen the widget has auto direction andfalseotherwise- Since:
- 3.105
- See Also:
-
isDisposed
public boolean isDisposed()Returnstrueif the widget has been disposed, andfalseotherwise.This method gets the dispose state for the widget. When a widget has been disposed, it is an error to invoke any other method (except
dispose()) using the widget.- Returns:
truewhen the widget is disposed andfalseotherwise
-
isListening
public boolean isListening(int eventType) Returnstrueif there are any listeners for the specified event type associated with the receiver, andfalseotherwise. The event type is one of the event constants defined in classSWT.- Parameters:
eventType- the type of event- Returns:
- true if the event is hooked
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
isValidThread
boolean isValidThread() -
isValidSubclass
boolean isValidSubclass() -
hookEvents
void hookEvents() -
hooks
boolean hooks(int eventType) -
hoverProc
long hoverProc(long widget) -
mnemonicHit
boolean mnemonicHit(long mnemonicHandle, char key) -
mnemonicMatch
boolean mnemonicMatch(long mnemonicHandle, char key) -
notifyListeners
Notifies all of the receiver's listeners for events of the given type that one such event has occurred by invoking theirhandleEvent()method. The event type is one of the event constants defined in classSWT.- Parameters:
eventType- the type of event which has occurredevent- the event data- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
postEvent
void postEvent(int eventType) -
postEvent
-
register
void register() -
release
void release(boolean destroy) -
releaseChildren
void releaseChildren(boolean destroy) -
releaseHandle
void releaseHandle() -
releaseParent
void releaseParent() -
releaseWidget
void releaseWidget() -
removeListener
Removes the listener from the collection of listeners who will be notified when an event of the given type occurs. The event type is one of the event constants defined in classSWT.- Parameters:
eventType- the type of event to listen forlistener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeListener
@Deprecated(forRemoval=true, since="2025-03") protected void removeListener(int eventType, SWTEventListener listener) Deprecated, for removal: This API element is subject to removal in a future version.Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.IMPORTANT: This method is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It should never be referenced from application code.
- Parameters:
eventType- the type of event to listen forlistener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeListener
Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.IMPORTANT: This method is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It should never be referenced from application code.
- Parameters:
eventType- the type of event to listen forlistener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeTypedListener
Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.IMPORTANT: This method is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It should never be referenced from application code.
- Parameters:
eventType- the type of event to listen forlistener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
rendererGetPreferredWidthProc
long rendererGetPreferredWidthProc(long cell, long handle, long minimun_size, long natural_size) -
rendererRenderProc
long rendererRenderProc(long cell, long cr, long handle, long background_area, long cell_area, long flags) -
rendererSnapshotProc
long rendererSnapshotProc(long cell, long snapshot, long handle, long background_area, long cell_area, long flags) -
reskin
public void reskin(int flags) Marks the widget to be skinned.The skin event is sent to the receiver's display when appropriate (usually before the next event is handled). Widgets are automatically marked for skinning upon creation as well as when its skin id or class changes. The skin id and/or class can be changed by calling
Display.setData(String, Object)with the keysSWT.SKIN_IDand/orSWT.SKIN_CLASS. Once the skin event is sent to a widget, it will not be sent again unlessreskin(int)is called on the widget or on an ancestor while specifying theSWT.ALLflag.The parameter
flagsmay be either:- Parameters:
flags- the flags specifying how to reskin- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.6
-
reskinChildren
void reskinChildren(int flags) -
reskinWidget
void reskinWidget() -
removeDisposeListener
Removes the listener from the collection of listeners who will be notified when the widget is disposed.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
sendEvent
-
sendEvent
void sendEvent(int eventType) -
sendEvent
-
sendEvent
-
sendKeyEvent
boolean sendKeyEvent(int type, long event) -
sendIMKeyEvent
char[] sendIMKeyEvent(int type, long event, char[] chars) -
sendSelectionEvent
void sendSelectionEvent(int eventType) -
sendSelectionEvent
-
setData
Sets the application defined widget data associated with the receiver to be the argument. The widget data is a single, unnamed field that is stored with every widget.Applications may put arbitrary objects in this field. If the object stored in the widget data needs to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.
- Parameters:
data- the widget data- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - when the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread
- See Also:
-
setData
Sets the application defined property of the receiver with the specified name to the given value.Applications may associate arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.
- Parameters:
key- the name of the propertyvalue- the new value for the property- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the key is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
setFontDescription
void setFontDescription(long widget, long fontDescription) - Parameters:
fontDescription- Font description in the form ofPangoFontDescription*. This pointer will never be used by GTK after calling this function, so it's safe to free it as soon as the function completes.
-
convertPangoFontDescriptionToCss
-
setButtonState
-
setInputState
-
setKeyState
On Linux, the most common way to handle keyboard input is XKB. The rest of the description explains XKB and related GTK stuff. XKB uses the following definitions:- "group" - that's how they call keyboard layouts
- "keycode" - id of a physical key on a keyboard. For example, AB01 refers to 2nd row from the bottom (B), 1st key (01)
- "level" - Can be seen as a number that describes modifiers pressed together with the key. For example, in English US, pressing A would result in level 0, and pressing Shift+A would result in level 1. The other common levels are used for AltGr and Shift+AltGr, but a keyboard layout could have even more exotic levels.
- "modifiers" - a combination of modifier keys. Keyboard layouts could define their own modifiers.
- "keyval" - Can be seen as a final calculation of what was produced by a key press (by taking keycode, group, level, and other modifiers such as dead keys into account).
Layout Key row Key col Keycode Modifiers Keyval Character English US 1 10 FK09 F9 English US 3 5 AD04 r r English US 3 5 AD04 Shift R R English US 3 6 AD05 t t English Dvorak 3 5 AD04 p p English Dvorak 3 6 AD05 y y Bulgarian 3 5 AD04 Cyrillic_i и Bulgarian 3 6 AD05 Cyrillic_sha ш
XKB doesn't do two-step keyboard layout translation like Windows. For this reason, binding keyboard shortcuts across keyboard layouts quickly becomes ugly. Further, each major UI library (such as Qt or GTK) and many major softwares (such as Firefox, LibreOffice) has its own approach. Usually developed through trial, error and pain. The common approach is to search all installed keyboard layouts and find some that is latin. Then invoke keyboard shortcut using that layout. That is, if current layout is Bulgarian:
- notice that current layout is not latin
- search installed layouts to find a latin one
- map pressed key to a latin char using that layout
- invoke keyboard shortcut
- If currently pressed key produces latin keyval, some are happy with that and will not search for other layouts. Others do search anyway. This often results in multiple keys invoking the same shortcut (when there are multiple layouts with desired latin key in different positions). One example of affected software is 'gedit'.
- When they do search, some search all layouts, others search only the previous layouts (and insist that latin layout is installed before non-latin), some search for a first match, some search for the "most latin" layout, etc.
-
setLocationState
-
setOrientation
void setOrientation(boolean create) -
setTabGroupFocus
boolean setTabGroupFocus(boolean next) -
setTabItemFocus
boolean setTabItemFocus(boolean next) -
shellMapProc
long shellMapProc(long handle, long arg0, long user_data) -
sizeAllocateProc
long sizeAllocateProc(long handle, long arg0, long user_data) -
sizeRequestProc
long sizeRequestProc(long handle, long arg0, long user_data) -
snapshotToDraw
void snapshotToDraw(long handle, long snapshot) Converts an incoming snapshot into a gtk_draw() call, complete with a Cairo context.- Parameters:
handle- the widget receiving the snapshotsnapshot- the actual GtkSnapshot
-
gtk_widget_get_window
long gtk_widget_get_window(long widget) -
gtk_widget_get_surface
long gtk_widget_get_surface(long widget) -
gdk_window_get_size
void gdk_window_get_size(long drawable, int[] width, int[] height) -
gdk_surface_get_size
void gdk_surface_get_size(long surface, int[] width, int[] height) -
gdk_event_free
void gdk_event_free(long event) GTK4 does not hand out copies of events anymore, only references. Call gdk_event_free() on GTK3 and g_object_unref() on GTK4.- Parameters:
event- the event to be freed
-
gdk_event_get_surface_or_window
long gdk_event_get_surface_or_window(long event) Wrapper function for gdk_event_get_surface() on GTK4, and gdk_event_get_window() on GTK3.- Parameters:
event- the event whose window or surface to fetch- Returns:
- the GdkWindow or GdkSurface associated with the event
-
gdk_event_get_state
int gdk_event_get_state(long event) Wrapper function for gdk_event_get_state()- Parameters:
event- pointer to the GdkEvent.- Returns:
- the keymask to be used with constants like OS.GDK_SHIFT_MASK / OS.GDK_CONTROL_MASK / OS.GDK_MOD1_MASK etc..
-
gtk_box_new
long gtk_box_new(int orientation, boolean homogeneous, int spacing) -
gtk_box_set_child_packing
void gtk_box_set_child_packing(long box, long child, boolean expand, boolean fill, int padding, int pack_type) -
gtk_box_pack_end
void gtk_box_pack_end(long box, long child, boolean expand, boolean fill, int padding) -
gdk_pointer_grab
int gdk_pointer_grab(long gdkResource, int grab_ownership, boolean owner_events, int event_mask, long confine_to, long cursor, int time_) -
gdk_pointer_ungrab
void gdk_pointer_ungrab(long gdkResource, int time_) -
GdkSeatGrabPrepareFunc
static long GdkSeatGrabPrepareFunc(long gdkSeat, long gdkResource, long userData_gdkResource) -
toString
-
topHandle
long topHandle() -
timerProc
long timerProc(long widget) -
translateTraversal
boolean translateTraversal(int event) -
enterMotionProc
void enterMotionProc(long controller, double x, double y, long user_data) -
scrollProc
boolean scrollProc(long controller, double dx, double dy, long user_data) -
focusProc
void focusProc(long controller, long user_data) -
windowActiveProc
void windowActiveProc(long handle, long user_data) -
keyPressReleaseProc
boolean keyPressReleaseProc(long controller, int keyval, int keycode, int state, long user_data) -
gesturePressReleaseProc
void gesturePressReleaseProc(long gesture, int n_press, double x, double y, long user_data) -
leaveProc
void leaveProc(long controller, long handle, long user_data) -
notifyProc
long notifyProc(long object, long arg0, long user_data) -
notifyState
long notifyState(long object, long argo0) -
windowProc
long windowProc(long handle, long user_data) -
windowProc
long windowProc(long handle, long arg0, long user_data) -
windowProc
long windowProc(long handle, long arg0, long arg1, long user_data) -
windowProc
long windowProc(long handle, long arg0, long arg1, long arg2, long user_data) -
windowProc
long windowProc(long handle, long arg0, long arg1, long arg2, long arg3, long user_data) -
gtk_cell_renderer_get_preferred_size
void gtk_cell_renderer_get_preferred_size(long cell, long widget, int[] width, int[] height) -
gtk_widget_get_preferred_size
-
gtk_container_get_border_width_or_margin
int gtk_container_get_border_width_or_margin(long handle) Retrieves the amount of space around the outside of the container. On GTK3: this is done using gtk_container_get_border_width. On GTK4: this is done by returning the max margin on any side.- Returns:
- amount of space around the outside of the container.
-
gtk_container_set_border_width
void gtk_container_set_border_width(long handle, int border_width) Sets the border width of the container to all sides of the container. -
setToolTipText
-
gtk_widget_size_allocate
-
notifyCreationTracker
void notifyCreationTracker() -
notifyDisposalTracker
void notifyDisposalTracker() -
gtk_widget_hide
void gtk_widget_hide(long widget) -
gtk_widget_show
void gtk_widget_show(long widget)
-
removeListener(int, EventListener).