org.gnome.gtk
Class Window
java.lang.Object
org.freedesktop.bindings.Proxy
The top level Widget that contains other Widgets. Typical examples are
application windows, dialog boxes, and popup menus.
- Andrew Cowie
- Srichand Pendyala
static interface | Window.DELETE - This signal arises when a user tries to close a top level window.
|
void | connect(Window.DELETE handler)
|
void | setDecorated(boolean decorated) - By default, Windows are decorated with a title bar,
minimize/maximize/close buttons, a border, resize handles, etc.
|
void | setDefaultSize(int width, int height) - Sets the default size of a Window.
|
void | setTitle(String title) - Sets the title that will be displayed in the Window's title bar.
|
Window
public Window()
Create a new Window.
Window
public Window(WindowType type)
Create a new Window of the specified type. In general you don't need to
use this; see the comments in
WindowType
; in particular,
POPUP
is
not for dialog
windows!
setDecorated
public void setDecorated(boolean decorated)
By default, Windows are decorated with a title bar,
minimize/maximize/close buttons, a border, resize handles, etc. This
isn't done by your program, though - it's automatically by the window
manager which is a part of your desktop. Some window managers allow GTK
to disable these decorations, creating a borderless window. If you set
the decorated property to
false
using this method, GTK
will do its best to convince the window manager not to decorate the
Window.
- You will have no problem creating undecorated Windows on a GNOME
desktop.
- Apparently, turning off decorations will not work if the Window is
already visible on some systems. So if you're going to use
setDecorated(false)
, call it before invoking
show()
on the Window.
setDefaultSize
public void setDefaultSize(int width,
int height)
Sets the default size of a Window. If the Window's "natural" size (the
size request resulting from the aggregate requests of all the Widgets
contained in this Window) is larger than the default, the default will
be ignored. The default size of a Window only affects the first time a
Window is shown; if a Window is hidden and re-shown, it will remember
the size it had prior to hiding, rather than using the default size.
Depending on your needs,
resize()
could be more
appropriate, especially if the Window is already realized . resize()
changes the current size of the Window, rather than the size to be used
on initial display which is what this method is for.
Incidentally, Windows can't be 0x0; the minimum size is 1x1.
width
- The default minimum width you'd like to set. A value of 0
will be silently bumped to 1. A value of -1 will unset any
previous default width setting.height
- Same.
setTitle
public void setTitle(String title)
Sets the title that will be displayed in the Window's title bar.
The title of a Window is an important usability factor. It should help
the user distinguish this Window from others they may have open - and
that gets tough when many, many applications are running. The key is to
get the most relevant information is first. Examples of good titles
are:
- Invoice.odt
- Invoice.odt - OpenOffice
- andrew@procyon:~/src
- Audio Configuration
This is important because the list of Windows titles the user is
looking at may have been truncated with the result that you can't tell
the difference between different Windows of the same application. For
example, these are no good if you can only see the first 20 characters
of the title:
- OpenOffice 2.0.4 brought to you by the letter B! -
Invoice.odt
- OpenOffice 2.0.4 brought to you by the letter B! -
LoveLetter.odt
Don't forget that Windows also have an icon, and that icon will show in
the list too, so you don't even really need the application name -
leaving more room for the details that help identify this Window
uniquely.
|  java-gnome |