[9088] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Additional info to: GDK_HINT_MIN_SIZE in Gtk??

daemon@ATHENA.MIT.EDU (Andreas Tille)
Wed Oct 7 09:14:41 1998

Date: Wed, 7 Oct 1998 15:14:12 +0200 (METDST)
From: Andreas Tille <tille@physik.uni-halle.de>
To: GTK User-List <gtk-list@redhat.com>
In-Reply-To: <Pine.HPP.3.96n.981006193758.24535E-100000@mlucom6.urz.uni-halle.de>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

On Tue, 6 Oct 1998, Andreas Tille wrote:

> in an application using only GDK calls I used
> 
>    gdk_window_set_hints(window, 0, 0, 1, 1, 0, 0, GDK_HINT_MIN_SIZE);
> 
> to get the effect, that the contents of the window is resized
> automatically, when changing the sizte of the window.
> 
> Now I tried this using the window element of an GtkWindow, but
> this didn't make any effect.  The contents isn't resized but unly
> displayed more than once if the window is enlarged or only
> partially if the window was made smaller, respectively.
> 
> I checked the Gtk+ sources to get a hint how to do this.  The only
> HINT-related functions where internal ones and I havn't any idea,
> how to access them.
> 
> I'm using Gtk+ 1.0.6.
I forgot to mention that I've set

   gtk_window_set_policy(window->window, TRUE, TRUE, TRUE);

To give all the (in my opinion relevant code:

   GtkWidget *window;

   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_window_set_policy(window, TRUE, TRUE, TRUE);
   gtk_widget_realize(window);
   gdk_window_set_hints(window->window, 0, 0, 1, 1, 0, 0, GDK_HINT_MIN_SIZE);
 
   ....

   GdkImlibImage *im;
   GdkPixmap *pp;

   gdk_imlib_render(im, W, H);
   pp = gdk_imlib_move_image(im);
   gdk_window_set_back_pixmap(window->window, pp, 0);

   gdk_window_resize(window->window, W, H);
   gdk_window_clear(window->window);
   gdk_imlib_free_pixmap(pp);
   gdk_window_show(window->window);

After doing this the pixmap inside window->window doesn't change
its size when resizing the window manually.  But it has done
when I only udes GDK and created a GdkWindow with the HINTS set to
the values above.

Please help me with this question.  I'm in serious trouble.

Kind regards

          Andreas.

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post