Re: pixmap dimensions



You can use the folowing code to get the desired size of any widget:
  GtkRequisition requisition;
  gtk_widget_size_request(GTK_WIDGET(pixmap), &requisition);
  g_message("Size is %hdx%hd", requisition.width, requisition.height);

For the pixmap widget, this should give the width and height.  To get the
ammount of space allocated to the widget, use widget->allocation.width and
widget->allocation.height after packing the widget (this usually requires
the widget's toplevel to be displayed).

James Henstridge.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Mon, 12 Apr 1999, Inigo Serna Robledo wrote:

> 
> 	Hello everybody,
> 
> I want to find out the dimensions of a pixmap (GnomePixmap) residing in
> memory. I don't use imlib, I'd prefer to use Gdk/Gtk+ or Gnome functions.
> Any idea?
> 
> 	Thanks in advance,
> 				Iņigo Serna
> 
> 
> -- 
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]