RSS/Atom feed Twitter
Site is read-only, email is disabled

Window resize

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Window resize pampryl 18 Jul 10:13
  Window resize Sven Neumann 18 Jul 09:32
   Window resize Bill Skaggs 20 Jul 17:17
    Window resize Sven Neumann 21 Jul 19:03
Sven Neumann
2008-07-18 09:32:19 UTC (over 16 years ago)

Window resize

Hi,

if you have questions on using GTK+, please ask on gtk-list or gtk-app-devel-list. Thanks.

Sven

pampryl
2008-07-18 10:13:50 UTC (over 16 years ago)

Window resize

Hello,

I have put some GtkButtons inside a Gtk V WrapBox (which is a container) and then I've put this very GtkVWrapBox inside a GtkWindow.

A GtkVWrapBox's job consists in placing all the GtkButtons it contains in columns on its left-hand side.

If enough height is available, the GtkVWrapBox will place all the GtkButtons in a single column on the left-hand side. Otherwise, it will create as many columns as needed, thus requiring more WIDTH to display the extra columns.

When the MOUSE resizes the GtkWindow which embarks my GtkVWrapBox, I can't force this GtkWindow to resize properly to accomodate the GtkVWrapBox. The result is that the GtkVWrapBox shrinks the GtkButtons it contains to fit the space it is allowed by the GtkWindow : this shrinkage is not a desired effect.

I am able to compute the space needed by the GtkVWrapBox to display the GtkButtons full size. (by means of "gtk_widget_size_request" on the GtkButtons it contains)

The problem is : ---------------
When the GtkWindow is resized with the mouse, I can't have it resized according to the constraints I have calculated with gtk_widget_size_request. When the GtkWindow is resized with the mouse, it seems to receive two signals from the "window manager"(?) : 1) "size-request" and
2) "size-allocate"

I tried the following strategies to solve my problem :

1)Issue a "gtk_widget_set_size_request" on the GtkWindow in the "size-request"
callback.
2)Issue a "gtk_widget_set_size_request" on the GtkWindow in the "size-allocate"
callback.
3)Issue a "gtk_window_setsize" (GTK) on the GtkWindow in the "size-request" callback.
4)Issue a "gtk_window_setsize" (GTK) on the GtkWindow in the "size-allocate" callback.
5)Issue a "gdk_window_setsize" (GDK) on the GtkWindow->window in the "size-request" callback.
6)Issue a "gdk_window_setsize" (GDK) on the GtkWindow->window in the "size-allocate" callback.
7)Issue a "gtk_window_set_geometry_hints" on the GtkWindow in the "size-request" callback.
9)Issue a "gtk_window_set_geometry_hints" on the GtkWindow in the "size-allocate" callback.

I also programmed my GtkWindow with gtk_window_set_geometry_hints to have it resized by increments (increment in height : the height of a GtkButton inside my GtkVWrapBox / increment in width : the width of a GtkButton inside my GtkVWrapBox)

HINT : ------
The GIMP also embarks a GtkWrapBox. When the window is resized with the mouse, it does so by moving its right-bottom corner by increments.

But the trick is that if the height is reduced and the GtkVWrapBox is on the brink of creating a new column to compensate for the loss of height, the GtkWindow ANTICIPATES by both decrementing its height and incrementing its width AT THE SAME TIME.

Does anyone knows how to do that ?

Thanks.

Bill Skaggs
2008-07-20 17:17:47 UTC (over 16 years ago)

Window resize

On Fri, Jul 18, 2008 at 12:32 AM, Sven Neumann wrote:

Hi,

if you have questions on using GTK+, please ask on gtk-list or gtk-app-devel-list. Thanks.

Um, GtkWrapBox is part of Gimp, not GTK+, in spite of its name. (I have no doubt that Sven knows that, and was reacting without having closely read the question.)

-- Bill

Sven Neumann
2008-07-21 19:03:57 UTC (over 16 years ago)

Window resize

Hi,

On Sun, 2008-07-20 at 08:17 -0700, Bill Skaggs wrote:

Um, GtkWrapBox is part of Gimp, not GTK+, in spite of its name. (I have no doubt that Sven knows that, and was reacting without having closely read the question.)

I've read the question and I came to the conclusion that it appears not related to the development of GIMP and that it would be much more on-topic (and more likely to be answered) on gtk-list or gtk-app-devel-list.

Sven