|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.GObject
org.gnu.gtk.GtkObject
org.gnu.gtk.Widget
GtkWidget is the base class of all widgets.
Field Summary |
Fields inherited from class org.gnu.glib.GObject |
eventsInitialized |
Constructor Summary | |
Widget(Handle handle)
Create a new Widget with a handle to a native resource returned from a call to the native libraries. |
Method Summary | |
boolean |
activate()
For widgets that can be activeated (buttons, menu items, etc.) this method activiates them. |
void |
addListener(DragDestinationListener listener)
Register an object to receive drag drop (destination) events. |
void |
addListener(DragSourceListener listener)
Register an object to receive drag source events. |
void |
addListener(ExposeListener listener)
Register an object to receive expose event notification. |
void |
addListener(FocusListener listener)
Register an object to receive focus event notification. |
void |
addListener(KeyListener listener)
Register an object to receive key event notification. |
void |
addListener(LifeCycleListener listener)
Register an object to receive life cycle event notification. |
void |
addListener(MouseListener listener)
Register an object to receive mouse event notification. |
void |
addListener(MouseMotionListener listener)
Register an object to receive mouse motion event notification. |
boolean |
canActivateAccel(int signalId)
|
Context |
createContext()
Creates a new Context with the appropriate Colormap, FontDescription, and base direction for drawing text for this widget. |
Layout |
createLayout(java.lang.String text)
Creates a new Layout with the appropriate Colormap, FontDescription and base direction for drawing text for this widget. |
void |
destroy()
Destroy this widget. |
void |
draw()
Causes the entire widget to be redrawn. |
void |
drawArea(int x,
int y,
int width,
int height)
Causes the specified area to be redrawn |
void |
drawArea(Rectangle area)
Causes the specified area to be redrawn. |
protected static int |
findListener(java.util.Vector list,
java.lang.Object listener)
Give us a way to locate a specific listener in a Vector. |
static void |
finish(DragContext context,
boolean success,
boolean delete)
|
protected boolean |
fireBooleanLifeCycleEvent(LifeCycleEvent event,
boolean defaultValue)
|
protected void |
fireDragDestinationEvent(Widget widget,
DragContext dragContext,
int x,
int y,
SelectionData data,
int id,
int time)
|
protected void |
fireDragSourceEvent(Widget widget,
DragContext dragContext,
SelectionData data,
int id,
int time)
|
protected boolean |
fireExposeEvent(ExposeEvent event)
|
protected boolean |
fireFocusEvent(FocusEvent event)
|
protected boolean |
fireKeyEvent(KeyEvent event)
|
protected void |
fireLifeCycleEvent(LifeCycleEvent event)
|
protected boolean |
fireMouseEvent(MouseEvent event)
|
protected boolean |
fireMouseMotionEvent(MouseMotionEvent event)
|
AtkObject |
getAccessible()
Returns the accessible object associated with this widget. |
Colormap |
getColormap()
Returns the Colormap that will be used to render this widget. |
Context |
getContext()
Gets a Context with the appropriate Colormap, FontDescription and base direction for this widget. |
static void |
getData(Widget widget,
DragContext context,
int target)
|
Display |
getDisplay()
|
java.lang.Class |
getEventListenerClass(java.lang.String signal)
|
EventType |
getEventType(java.lang.String signal)
|
RcStyle |
getModifierStyle()
Retruns the Widget's RcStyle . |
java.lang.String |
getName()
Returns the name for the widget. |
Widget |
getParent()
Returns the parent container for this widget |
Window |
getParentWindow()
Returns the widget's parent window. |
Point |
getPointer()
Returns the location of the mouse pointer in widget coordinates. |
Window |
getRootWindow()
|
Screen |
getScreen()
|
boolean |
getSensitive()
Gets the sensitivity of the widget. |
Style |
getStyle()
Returns the Widgets Style . |
Widget |
getToplevel()
Returns the topmost widget in the container hierarchy. |
static Type |
getType()
Retrieve the runtime type used by the GLib library. |
Window |
getWindow()
Return the widget's gdk window. |
void |
grabDefault()
Causes the widget to become the default widget. |
void |
grabFocus()
Causes the widget to gain focus within its' TOPLEVEL. |
protected static void |
gtk_drag_dest_set(Handle widget,
int flags,
Handle[] targets,
int actions)
|
protected static void |
gtk_drag_dest_unset(Handle widget)
|
protected static void |
gtk_drag_finish(Handle context,
boolean success,
boolean delete)
|
protected static void |
gtk_drag_get_data(Handle widget,
Handle context,
int target)
|
protected static void |
gtk_drag_highlight(Handle widget)
|
protected static void |
gtk_drag_source_set_icon_pixbuf(Handle widget,
Handle pixbuf)
|
protected static void |
gtk_drag_source_set_icon_stock(Handle widget,
java.lang.String stockId)
|
protected static void |
gtk_drag_source_set_icon(Handle widget,
Handle colormap,
Handle pixmap,
Handle mask)
|
protected static void |
gtk_drag_source_set(Handle widget,
int start_button_mask,
Handle[] targets,
int actions)
|
protected static void |
gtk_drag_source_unset(Handle widget)
|
protected static void |
gtk_drag_unhighlight(Handle widget)
|
protected static boolean |
gtk_widget_activate(Handle widget)
|
protected static void |
gtk_widget_add_accelerator(Handle widget,
java.lang.String accelSignal,
Handle accelGroup,
int accelKey,
int accelMods,
int accelFlags)
|
protected static void |
gtk_widget_add_events(Handle widget,
int events)
|
protected static void |
gtk_widget_add_mnemonic_label(Handle widget,
Handle label)
|
protected static boolean |
gtk_widget_can_activate_accel(Handle widget,
int signalId)
|
protected static boolean |
gtk_widget_child_focus(Handle widget,
int direction)
|
protected static void |
gtk_widget_child_notify(Handle widget,
java.lang.String childProperty)
|
protected static void |
gtk_widget_class_path(Handle widget,
int[] pathLength,
java.lang.String[] path,
java.lang.String[] pathReversed)
|
protected static Handle |
gtk_widget_create_pango_context(Handle widget)
|
protected static Handle |
gtk_widget_create_pango_layout(Handle widget,
java.lang.String text)
|
protected static void |
gtk_widget_destroy(Handle widget)
|
protected static void |
gtk_widget_destroyed(Handle widget,
Handle[] widgetPointer)
|
protected static void |
gtk_widget_ensure_style(Handle widget)
|
protected static boolean |
gtk_widget_event(Handle widget,
Handle event)
|
protected static void |
gtk_widget_freeze_child_notify(Handle widget)
|
protected static Handle |
gtk_widget_get_accessible(Handle widget)
|
protected static Handle |
gtk_widget_get_ancestor(Handle widget,
int widgetType)
|
protected static void |
gtk_widget_get_child_requisition(Handle widget,
Handle[] requisition)
|
protected static boolean |
gtk_widget_get_child_visible(Handle widget)
|
protected static Handle |
gtk_widget_get_colormap(Handle widget)
|
protected static java.lang.String |
gtk_widget_get_composite_name(Handle widget)
|
protected static Handle |
gtk_widget_get_default_colormap()
|
protected static int |
gtk_widget_get_default_direction()
|
protected static Handle |
gtk_widget_get_default_style()
|
protected static Handle |
gtk_widget_get_default_visual()
|
protected static int |
gtk_widget_get_direction(Handle widget)
|
protected static Handle |
gtk_widget_get_display(Handle widget)
|
protected static int |
gtk_widget_get_events(Handle widget)
|
protected static int |
gtk_widget_get_extension_events(Handle widget)
|
protected static Handle |
gtk_widget_get_modifier_style(Handle widget)
|
protected static java.lang.String |
gtk_widget_get_name(Handle widget)
|
protected static Handle |
gtk_widget_get_pango_context(Handle widget)
|
protected static Handle |
gtk_widget_get_parent_window(Handle widget)
|
protected static Handle |
gtk_widget_get_parent(Handle widget)
|
protected static void |
gtk_widget_get_pointer(Handle widget,
int[] x,
int[] y)
|
protected static Handle |
gtk_widget_get_root_window(Handle widget)
|
protected static Handle |
gtk_widget_get_screen(Handle widget)
|
protected static boolean |
gtk_widget_get_sensitive(Handle widget)
|
protected static Handle |
gtk_widget_get_settings(Handle widget)
|
protected static void |
gtk_widget_get_size_request(Handle widget,
int[] width,
int[] height)
|
protected static Handle |
gtk_widget_get_style(Handle widget)
|
protected static Handle |
gtk_widget_get_toplevel(Handle widget)
|
protected static int |
gtk_widget_get_type()
|
protected static Handle |
gtk_widget_get_visual(Handle widget)
|
protected static Handle |
gtk_widget_get_window(Handle widget)
|
protected static void |
gtk_widget_grab_default(Handle widget)
|
protected static void |
gtk_widget_grab_focus(Handle widget)
|
protected static boolean |
gtk_widget_has_screen(Handle widget)
|
protected static void |
gtk_widget_hide_all(Handle widget)
|
protected static boolean |
gtk_widget_hide_on_delete(Handle widget)
|
protected static void |
gtk_widget_hide(Handle widget)
|
protected static boolean |
gtk_widget_intersect(Handle widget,
Handle area,
Handle intersection)
|
protected static boolean |
gtk_widget_is_ancestor(Handle widget,
Handle ancestor)
|
protected static boolean |
gtk_widget_is_focus(Handle widget)
|
protected static int |
gtk_widget_list_accel_closures(Handle widget)
|
protected static Handle[] |
gtk_widget_list_mnemonic_labels(Handle widget)
|
protected static void |
gtk_widget_map(Handle widget)
|
protected static boolean |
gtk_widget_mnemonic_activate(Handle widget,
boolean groupCycling)
|
protected static void |
gtk_widget_modify_base(Handle widget,
int state,
Handle color)
|
protected static void |
gtk_widget_modify_bg(Handle widget,
int state,
Handle color)
|
protected static void |
gtk_widget_modify_fg(Handle widget,
int state,
Handle color)
|
protected static void |
gtk_widget_modify_font(Handle widget,
Handle fontDesc)
|
protected static void |
gtk_widget_modify_style(Handle widget,
Handle style)
|
protected static void |
gtk_widget_modify_text(Handle widget,
int state,
Handle color)
|
protected static void |
gtk_widget_path(Handle widget,
int[] pathLength,
java.lang.String[] path,
java.lang.String[] pathReversed)
|
protected static void |
gtk_widget_pop_colormap()
|
protected static void |
gtk_widget_pop_composite_child()
|
protected static void |
gtk_widget_push_colormap(Handle cmap)
|
protected static void |
gtk_widget_push_composite_child()
|
protected static void |
gtk_widget_queue_draw_area(Handle widget,
int x,
int y,
int width,
int height)
|
protected static void |
gtk_widget_queue_draw(Handle widget)
|
protected static void |
gtk_widget_queue_resize(Handle widget)
|
protected static void |
gtk_widget_realize(Handle widget)
|
protected static Handle |
gtk_widget_ref(Handle widget)
|
protected static int |
gtk_widget_region_intersect(Handle widget,
Handle region)
|
protected static boolean |
gtk_widget_remove_accelerator(Handle widget,
Handle accelGroup,
int accelKey,
int accelMods)
|
protected static void |
gtk_widget_remove_mnemonic_label(Handle widget,
Handle label)
|
protected static Handle |
gtk_widget_render_icon(Handle widget,
java.lang.String stockID,
int size,
java.lang.String detail)
|
protected static void |
gtk_widget_reparent(Handle widget,
Handle newParent)
|
protected static void |
gtk_widget_reset_rc_styles(Handle widget)
|
protected static int |
gtk_widget_send_expose(Handle widget,
Handle event)
|
protected static void |
gtk_widget_set_accel_path(Handle widget,
java.lang.String accelPath,
Handle accelGroup)
|
protected static void |
gtk_widget_set_app_paintable(Handle widget,
boolean appPaintable)
|
protected static void |
gtk_widget_set_child_visible(Handle widget,
boolean isVisible)
|
protected static void |
gtk_widget_set_colormap(Handle widget,
Handle cmap)
|
protected static void |
gtk_widget_set_composite_name(Handle widget,
java.lang.String name)
|
protected static void |
gtk_widget_set_default_colormap(Handle cmap)
|
protected static void |
gtk_widget_set_default_direction(int dir)
|
protected static void |
gtk_widget_set_direction(Handle widget,
int dir)
|
protected static void |
gtk_widget_set_double_buffered(Handle widget,
boolean doubleBuffered)
|
protected static void |
gtk_widget_set_events(Handle widget,
int events)
|
protected static void |
gtk_widget_set_extension_events(Handle widget,
int mode)
|
protected static void |
gtk_widget_set_name(Handle widget,
java.lang.String name)
|
protected static void |
gtk_widget_set_parent_window(Handle widget,
Handle parent)
|
protected static void |
gtk_widget_set_parent(Handle widget,
Handle parent)
|
protected static void |
gtk_widget_set_redraw_on_allocate(Handle widget,
boolean redrawOnAllocate)
|
protected static void |
gtk_widget_set_scroll_adjustments(Handle widget,
Handle hadj,
Handle vadj)
|
protected static void |
gtk_widget_set_sensitive(Handle widget,
boolean sensitive)
|
protected static void |
gtk_widget_set_size_request(Handle widget,
int width,
int height)
|
protected static void |
gtk_widget_set_state(Handle widget,
int state)
|
protected static void |
gtk_widget_set_style(Handle widget,
Handle style)
|
protected static void |
gtk_widget_shape_combine_mask(Handle widget,
Handle shapeMask,
int offsetX,
int offsetY)
|
protected static void |
gtk_widget_show_all(Handle widget)
|
protected static void |
gtk_widget_show_now(Handle widget)
|
protected static void |
gtk_widget_show(Handle widget)
|
protected static void |
gtk_widget_size_allocate(Handle widget,
Handle allocation)
|
protected static void |
gtk_widget_size_request(Handle widget,
Handle requisition)
|
protected static void |
gtk_widget_style_get_property(Handle widget,
java.lang.String propertyName,
Handle value)
|
protected static void |
gtk_widget_thaw_child_notify(Handle widget)
|
protected static boolean |
gtk_widget_translate_coordinates(Handle srcWidget,
Handle destWidget,
int srcX,
int srcY,
int[] destX,
int[] destY)
|
protected static void |
gtk_widget_unmap(Handle widget)
|
protected static void |
gtk_widget_unparent(Handle widget)
|
protected static void |
gtk_widget_unrealize(Handle widget)
|
protected static void |
gtk_widget_unref(Handle widget)
|
protected boolean |
handleButtonPressed(Handle event)
|
protected boolean |
handleButtonReleased(Handle event)
|
protected boolean |
handleDelete(Handle event)
|
protected void |
handleDragDataGet(Handle context,
Handle data,
int id,
int time)
|
protected void |
handleDragDestination(Handle context,
int x,
int y,
Handle data,
int id,
int time)
|
protected boolean |
handleExpose(Handle event)
|
protected boolean |
handleFocusIn(Handle event)
|
protected boolean |
handleFocusOut(Handle event)
|
protected void |
handleHide()
|
protected boolean |
handleKeyPressed(Handle event)
|
protected boolean |
handleKeyReleased(Handle event)
|
protected void |
handleMap()
|
protected boolean |
handleMouseEnter(Handle event)
|
protected boolean |
handleMouseLeave(Handle event)
|
protected boolean |
handleMouseMotion(Handle event)
|
protected boolean |
handleNoExpose(Handle event)
|
protected void |
handleRealize()
|
protected boolean |
handleScroll(Handle event)
|
protected void |
handleShow()
|
protected void |
handleUnmap()
|
boolean |
hasFocus()
Determines if the widget has focus within its' TOPLEVEL. |
boolean |
hasScreen()
|
void |
hide()
Cause this Widget to not be visible. |
void |
hideAll()
Cause this Widget and all of its' children to not be visible. |
static void |
highlight(Widget widget)
|
Rectangle |
intersect(Rectangle area)
Computes the intersection of the widget's area and area . |
boolean |
isAncestor(Widget ancestor)
Determines whether this widget is somewhere inside of ancestor. |
static Widget |
makeWidget(Handle handle)
Create a Java-GNOME Widget subclass from an existing native GTK+ handle. |
void |
modifyStyle(RcStyle style)
Modifies style values on the Widget. |
void |
popColormap()
Pops the top colormap off of the stack of colormaps. |
void |
pushColormap(Colormap colormap)
Pushes a Colormap onto the stack of colormaps. |
void |
realize()
Creates a native window resource associated with this widget. |
void |
removeListener(DragDestinationListener listener)
Unregister an object that was receiving dragDestination event notification. |
void |
removeListener(DragSourceListener listener)
Unregister an object that was receiving drag source event notification. |
void |
removeListener(ExposeListener listener)
Unregister an object that was receiving expose event notification. |
void |
removeListener(FocusListener listener)
Unregister an object that was receiving focus event notification. |
void |
removeListener(KeyListener listener)
Unregister an object that was receiving key event notification. |
void |
removeListener(LifeCycleListener listener)
Unregister an object that was receiving life cycle event notification. |
void |
removeListener(MouseListener listener)
Unregister an object that was receiving mouse event notification. |
void |
removeListener(MouseMotionListener listener)
Unregister an object that was receiving mouse motion event notification. |
void |
reparent(Widget newParent)
Moves a widget from one Container to another. |
void |
setBackgroundColor(StateType state,
Color color)
Sets the background color for a widget in a particular state. |
void |
setBaseColor(StateType state,
Color color)
Sets the base color used for a widget in a particular state. |
void |
setColormap(Colormap colormap)
Set the Colormap that will be used to render this widget. |
void |
setDoubleBuffered(boolean doubleBuffered)
Enables/Disables double buffering for this widget. |
void |
setDragDestination(DestDefaults flags,
TargetEntry[] targets,
DragAction actions)
Sets up the widget so that is can receive drops as part of drag drop events and specifies what sort of drops it will accept |
void |
setDragIcon(Widget widget,
Colormap cmap,
Pixmap pixmap,
Bitmap mask)
|
void |
setDragIconPixbuf(Widget widget,
Pixbuf pixbuf)
|
void |
setDragIconStock(Widget widget,
java.lang.String stockId)
|
void |
setDragSource(ModifierType buttons,
TargetEntry[] targets,
DragAction actions)
Sets up the widget so that it can be the source of drag and drop operations. |
void |
setFont(FontDescription fontDesc)
Sets the font to use for the widget. |
void |
setForegroundColor(StateType state,
Color color)
Sets the foreground color for a widget in a particular state. |
void |
setMinimumSize(int width,
int height)
Sets the minimum size of a widget. |
void |
setName(java.lang.String name)
Sets the name for this widget. |
void |
setNoDragDestination()
Removes support for this widget being a drag and drop target |
void |
setNoDragSource()
Removes support for this widget being a drag and drop source. |
void |
setSensitive(boolean sensitive)
Sets the sensitivity of the widget. |
void |
setTextColor(StateType state,
Color color)
Sets the text color for a widget in a particilar state. |
void |
shapeCombineMask(Bitmap shapeMask,
int x,
int y)
Sets the shape of this widgets OS window. |
void |
show()
Cause this Widget to be visible. |
void |
showAll()
Cause this Widget and all of its' children to be visible. |
static void |
unHighlight(Widget widget)
|
Methods inherited from class org.gnu.gtk.GtkObject |
getFlags, gtk_object_destroy, gtk_object_get_type, gtk_object_sink, setFlags, sink |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Widget(Handle handle)
handle
- The handle that represents a pointer to a native resource.Method Detail |
public void show()
public void showAll()
public void hide()
public void hideAll()
public void destroy()
destroy
in class GtkObject
public void realize()
public void draw()
public void drawArea(Rectangle area)
area
- The area to be redrawn.public void drawArea(int x, int y, int width, int height)
x
- The x coordinate for the area to be redrawn.y
- The y coordinate for the area to be redrawn.width
- The width of the area to be redrawn.height
- The height of the area to be redrawn.public boolean activate()
public void reparent(Widget newParent)
newParent
- The widget that will be the new parent.public Widget getParent()
public Window getParentWindow()
public Window getWindow()
public Rectangle intersect(Rectangle area)
area
.
area
- The area to use to compute the intersection.
public boolean hasFocus()
public void grabFocus()
public void grabDefault()
public void setName(java.lang.String name)
name
- The name for the widget.public java.lang.String getName()
public void setSensitive(boolean sensitive)
sensitive
- Indicates if the widget should be sensitive.public boolean getSensitive()
public Widget getToplevel()
public Colormap getColormap()
public void setColormap(Colormap colormap)
colormap
- The colormap to be used.public Point getPointer()
public boolean isAncestor(Widget ancestor)
ancestor
- The possible parent widgetpublic void pushColormap(Colormap colormap)
colormap
- The Colormap to push onto the stack.public void popColormap()
public void shapeCombineMask(Bitmap shapeMask, int x, int y)
shapeMask
- Shape to be added or null to remove an existing shape.x
- X Position of the shape mask with respect to the window.y
- Y Position of the shape mask with respect to the window.public void setForegroundColor(StateType state, Color color)
state
- The widget state to modify.color
- The color to set the foreground.public void setBackgroundColor(StateType state, Color color)
state
- The widget state to modify.color
- The color to set the background.public void setTextColor(StateType state, Color color)
state
- The widget state to modify.color
- The color to set the text.public void setBaseColor(StateType state, Color color)
state
- The widget state to modify.color
- The color to set.public void setFont(FontDescription fontDesc)
fontDesc
- The font description to use.public void modifyStyle(RcStyle style)
style
- The style to apply to the Widgetpublic RcStyle getModifierStyle()
RcStyle
.
public Style getStyle()
Style
.
public Context createContext()
public Context getContext()
public Layout createLayout(java.lang.String text)
text
- The text used for the layout.
public void setDoubleBuffered(boolean doubleBuffered)
doubleBuffered
- Set if the widget should be double buffered.public AtkObject getAccessible()
public boolean canActivateAccel(int signalId)
public Screen getScreen()
public boolean hasScreen()
public Display getDisplay()
public Window getRootWindow()
public void setMinimumSize(int width, int height)
In most cases Window.setDefaultSize()
is a better choice for toplevel
windows than this method. Setting the default size will still allow users to shrink
the window. Setting the minimum size will force them to leave the window at
least as large as the request.
Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct.
If the minimum size in a given direction is -1 then the "natural" size for the widget will be used instead.
width
- The minimum width size to use.height
- The minimum height size to use.public java.lang.Class getEventListenerClass(java.lang.String signal)
getEventListenerClass
in class GObject
public EventType getEventType(java.lang.String signal)
getEventType
in class GObject
public void addListener(LifeCycleListener listener)
listener
- The object that has implemented the
LifeCycleListener interface that is to receive the life cycle events.public void removeListener(LifeCycleListener listener)
listener
- The object that is to no longer receive
life cycle events.protected void fireLifeCycleEvent(LifeCycleEvent event)
protected boolean fireBooleanLifeCycleEvent(LifeCycleEvent event, boolean defaultValue)
protected void handleShow()
protected void handleHide()
protected void handleRealize()
protected boolean handleDelete(Handle event)
protected void handleMap()
protected void handleUnmap()
public void addListener(FocusListener listener)
listener
- The object that has implemented the
FocusListener interface that is to receive the focus events.public void removeListener(FocusListener listener)
listener
- The object that is to no longer receive
focus events.protected boolean fireFocusEvent(FocusEvent event)
protected boolean handleFocusIn(Handle event)
protected boolean handleFocusOut(Handle event)
public void addListener(KeyListener listener)
An important thing to notice is that some widgets don't
receive low-level events (such as a key-press event) by default.
So if you want to capture events from them, you should add them to an
EventBox
, and capture events on the EventBox
.
The reason why this happens is that some widgets, for efficiency, don't have their own X window, which is necessary to receive events. These are the widgets that don't have their own X window:
Alignment
Arrow
Bin
Box
Image
Item
Label
Pixmap
ScrolledWindow
Separator
Table
AspectFrame
Frame
VBox
HBox
VSeparator
HSeparator
listener
- The object that has implemented the
KeyListener interface that is to receive the key events.public void removeListener(KeyListener listener)
listener
- The object that is to no longer receive
key events.protected boolean fireKeyEvent(KeyEvent event)
protected boolean handleKeyPressed(Handle event)
protected boolean handleKeyReleased(Handle event)
public void addListener(MouseListener listener)
An important thing to notice is that some widgets don't
receive low-level events (such as a mouse-click event) by default.
So if you want to capture events from them, you should add them to an
EventBox
, and capture events on the EventBox
.
The reason why this happens is that some widgets, for efficiency, don't have their own X window, which is necessary to receive events. These are the widgets that don't have their own X window:
Alignment
Arrow
Bin
Box
Image
Item
Label
Pixmap
ScrolledWindow
Separator
Table
AspectFrame
Frame
VBox
HBox
VSeparator
HSeparator
listener
- The object that has implemented the
MouseListener interface that is to receive the mouse events.public void removeListener(MouseListener listener)
listener
- The object that is to no longer receive
mouse events.protected boolean fireMouseEvent(MouseEvent event)
protected boolean handleButtonPressed(Handle event)
protected boolean handleButtonReleased(Handle event)
protected boolean handleScroll(Handle event)
protected boolean handleMouseEnter(Handle event)
protected boolean handleMouseLeave(Handle event)
protected static int findListener(java.util.Vector list, java.lang.Object listener)
list
- The Vector of listeners to search.listener
- The object that is to be located in the Vector.
public static Type getType()
public static Widget makeWidget(Handle handle) throws java.lang.ClassNotFoundException
handle
- The handle that represents a pointer to a
native resource.
java.lang.ClassNotFoundException
- if a Java-GNOME class cannot
be found for the specified handle.public void setDragSource(ModifierType buttons, TargetEntry[] targets, DragAction actions)
buttons
- Buttons which can start the dragtargets
- An array of names of drag and drop operations accepted
(these are made up by the application designers. Widgets must set as drag
sources and destinations with one of these the same)actions
- Drag action - determines which events will be called.public void setNoDragSource()
public void setDragIcon(Widget widget, Colormap cmap, Pixmap pixmap, Bitmap mask)
public void setDragIconPixbuf(Widget widget, Pixbuf pixbuf)
public void setDragIconStock(Widget widget, java.lang.String stockId)
public void setDragDestination(DestDefaults flags, TargetEntry[] targets, DragAction actions)
flags
- public void setNoDragDestination()
public static void getData(Widget widget, DragContext context, int target)
public static void finish(DragContext context, boolean success, boolean delete)
public static void highlight(Widget widget)
public static void unHighlight(Widget widget)
public void addListener(DragDestinationListener listener)
listener
- The object that has implemented the
DragDestinationListener interfacepublic void removeListener(DragDestinationListener listener)
listener
- The object that is to no longer receive
dragDestination eventsprotected void fireDragDestinationEvent(Widget widget, DragContext dragContext, int x, int y, SelectionData data, int id, int time)
protected void handleDragDestination(Handle context, int x, int y, Handle data, int id, int time)
public void addListener(DragSourceListener listener)
listener
- The object that has implemented the
DragSourceListener interfacepublic void removeListener(DragSourceListener listener)
listener
- The object that is to no longer receive
drag source eventsprotected void fireDragSourceEvent(Widget widget, DragContext dragContext, SelectionData data, int id, int time)
protected void handleDragDataGet(Handle context, Handle data, int id, int time)
public void addListener(ExposeListener listener)
listener
- The object that has implemented the
ExposeListener interface that is to receive the
expose events.public void removeListener(ExposeListener listener)
listener
- The object that is to no longer receive
expose events.protected boolean fireExposeEvent(ExposeEvent event)
protected boolean handleExpose(Handle event)
protected boolean handleNoExpose(Handle event)
public void addListener(MouseMotionListener listener)
An important thing to notice is that some widgets don't
receive low-level events (such as a mouse-enter event) by default.
So if you want to capture events from them, you should add them to an
EventBox
, and capture events on the EventBox
.
The reason why this happens is that some widgets, for efficiency, don't have their own X window, which is necessary to receive events. These are the widgets that don't have their own X window:
Alignment
Arrow
Bin
Box
Image
Item
Label
Pixmap
ScrolledWindow
Separator
Table
AspectFrame
Frame
VBox
HBox
VSeparator
HSeparator
listener
- The object that has implemented the
MouseMotionListener interface that is to receive the
mouse motion events.public void removeListener(MouseMotionListener listener)
listener
- The object that is to no longer receive
mouse motion events.protected boolean fireMouseMotionEvent(MouseMotionEvent event)
protected boolean handleMouseMotion(Handle event)
protected static final int gtk_widget_get_type()
protected static final Handle gtk_widget_ref(Handle widget)
protected static final void gtk_widget_unref(Handle widget)
protected static final void gtk_widget_destroy(Handle widget)
protected static final void gtk_widget_destroyed(Handle widget, Handle[] widgetPointer)
protected static final void gtk_widget_unparent(Handle widget)
protected static final void gtk_widget_show(Handle widget)
protected static final void gtk_widget_show_now(Handle widget)
protected static final void gtk_widget_hide(Handle widget)
protected static final void gtk_widget_show_all(Handle widget)
protected static final void gtk_widget_hide_all(Handle widget)
protected static final void gtk_widget_map(Handle widget)
protected static final void gtk_widget_unmap(Handle widget)
protected static final void gtk_widget_realize(Handle widget)
protected static final void gtk_widget_unrealize(Handle widget)
protected static final void gtk_widget_queue_draw(Handle widget)
protected static final void gtk_widget_queue_draw_area(Handle widget, int x, int y, int width, int height)
protected static final void gtk_widget_queue_resize(Handle widget)
protected static final void gtk_widget_size_request(Handle widget, Handle requisition)
protected static final void gtk_widget_get_child_requisition(Handle widget, Handle[] requisition)
protected static final void gtk_widget_size_allocate(Handle widget, Handle allocation)
protected static final void gtk_widget_add_accelerator(Handle widget, java.lang.String accelSignal, Handle accelGroup, int accelKey, int accelMods, int accelFlags)
protected static final boolean gtk_widget_remove_accelerator(Handle widget, Handle accelGroup, int accelKey, int accelMods)
protected static final void gtk_widget_set_accel_path(Handle widget, java.lang.String accelPath, Handle accelGroup)
protected static final int gtk_widget_list_accel_closures(Handle widget)
protected static final boolean gtk_widget_can_activate_accel(Handle widget, int signalId)
protected static final boolean gtk_widget_mnemonic_activate(Handle widget, boolean groupCycling)
protected static final boolean gtk_widget_event(Handle widget, Handle event)
protected static final int gtk_widget_send_expose(Handle widget, Handle event)
protected static final boolean gtk_widget_activate(Handle widget)
protected static final void gtk_widget_set_scroll_adjustments(Handle widget, Handle hadj, Handle vadj)
protected static final void gtk_widget_reparent(Handle widget, Handle newParent)
protected static final boolean gtk_widget_intersect(Handle widget, Handle area, Handle intersection)
protected static final int gtk_widget_region_intersect(Handle widget, Handle region)
protected static final void gtk_widget_freeze_child_notify(Handle widget)
protected static final void gtk_widget_child_notify(Handle widget, java.lang.String childProperty)
protected static final void gtk_widget_thaw_child_notify(Handle widget)
protected static final boolean gtk_widget_is_focus(Handle widget)
protected static final void gtk_widget_grab_focus(Handle widget)
protected static final void gtk_widget_grab_default(Handle widget)
protected static final void gtk_widget_set_name(Handle widget, java.lang.String name)
protected static final java.lang.String gtk_widget_get_name(Handle widget)
protected static final void gtk_widget_set_state(Handle widget, int state)
protected static final void gtk_widget_set_sensitive(Handle widget, boolean sensitive)
protected static final void gtk_widget_set_app_paintable(Handle widget, boolean appPaintable)
protected static final void gtk_widget_set_double_buffered(Handle widget, boolean doubleBuffered)
protected static final void gtk_widget_set_redraw_on_allocate(Handle widget, boolean redrawOnAllocate)
protected static final void gtk_widget_set_parent(Handle widget, Handle parent)
protected static final void gtk_widget_set_parent_window(Handle widget, Handle parent)
protected static final void gtk_widget_set_child_visible(Handle widget, boolean isVisible)
protected static final boolean gtk_widget_get_child_visible(Handle widget)
protected static final Handle gtk_widget_get_parent(Handle widget)
protected static final Handle gtk_widget_get_parent_window(Handle widget)
protected static final Handle gtk_widget_get_window(Handle widget)
protected static final boolean gtk_widget_child_focus(Handle widget, int direction)
protected static final void gtk_widget_set_size_request(Handle widget, int width, int height)
protected static final void gtk_widget_get_size_request(Handle widget, int[] width, int[] height)
protected static final void gtk_widget_set_events(Handle widget, int events)
protected static final void gtk_widget_add_events(Handle widget, int events)
protected static final void gtk_widget_set_extension_events(Handle widget, int mode)
protected static final int gtk_widget_get_extension_events(Handle widget)
protected static final Handle gtk_widget_get_toplevel(Handle widget)
protected static final Handle gtk_widget_get_ancestor(Handle widget, int widgetType)
protected static final Handle gtk_widget_get_colormap(Handle widget)
protected static final Handle gtk_widget_get_visual(Handle widget)
protected static final Handle gtk_widget_get_screen(Handle widget)
protected static final boolean gtk_widget_has_screen(Handle widget)
protected static final Handle gtk_widget_get_display(Handle widget)
protected static final Handle gtk_widget_get_root_window(Handle widget)
protected static final boolean gtk_widget_get_sensitive(Handle widget)
protected static final Handle gtk_widget_get_settings(Handle widget)
protected static final Handle gtk_widget_get_accessible(Handle widget)
protected static final void gtk_widget_set_colormap(Handle widget, Handle cmap)
protected static final int gtk_widget_get_events(Handle widget)
protected static final void gtk_widget_get_pointer(Handle widget, int[] x, int[] y)
protected static final boolean gtk_widget_is_ancestor(Handle widget, Handle ancestor)
protected static final boolean gtk_widget_translate_coordinates(Handle srcWidget, Handle destWidget, int srcX, int srcY, int[] destX, int[] destY)
protected static final boolean gtk_widget_hide_on_delete(Handle widget)
protected static final void gtk_widget_set_style(Handle widget, Handle style)
protected static final void gtk_widget_ensure_style(Handle widget)
protected static final Handle gtk_widget_get_style(Handle widget)
protected static final void gtk_widget_modify_style(Handle widget, Handle style)
protected static final Handle gtk_widget_get_modifier_style(Handle widget)
protected static final void gtk_widget_modify_fg(Handle widget, int state, Handle color)
protected static final void gtk_widget_modify_bg(Handle widget, int state, Handle color)
protected static final void gtk_widget_modify_text(Handle widget, int state, Handle color)
protected static final void gtk_widget_modify_base(Handle widget, int state, Handle color)
protected static final void gtk_widget_modify_font(Handle widget, Handle fontDesc)
protected static final Handle gtk_widget_create_pango_context(Handle widget)
protected static final Handle gtk_widget_get_pango_context(Handle widget)
protected static final Handle gtk_widget_create_pango_layout(Handle widget, java.lang.String text)
protected static final Handle gtk_widget_render_icon(Handle widget, java.lang.String stockID, int size, java.lang.String detail)
protected static final void gtk_widget_set_composite_name(Handle widget, java.lang.String name)
protected static final java.lang.String gtk_widget_get_composite_name(Handle widget)
protected static final void gtk_widget_reset_rc_styles(Handle widget)
protected static final void gtk_widget_push_colormap(Handle cmap)
protected static final void gtk_widget_pop_colormap()
protected static final void gtk_widget_push_composite_child()
protected static final void gtk_widget_pop_composite_child()
protected static final void gtk_widget_style_get_property(Handle widget, java.lang.String propertyName, Handle value)
protected static final void gtk_widget_set_default_colormap(Handle cmap)
protected static final Handle gtk_widget_get_default_colormap()
protected static final Handle gtk_widget_get_default_visual()
protected static final Handle gtk_widget_get_default_style()
protected static final void gtk_widget_set_direction(Handle widget, int dir)
protected static final int gtk_widget_get_direction(Handle widget)
protected static final void gtk_widget_set_default_direction(int dir)
protected static final int gtk_widget_get_default_direction()
protected static final void gtk_widget_shape_combine_mask(Handle widget, Handle shapeMask, int offsetX, int offsetY)
protected static final void gtk_widget_path(Handle widget, int[] pathLength, java.lang.String[] path, java.lang.String[] pathReversed)
protected static final void gtk_widget_class_path(Handle widget, int[] pathLength, java.lang.String[] path, java.lang.String[] pathReversed)
protected static final Handle[] gtk_widget_list_mnemonic_labels(Handle widget)
protected static final void gtk_widget_add_mnemonic_label(Handle widget, Handle label)
protected static final void gtk_widget_remove_mnemonic_label(Handle widget, Handle label)
protected static final void gtk_drag_source_set(Handle widget, int start_button_mask, Handle[] targets, int actions)
protected static final void gtk_drag_source_unset(Handle widget)
protected static final void gtk_drag_source_set_icon(Handle widget, Handle colormap, Handle pixmap, Handle mask)
protected static final void gtk_drag_source_set_icon_pixbuf(Handle widget, Handle pixbuf)
protected static final void gtk_drag_source_set_icon_stock(Handle widget, java.lang.String stockId)
protected static final void gtk_drag_get_data(Handle widget, Handle context, int target)
protected static final void gtk_drag_finish(Handle context, boolean success, boolean delete)
protected static final void gtk_drag_highlight(Handle widget)
protected static final void gtk_drag_unhighlight(Handle widget)
protected static final void gtk_drag_dest_set(Handle widget, int flags, Handle[] targets, int actions)
protected static final void gtk_drag_dest_unset(Handle widget)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |