A Window is a window that can be displayed on the screen. It also
is a container that can hold a single child widget. It is common to
have the window in Window supply the margin around the window of
the contained widget.
addAccelGroup
public void addAccelGroup(AccelGroup accelGroup)
Associate accesGroup
with the window.
accelGroup
- The AccelGroup to associate with this window.
deiconify
public void deiconify()
Asks to deiconify the specified Window.
fullscreen
public void fullscreen()
getAcceptFocus
public boolean getAcceptFocus()
getDefaultIconList
public static Pixbuf[] getDefaultIconList()
Gets the icons set by setDefaultIconList
.
- the list of icons
getFocusOnMap
public boolean getFocusOnMap()
- TRUE if window should receive the input focus when mapped.
getFocusWidget
public Widget getFocusWidget()
Retrieves the current focused Widget within the window.
- The Widget that has focus.
getGravity
public Gravity getGravity()
Gets the value set by setGravity()
.
- The Gravity for the Window.
getIcon
public Pixbuf getIcon()
Returns the icon representing the Window.
getIconList
public Pixbuf[] getIconList()
Retrieves the list of icons set by setIconList(). The list is
copied, but the reference count on each member won't be incremented.
getIconName
public String getIconName()
Returns the name of the themed icon for the window.
- The icon name or NULL if the window has no themed icon.
getPosition
public Point getPosition()
Retuns the current position of the window.
- The position of the window.
getScreen
public Screen getScreen()
Returns the GdkScreen associated with this window.
- getScreen in interface Widget
getSize
public Requisition getSize()
Returns the current size of a Window. If the window is not onscreen, it
returns the size that will be suggested to the window manager for the
initial window size.
- The size of the Window.
getSkipPagerHint
public boolean getSkipPagerHint()
Returns whether the window should appear in the pager.
getSkipTaskbarHint
public boolean getSkipTaskbarHint()
Returns whether this window should appear in the task bar.
getTitle
public String getTitle()
Returns the title for the Window object
- A string containing the title.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
- getType in interface Bin
gtk_window_activate_default
protected static final boolean gtk_window_activate_default(Handle window)
gtk_window_activate_focus
protected static final int gtk_window_activate_focus(Handle window)
gtk_window_add_accel_group
protected static final void gtk_window_add_accel_group(Handle window,
Handle accelGroup)
gtk_window_add_mnemonic
protected static final void gtk_window_add_mnemonic(Handle window,
int keyval,
Handle target)
gtk_window_begin_move_drag
protected static final void gtk_window_begin_move_drag(Handle window,
int button,
int rootX,
int rootY,
int timestamp)
gtk_window_begin_resize_drag
protected static final void gtk_window_begin_resize_drag(Handle window,
int edge,
int button,
int rootX,
int rootY,
int timestamp)
gtk_window_deiconify
protected static final void gtk_window_deiconify(Handle window)
gtk_window_fullscreen
protected static final void gtk_window_fullscreen(Handle window)
gtk_window_get_accept_focus
protected static final boolean gtk_window_get_accept_focus(Handle window)
gtk_window_get_decorated
protected static final boolean gtk_window_get_decorated(Handle window)
gtk_window_get_default_icon_list
protected static final Handle[] gtk_window_get_default_icon_list()
gtk_window_get_default_size
protected static final void gtk_window_get_default_size(Handle window,
int[] width,
int[] height)
gtk_window_get_destroy_with_parent
protected static final boolean gtk_window_get_destroy_with_parent(Handle window)
gtk_window_get_focus
protected static final Handle gtk_window_get_focus(Handle window)
gtk_window_get_frame_dimensions
protected static final void gtk_window_get_frame_dimensions(Handle window,
int[] left,
int[] top,
int[] right,
int[] bottom)
gtk_window_get_gravity
protected static final int gtk_window_get_gravity(Handle window)
gtk_window_get_has_frame
protected static final boolean gtk_window_get_has_frame(Handle window)
gtk_window_get_icon
protected static final Handle gtk_window_get_icon(Handle window)
gtk_window_get_icon_list
protected static final Handle[] gtk_window_get_icon_list(Handle window)
gtk_window_get_mnemonic_modifier
protected static final int gtk_window_get_mnemonic_modifier(Handle window)
gtk_window_get_modal
protected static final boolean gtk_window_get_modal(Handle window)
gtk_window_get_position
protected static final void gtk_window_get_position(Handle window,
int[] rootX,
int[] rootY)
gtk_window_get_resizable
protected static final boolean gtk_window_get_resizable(Handle window)
gtk_window_get_role
protected static final String gtk_window_get_role(Handle window)
gtk_window_get_screen
protected static final Handle gtk_window_get_screen(Handle window)
gtk_window_get_size
protected static final void gtk_window_get_size(Handle window,
int[] width,
int[] height)
gtk_window_get_skip_pager_hint
protected static final boolean gtk_window_get_skip_pager_hint(Handle window)
gtk_window_get_skip_taskbar_hint
protected static final boolean gtk_window_get_skip_taskbar_hint(Handle window)
gtk_window_get_title
protected static final String gtk_window_get_title(Handle window)
gtk_window_get_transient_for
protected static final Handle gtk_window_get_transient_for(Handle window)
gtk_window_get_type
protected static final int gtk_window_get_type()
gtk_window_get_type_hint
protected static final int gtk_window_get_type_hint(Handle window)
gtk_window_has_toplevel_focus
protected static final boolean gtk_window_has_toplevel_focus(Handle window)
gtk_window_iconify
protected static final void gtk_window_iconify(Handle window)
gtk_window_is_active
protected static final boolean gtk_window_is_active(Handle window)
gtk_window_list_toplevels
protected static final Handle[] gtk_window_list_toplevels()
gtk_window_maximize
protected static final void gtk_window_maximize(Handle window)
gtk_window_mnemonic_activate
protected static final boolean gtk_window_mnemonic_activate(Handle window,
int keyval,
int modifier)
gtk_window_move
protected static final void gtk_window_move(Handle window,
int x,
int y)
gtk_window_new
protected static final Handle gtk_window_new(int type)
gtk_window_parse_geometry
protected static final boolean gtk_window_parse_geometry(Handle window,
String geometry)
gtk_window_present
protected static final void gtk_window_present(Handle window)
gtk_window_remove_accel_group
protected static final void gtk_window_remove_accel_group(Handle window,
Handle accelGroup)
gtk_window_remove_mnemonic
protected static final void gtk_window_remove_mnemonic(Handle window,
int keyval,
Handle target)
gtk_window_resize
protected static final void gtk_window_resize(Handle window,
int width,
int height)
gtk_window_set_accept_focus
protected static final void gtk_window_set_accept_focus(Handle window,
boolean setting)
gtk_window_set_auto_startup_notification
protected static final void gtk_window_set_auto_startup_notification(boolean setting)
gtk_window_set_decorated
protected static final void gtk_window_set_decorated(Handle window,
boolean setting)
gtk_window_set_default
protected static final void gtk_window_set_default(Handle window,
Handle defaultWidget)
gtk_window_set_default_icon
protected static final void gtk_window_set_default_icon(Handle icon)
gtk_window_set_default_icon_from_file
protected static final boolean gtk_window_set_default_icon_from_file(String filename)
gtk_window_set_default_icon_list
protected static final void gtk_window_set_default_icon_list(Handle[] list)
gtk_window_set_default_size
protected static final void gtk_window_set_default_size(Handle window,
int width,
int height)
gtk_window_set_destroy_with_parent
protected static final void gtk_window_set_destroy_with_parent(Handle window,
boolean setting)
gtk_window_set_focus
protected static final void gtk_window_set_focus(Handle window,
Handle focus)
gtk_window_set_frame_dimensions
protected static final void gtk_window_set_frame_dimensions(Handle window,
int left,
int top,
int right,
int bottom)
gtk_window_set_geometry_hints
protected static final void gtk_window_set_geometry_hints(Handle window,
Handle geometryWidget,
Handle geometry,
int geomMask)
gtk_window_set_gravity
protected static final void gtk_window_set_gravity(Handle window,
int gravity)
gtk_window_set_has_frame
protected static final void gtk_window_set_has_frame(Handle window,
boolean setting)
gtk_window_set_icon
protected static final void gtk_window_set_icon(Handle window,
Handle icon)
gtk_window_set_icon_from_file
protected static final boolean gtk_window_set_icon_from_file(Handle window,
String filename)
gtk_window_set_icon_list
protected static final void gtk_window_set_icon_list(Handle window,
Handle[] list)
gtk_window_set_keep_above
protected static final void gtk_window_set_keep_above(Handle window,
boolean setting)
gtk_window_set_keep_below
protected static final void gtk_window_set_keep_below(Handle window,
boolean setting)
gtk_window_set_mnemonic_modifier
protected static final void gtk_window_set_mnemonic_modifier(Handle window,
int modifier)
gtk_window_set_modal
protected static final void gtk_window_set_modal(Handle window,
boolean modal)
gtk_window_set_position
protected static final void gtk_window_set_position(Handle window,
int position)
gtk_window_set_resizable
protected static final void gtk_window_set_resizable(Handle window,
boolean resizable)
gtk_window_set_role
protected static final void gtk_window_set_role(Handle window,
String role)
gtk_window_set_screen
protected static final void gtk_window_set_screen(Handle window,
Handle screen)
gtk_window_set_skip_pager_hint
protected static final void gtk_window_set_skip_pager_hint(Handle window,
boolean skip)
gtk_window_set_skip_taskbar_hint
protected static final void gtk_window_set_skip_taskbar_hint(Handle window,
boolean skip)
gtk_window_set_title
protected static final void gtk_window_set_title(Handle window,
String title)
gtk_window_set_transient_for
protected static final void gtk_window_set_transient_for(Handle window,
Handle parent)
gtk_window_set_type_hint
protected static final void gtk_window_set_type_hint(Handle window,
int hint)
gtk_window_set_wmclass
protected static final void gtk_window_set_wmclass(Handle window,
String wmclassName,
String wmclassClass)
gtk_window_stick
protected static final void gtk_window_stick(Handle window)
gtk_window_unfullscreen
protected static final void gtk_window_unfullscreen(Handle window)
gtk_window_unmaximize
protected static final void gtk_window_unmaximize(Handle window)
gtk_window_unstick
protected static final void gtk_window_unstick(Handle window)
hasToplevelFocus
public boolean hasToplevelFocus()
Returns whether the input focus is within this Window. For real toplevel
windows, this is identical to
isActive()
, but for embedded
windows, like
Plug
, the results will differ.
iconify
public void iconify()
Asks to iconify the Window. Note that you shouldn't assume the Window is
iconified afterward because other entities could deiconify it again or there may
not be a window manager in which case iconification is not possible.
isActive
public boolean isActive()
Returns whether the window is part of the current active toplevel.
(That is, the toplevel window receiving keystrokes.) The return value
is TRUE if the window is active toplevel itself, but also if it is, say,
a
Plug
embedded in the active toplevel. You might use this
method if you wanted to draw a widget differently in an active window
from a widget in an inactive window.
listToplevelWindows
public static Window[] listToplevelWindows()
Returns a list of all existing toplevel windows.
- the array containing the windows
maximize
public void maximize()
Asks to maximize the Window so it becomes full-screen.
move
public void move(int x,
int y)
Ask the window manager to move the Window to a given location. Window
managers are free to ignore this request. Most window managers ignore the
request for the initial window position but honor the request after the window
has been shown.
x
- The x coordinate for the move.y
- The y coordinate for the move.
present
public void present()
Presents a window to the user. This may mean raising the window in the
stack order, deiconifying it, moving it to the current desktop, and/or giving
it the keyboard focus, possibly dependent on the user's platform, window
manager, and preferences. If the Window is hidden it will also call
show
as well.
removeAccelGroup
public void removeAccelGroup(AccelGroup accelGroup)
Reverses the effect of addAccelGroup
.
accelGroup
- The AccelGroup to disassociate with this window.
resize
public void resize(int width,
int height)
Resizes the Window as if the user had done so, obeying the geometry
constraints.
width
- The width for the resized Window.height
- The height for the resized Window.
setAcceptFocus
public void setAcceptFocus(boolean acceptFocus)
setAutoStartupNotification
public static void setAutoStartupNotification(boolean setting)
setDecorated
public void setDecorated(boolean setting)
By default Windows are decorated by a titlebar, resize controls, etc. Some
window managers allow you to disable these decorations, creating a borderless
Window. This method allows you to change teh decorated setting for the Window.
setting
- Determines if the Window should be decorated.
setDefaultIcon
public static void setDefaultIcon(Pixbuf icon)
setDefaultIconFromFile
public static boolean setDefaultIconFromFile(String filename)
Sets an icon to be used as fallback for windows that haven't had
setIconList() called on them from a file on disk.
filename
- the path to the icon
true
if it was sucessfully set,
false
otherwise.
setIconName(String)
setDefaultIconList
public static void setDefaultIconList(Pixbuf[] icons)
Sets up the icon representing a Window. The icon is used when the
window is minimized (also known as iconified). Some window managers or
desktop environments may also place it in the window frame, or display
it in other contexts.
This method allows you to pass in the same icon in several
hand-drawn sizes. The list should contain the natural sizes your icon is
available in; that is, don't scale the image before passing it to GTK+.
Scaling is postponed until the last minute, when the desired final size
is known, to allow best quality.
By passing several sizes, you may improve the final image quality of the
icon, by reducing or eliminating automatic image scaling.
Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and larger
images (64x64, 128x128) if you have them.
Note that this method sets the icon for all windows in your application
in one go.
icons
- the list of icons to use.
setDefaultIconName
public void setDefaultIconName(String name)
Sets an icon to be used as fallback for windows that haven't had
setIconList
called on them from a named themed icon.
setIconName(String)
setDefaultSize
public void setDefaultSize(int width,
int height)
Sets the default size for a Window. If a Window's natural size is larger
than the default, the default will be ignored.
width
- The width to set for the default size.height
- the height to set for the default size.
setDefaultWidget
public void setDefaultWidget(Widget defaultWidget)
The default widget is the widget that is activated when the user presses the
Enter key. This method will set defaultWidget to the default widget for the
Window.
defaultWidget
- The widget that should become the default widget.
setFocusOnMap
public void setFocusOnMap(boolean setting)
Windows may set a hint asking the desktop environment not to receive
the input focus when the window is mapped. This function sets this hint.
setting
- TRUE to let this window receive input focus on map.
setFocusWidget
public void setFocusWidget(Widget focus)
If focus
is not the current focus widget and is focusable, set it as the
focus widget for the window.
focus
- The widget to receive focus for the Window.
setGeometryHints
public void setGeometryHints(Widget geometryWidget,
Geometry geometry,
WindowHints geomMask)
This method sets up hints about how a Window can be resized
by the user. You can set a minimum and maximum size, allowable
resize increments, aspect ratios and more.
geometryWidget
- The Widget the geometry hints will be applied to.geometry
- The geometry information.geomMask
- Mask indicating which fields should be paid attention to.
setGravity
public void setGravity(Gravity gravity)
Window gravity defines the meaning of coordinates passed to move()
.
gravity
- The window gravity.
setIcon
public void setIcon(Pixbuf icon)
Sets up the icon representing a Window. The icon is used when
the Window is minimized.
icon
- The Icon to use for this Window.
setIconFromFile
public boolean setIconFromFile(String filename)
Sets the icon for this window.
filename
- the full path to the icon
true
if the icon was sucessfully set,
false
otherwise.
setIconList
public void setIconList(Pixbuf[] icons)
Sets up the icon representing a GtkWindow. The icon is
used when the window is minimized (also known as iconified).
Some window managers or desktop environments may also place
it in the window frame, or display it in other contexts.
setIconList allows you to pass in the same icon in several
hand-drawn sizes. The list should contain the natural sizes
your icon is available in; that is, don't scale the image
before passing it. Scaling is postponed until the last minute,
when the desired final size is known, to allow best quality.
By passing several sizes, you may improve the final image
quality of the icon, by reducing or eliminating automatic
image scaling.
Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum,
and larger images (64x64, 128x128) if you have them.
setIconName
public void setIconName(String name)
Sets the icon for the window from a named themed icon. See the docs
for
IconTheme
for more details.
Note that this has nothing to do with the WM_ICON_NAME property which
is mentioned in the ICCCM.
name
- The name of the themed icon.
setKeepAbove
public void setKeepAbove(boolean setting)
setKeepBelow
public void setKeepBelow(boolean setting)
setModal
public void setModal(boolean modal)
Sets a window modal or non-modal.
modal
- Indicates whether the window should be modal or not.
setPosition
public void setPosition(WindowPosition position)
Sets a position constraint for this window. If the old or new constraint
is
WindowPosition.CENTER_ALWAYS
, this will also cause the window
to be repositioned to satisfy the new constraint.
position
- A position constraint.
setResizable
public void setResizable(boolean resizable)
Sets whether the user can resize the window. Windows are user
resizable by default.
resizable
- Determines if the window can be resized.
setScreen
public void setScreen(Screen screen)
Sets the Screen where the window is displayed; if the window is already
mapped, it will be unmapped, and then remapped on the new screen.
screen
- the new screen.
setSkipPagerHint
public void setSkipPagerHint(boolean skipHint)
Set to true to keep the window from appearing in the pager.
skipHint
-
setSkipTaskbarHint
public void setSkipTaskbarHint(boolean skipHint)
Set to true to keep this window from appearing in the task bar.
skipHint
-
setTitle
public void setTitle(String title)
Set the title for this Window object
title
- A string containing the title for this Window
stick
public void stick()
Asks to stick the window. This means that the window appear on all
user desktops. Note that you shouldn't assume that the Window is
definately stuck after calling this method. Other entities could unstick
the Window or the window manager may not support this feature.
unfullscreen
public void unfullscreen()
unmaximize
public void unmaximize()
Asks to unmaximize the Window so it becomes it normal size.
unstick
public void unstick()
Asks to unstick the window.