|
java-gnome version 4.0.7 | ||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
java.lang.Objectorg.freedesktop.bindings.Proxy
org.gnome.glib.Boxed
org.gnome.gtk.Requisition
public final class Requisition
The size that will be (is being) requested by a Widget. You get the
Requisition object for a given Widget by calling that its
getRequisition() method.
As a general principle across GTK programming, we encourage people to leave Widgets alone to work out their own needs. You will not be able to forecast the impact of a user's fonts, accessibility settings, and theme engine, not to mention the actual implementation of the Containers you are packing your Widget into. The great part is that you don't need to; the GNOME libraries are really good at Doing The Right Thing (tm) and you will do well by them.
When an occasion does arise where you need to force one or both dimensions, you can either:
setSizeRequest();
SizeGroup to influence a set of related Widgets to have
a dimension in common; or
setBorderWidth().
GTK's box packing model works on a size-request/size-allocation process.
Each Widget is asked by it's parent Container how much space it wants on
the screen, in pixels. These requests are aggregated and in
turn represented up the tree until the top-level Window is reached. The
Window then negotiates with the window manager and with the X server, with
the result being that the Window is allocated. The Containers
start divvying up the allocation they were given amongst their children
according to whatever algorithms and settings are in place. Eventually your
Widget will be told how much space it has been given in it's
Allocation object, and it will have to then carry on accordingly.
The important point to note here is that requests are just that; a Widget
must be able to cope with any size down to 1x1. Ideally it
will degrade gracefully, although that's not always easy.
This object is a live reference to the requisition field
in the GtkWidget struct and so calling the getter methods
will yield correct current values once you've got the Requisition object
for the Widget you are interested in.
| Method Summary | |
|---|---|
int |
getHeight()
The height that has been requested. |
int |
getWidth()
The width that has been requested. |
| Methods inherited from class org.freedesktop.bindings.Proxy |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public int getHeight()
public int getWidth()
|
![]() java-gnome |
||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||