forked from AuroraMiddleware/gtk
71337db92e
Thu Sep 7 14:15:03 2000 Owen Taylor <otaylor@redhat.com> * gdk/* gtk/*: Move gtk-reference files into GTK+ tree proper. * Update sections.txt files to correspond to current code, tweak .sgml files and Makefiles to correspond. * gtk/tmpl/gtkradiomenuitem.sgml (this): Remove extra <para>
283 lines
5.8 KiB
Plaintext
283 lines
5.8 KiB
Plaintext
<!-- ##### SECTION Title ##### -->
|
|
GtkWindow
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### STRUCT GtkWindow ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_new ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@type:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_set_title ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@title:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_set_wmclass ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@wmclass_name:
|
|
@wmclass_class:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_set_policy ##### -->
|
|
<para>
|
|
Changes how a toplevel window deals with its size request and user resize
|
|
attempts. There are really only two reasonable ways to call this function:
|
|
<orderedlist>
|
|
<listitem>
|
|
<para>
|
|
<literal>gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE)</literal>
|
|
means that the window is user-resizable.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE)</literal>
|
|
means that the window's size is program-controlled, and should simply match
|
|
the current size request of the window's children.
|
|
</para>
|
|
</listitem>
|
|
</orderedlist>
|
|
The first policy is the default, that is, by default windows are designed to
|
|
be resized by users.
|
|
</para>
|
|
|
|
<para>
|
|
The basic ugly truth of this function is that it should be simply:
|
|
<programlisting>
|
|
void gtk_window_set_user_resizeable(GtkWidget* window, gboolean setting);
|
|
</programlisting>
|
|
So, pretend it is like that, and only use the two policies mentioned above.
|
|
GTK+ 1.4 may replace gtk_window_set_policy() with a nicer function like
|
|
gtk_window_set_user_resizeable().
|
|
</para>
|
|
|
|
<para>
|
|
If set to TRUE, the @allow_grow parameter allows the user to expand the window
|
|
beyond the size request of its child widgets. If @allow_grow is TRUE, be sure to
|
|
check that your child widgets work properly as the window is resized.
|
|
</para>
|
|
|
|
<para>
|
|
A toplevel window will always change size to ensure its child widgets receive
|
|
their requested size. This means that if you add child widgets, the toplevel
|
|
window will expand to contain them. However, normally the toplevel will not
|
|
shrink to fit the size request of its children if it's too large; the
|
|
@auto_shrink parameter causes the window to shrink when child widgets have too
|
|
much space. @auto_shrink is normally used with the second of the two window
|
|
policies mentioned above. That is, set @auto_shrink to TRUE if you want the
|
|
window to have a fixed, always-optimal size determined by your program.
|
|
</para>
|
|
|
|
<para>
|
|
Note that @auto_shrink doesn't do anything if @allow_shrink and @allow_grow are
|
|
both set to FALSE.
|
|
</para>
|
|
|
|
<para>
|
|
Neither of the two suggested window policies set the @allow_shrink paramter to
|
|
TRUE. If @allow_shrink is TRUE, the user can shrink the window so that its
|
|
children do not receive their full size request; this is basically a bad thing,
|
|
because most widgets will look wrong if this happens. Furthermore GTK+ has a
|
|
tendency to re-expand the window if size is recalculated for any reason. The
|
|
upshot is that @allow_shrink should always be set to FALSE.
|
|
</para>
|
|
|
|
<para>
|
|
Sometimes when you think you want to use @allow_shrink, the real problem is that
|
|
some specific child widget is requesting too much space, so the user can't
|
|
shrink the window sufficiently. Perhaps you are calling gtk_widget_set_usize()
|
|
on a child widget, and forcing its size request to be too large. Instead of
|
|
setting the child's usize, consider using gtk_window_set_default_size() so that
|
|
the child gets a larger allocation than it requests.
|
|
</para>
|
|
|
|
@window: the window
|
|
@allow_shrink: whether the user can shrink the window below its size request
|
|
@allow_grow: whether the user can grow the window larger than its size request
|
|
@auto_shrink: whether the window automatically snaps back to its size request if
|
|
it's larger
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_add_accel_group ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@accel_group:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_remove_accel_group ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@accel_group:
|
|
|
|
|
|
<!-- ##### MACRO gtk_window_position ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_activate_focus ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_activate_default ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_set_modal ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@modal:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_set_default_size ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@width:
|
|
@height:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_set_geometry_hints ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@geometry_widget:
|
|
@geometry:
|
|
@geom_mask:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_set_position ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@position:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_set_transient_for ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window:
|
|
@parent:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_window_list_toplevels ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### SIGNAL GtkWindow::set-focus ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@window: the object which received the signal.
|
|
@widget:
|
|
|
|
<!-- ##### ARG GtkWindow:type ##### -->
|
|
<para>
|
|
The type of the window.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkWindow:title ##### -->
|
|
<para>
|
|
The title of the window.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkWindow:auto_shrink ##### -->
|
|
<para>
|
|
If the window shrinks automatically when widgets within it shrink.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkWindow:allow_shrink ##### -->
|
|
<para>
|
|
If the window can be resized to a smaller size by the user.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkWindow:allow_grow ##### -->
|
|
<para>
|
|
If the window can be resized to a larger size by the user.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkWindow:modal ##### -->
|
|
<para>
|
|
If the window is modal, i.e. it grabs all GTK+ events.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkWindow:window_position ##### -->
|
|
<para>
|
|
The position of the window.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkWindow:default_width ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkWindow:default_height ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|