Commit f37a0627 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

fix a typo.

2001-08-07  Havoc Pennington  <hp@pobox.com>

	* gtk/gtkfilesel.c (open_ref_dir): fix a typo.

	* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
	some fixage is needed here, but nothing simple. Owen understands
	it. ;-)

        * gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
	sizing and positioning.  Also, fix bug in compute_geometry_hints
	(width/height confusion for setting min size).
	(gtk_window_move): new function
	(gtk_window_resize): new function
	(gtk_window_get_size): new function
	(gtk_window_get_position): new function
	(gtk_window_parse_geometry): new function

 	* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
 	(gtk_widget_get_size_request): new function
 	(gtk_widget_get_usize): delete, that was a short-lived function
 	;-)
 	(gtk_widget_set_usize): deprecate
 	(gtk_widget_set_uposition): deprecate, make it a trivial
	gtk_window_move() wrapper
	(gtk_widget_class_init): remove x/y/width/height properties,
	add width_request height_request

        * demos/*: update to avoid deprecated functions

	* gtk/gtklayout.c: add x/y child properties

	* gtk/gtkfixed.c: add x/y child properties, and get rid of
	uses of "gint16"

	* tests/testgtk.c (create_window_sizing): lots of tweaks to window
	sizing test

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
	configure events on toplevel windows are always in root window
	coordinates, following ICCCM spec that all synthetic events
	are in root window coords already, while real events are
	in parent window coords. Previously the code assumed that
	coords of 0,0 were parent window coords, which was
	really broken.

 	* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
 	warning

 	* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
 	and GDK_HINT_USER_SIZE so we can set USSize and USPosition
 	hints in gtk_window_parse_geometry()

 	* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
 	new USER_POS USER_SIZE hints
parent 439cd9a3
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* tests/prop-editor.c (properties_from_type): Use
......
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* tests/prop-editor.c (properties_from_type): Use
......
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* tests/prop-editor.c (properties_from_type): Use
......
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* tests/prop-editor.c (properties_from_type): Use
......
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* tests/prop-editor.c (properties_from_type): Use
......
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* tests/prop-editor.c (properties_from_type): Use
......
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* tests/prop-editor.c (properties_from_type): Use
......
......@@ -78,7 +78,7 @@ do_colorsel (void)
da = gtk_drawing_area_new ();
/* set a minimum size */
gtk_widget_set_usize (da, 200, 200);
gtk_widget_set_size_request (da, 200, 200);
/* set the color */
gtk_widget_modify_bg (da, GTK_STATE_NORMAL, &color);
......
......@@ -92,7 +92,7 @@ do_item_factory (void)
FALSE, FALSE, 0);
label = gtk_label_new ("Type\n<alt>\nto start");
gtk_widget_set_usize (label, 200, 200);
gtk_widget_set_size_request (label, 200, 200);
gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
gtk_box_pack_start (GTK_BOX (box1), label, TRUE, TRUE, 0);
......
......@@ -686,7 +686,7 @@ create_tree (void)
gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
GTK_TREE_SELECTION_SINGLE);
gtk_widget_set_usize (tree_view, 200, -1);
gtk_widget_set_size_request (tree_view, 200, -1);
for (i=0; i < G_N_ELEMENTS (testgtk_demos); i++)
{
......
......@@ -148,7 +148,7 @@ do_panes (void)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_widget_set_usize (frame, 60, 60);
gtk_widget_set_size_request (frame, 60, 60);
gtk_paned_add1 (GTK_PANED (hpaned), frame);
button = gtk_button_new_with_mnemonic ("_Hi there");
......
......@@ -246,7 +246,7 @@ do_pixbufs (void)
}
else
{
gtk_widget_set_usize (window, back_width, back_height);
gtk_widget_set_size_request (window, back_width, back_height);
frame = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, back_width, back_height);
......
......@@ -212,8 +212,9 @@ main (int argc, char **argv)
frame = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, back_width, back_height);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize (window, back_width, back_height);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_widget_set_size_request (window, back_width, back_height);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy_cb), NULL);
......
......@@ -104,9 +104,9 @@ int main(int argc, char **argv)
gtk_container_add(GTK_CONTAINER(window), vbox);
drawing_area = gtk_drawing_area_new();
gtk_widget_set_usize(GTK_WIDGET(drawing_area),
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf));
gtk_widget_set_size_request (GTK_WIDGET(drawing_area),
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf));
gtk_signal_connect(GTK_OBJECT(drawing_area), "expose_event",
GTK_SIGNAL_FUNC(expose_cb), NULL);
......
......@@ -142,9 +142,9 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (window), vbox);
drawing_area = gtk_drawing_area_new ();
gtk_widget_set_usize (GTK_WIDGET (drawing_area),
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf));
gtk_widget_set_size_request (GTK_WIDGET (drawing_area),
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf));
gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
GTK_SIGNAL_FUNC (expose_cb), NULL);
......
......@@ -393,7 +393,7 @@ new_testrgb_window (GdkPixbuf *pixbuf, gchar *title)
drawing_area = gtk_drawing_area_new ();
temp_box = gtk_hbox_new (FALSE, 0);
gtk_widget_set_usize (GTK_WIDGET(drawing_area), w, h);
gtk_widget_set_size_request (GTK_WIDGET(drawing_area), w, h);
gtk_box_pack_start (GTK_BOX (temp_box), drawing_area, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), temp_box, FALSE, FALSE, 0);
......
......@@ -397,6 +397,22 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0:
using gdk_image_get() should really be ported to
gdk_pixbuf_get_from_drawable().
* gtk_widget_set_usize() has been renamed to
gtk_widget_set_size_request(), however the old name still exists
unless you define GTK_DISABLE_DEPRECATED.
* gtk_widget_set_uposition() is deprecated; use gtk_window_move(),
gtk_fixed_put(), or gtk_layout_put() instead.
* gtk_window_set_policy() is deprecated. To get the effect of
"allow_shrink", call gtk_widget_set_size_request(window, 0, 0). To
get the effect of "allow_grow", call
gtk_window_set_resizable(window, TRUE). You didn't want the effect
of auto_shrink, it made no sense. But maybe if you were using it you
want to use gtk_window_resize (window, 1, 1) to snap a window back
to its minimum size (the 1, 1 will be rounded up to the minimum
window size).
* The core GTK+ now takes care of handling mapping, unmapping and
realizing the child widgets of containers in
gtk_widget_set_parent(). In most cases, this allows container
......
......@@ -87,6 +87,8 @@ Windows
@GDK_HINT_ASPECT:
@GDK_HINT_RESIZE_INC:
@GDK_HINT_WIN_GRAVITY:
@GDK_HINT_USER_POS:
@GDK_HINT_USER_SIZE:
<!-- ##### STRUCT GdkGeometry ##### -->
<para>
......
......@@ -1004,6 +1004,36 @@ the #GtkAdjustment which sets the range of the scale.
@widget: the object which received the signal.
<!-- ##### ARG GtkWidget:height ##### -->
<para>
</para>
<!-- ##### ARG GtkWidget:width ##### -->
<para>
</para>
<!-- ##### ARG GtkWidget:x ##### -->
<para>
</para>
<!-- ##### ARG GtkWidget:y ##### -->
<para>
</para>
<!-- ##### ARG GtkWindow:auto-shrink ##### -->
<para>
If the window shrinks automatically when widgets within it shrink.
</para>
<!-- ##### FUNCTION gtk_arg_copy ##### -->
<para>
It will either copy data into an existing argument or allocate a new argument
......
......@@ -495,7 +495,6 @@ This can later be composited together with other
#GtkRcStyle structures to form a #GtkStyle.
</para>
@parent_instance:
@name:
@bg_pixmap_name:
@font_desc:
......
......@@ -1874,22 +1874,12 @@ a widget changes from un-anchored to anchored or vice-versa.
</para>
<!-- ##### ARG GtkWidget:x ##### -->
<!-- ##### ARG GtkWidget:width-request ##### -->
<para>
</para>
<!-- ##### ARG GtkWidget:y ##### -->
<para>
</para>
<!-- ##### ARG GtkWidget:width ##### -->
<para>
</para>
<!-- ##### ARG GtkWidget:height ##### -->
<!-- ##### ARG GtkWidget:height-request ##### -->
<para>
</para>
......
......@@ -509,11 +509,6 @@ The type of the window.
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.
......
This is a list of things to check when testing window size/pos functions.
===
gtk_widget_set_size_request():
- causes the widget to request the given size
- for toplevel windows, changes the default-requested size if
no default size is set and gtk_window_resize() has not been called
- passing -1 for either width or height reverts to "natural" request
in that dimension
- passing 0 is allowed, and results in requisition of 1x1
(0x0 is a permitted requisition, but equivalent to 1x1,
we use 1x1 for implementation convenience)
- causes notifies on width_request, height_request properties
gtk_window_resize():
- causes a configure request in all cases if the window is mapped,
unless the new size is the same as the old size
- overrides the default size on map if the window is unmapped
- allows size of 0, equivalent to 1
- clamped to geometry hints
gtk_window_set_default_size():
- has no effect after the window has been mapped the first time,
unless the window has been unrealized in which case it should
have an effect
- allows size of 0, equivalent to 1
- allows size of -1 to unset the default size
- clamped to geometry hints
- gtk_window_resize() overrides it
- causes notifies on default_width, default_height properties
gtk_window_get_default_size():
- returns the values last passed to set_default_size(), including
-1. If set_default_size() has not been called, returns -1.
gtk_window_move():
- always causes a configure request if the window is mapped,
unless the last configure request we sent was for the same
position being moved to
- position may be negative to move windows offscreen
- if GTK_WIN_POS_CENTER_ALWAYS (or other future position
constraints we may add) is in effect, the move
request is clamped to obey the constraints. thus
calling gtk_window_move() on a CENTER_ALWAYS window
may trigger the window to bounce back to center if it
wasn't there
- overrides all GTK_WIN_POS_ except CENTER_ALWAYS
gtk_window_get_size():
- obtains the client-side known size of widget->window,
as last received from a configure event
- prior to mapping, returns the default size we will request
- between realization and mapping, computes default size
rather than looking at widget->window up-to-date size,
so the size will be correct after force-realizing a window
gtk_window_get_position():
- obtains the point to be passed to gtk_window_move() in order
to keep the window in its current position
- round-trips to the server to get the position; this is suboptimal
from both a race condition and speed standpoint but required to get
window frame size
- if the window is unmapped, returns the default position we will
request
gtk_window_set_position():
- not the inverse of get_position(), sadly
- modifies the default positioning of the window
- if set to CENTER_ALWAYS and the window is mapped, results in a
configure request moving the window to the center, unless the
window was already centered
- ignored if gtk_window_move() called, with the exception
of CENTER_ALWAYS
gtk_window_parse_geometry():
- parses a standard X geometry string
- toggles on one or both of GDK_HINT_USER_SIZE, GDK_HINT_USER_POS
- "xprop" shows user size/position are set on the window
- calls gtk_window_set_default_size() to set the window size
- calls gtk_window_move() to set the window position
- calls gtk_window_set_gravity() to set the window gravity
gtk_window_reshow_with_initial_size():
- for use by GUI builders; unrealizes and re-shows the window,
using default size (and also position, but position
is reset on any hide anyway)
- window should be positioned and sized as it was on initial map,
barring odd window managers
gtk_window_set_geometry_hints():
- if a hint is set with this function, we do not override it
in other parts of the code
General behavior
===
- no infinite loops or nasty fighting-the-user flicker during
operations such as moving/resizing a window
Properties
===
GtkWindow::default_width, GtkWindow::default_height:
- default_width is -1 if unset, or >= 0 if
a default width is set
- default_height is -1 if unset, or >= 0 if
a default height is set
GtkWindow::allow_grow, GtkWindow::resizable:
- equivalent properties; changing one notifies on the other
- if FALSE, we set the min size to the max size in the geometry
hints.
- If the app programmer has called gtk_window_set_geometry_hints()
however and set min or max size, we don't replace the hint they
set.
GtkWidget::width_request, GtkWidget::height_request:
- if -1, default requisition of widget is used
- otherwise, override default requisition
......@@ -82,7 +82,9 @@ typedef enum
GDK_HINT_BASE_SIZE = 1 << 3,
GDK_HINT_ASPECT = 1 << 4,
GDK_HINT_RESIZE_INC = 1 << 5,
GDK_HINT_WIN_GRAVITY = 1 << 6
GDK_HINT_WIN_GRAVITY = 1 << 6,
GDK_HINT_USER_POS = 1 << 7,
GDK_HINT_USER_SIZE = 1 << 8
} GdkWindowHints;