public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
* pixmap problem
@ 2002-12-27  8:06 Stan Pinte
  2002-12-27  9:14 ` Stan Pinte
  0 siblings, 1 reply; 2+ messages in thread
From: Stan Pinte @ 2002-12-27  8:06 UTC (permalink / raw)
  To: guile-gtk

hello,

the 'height and 'width of the pixmap of the following example is null...


(let* ((window (gtk-window-new 'toplevel))
       (button (gtk-button-new))
       (pixmap (gtk-pixmap-new "./my-pic.xpm" button)))
  (gtk-container-add window pixmap)
  (display (gtk-widget-get pixmap 'height))
  (display (gtk-widget-get pixmap 'width))
  (gtk-widget-show window)
  (gtk-widget-show pixmap)
  (gtk-repl))


any idea why?

thanks a lot,

Stan

-- 

Stanislas Pinte

Computer Consultant

Alto Software
20 Pl St Jacques
B-4000 Liège

web:		http://www.altosw.be
email:		alto_stan@wanadoo.be

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pixmap problem
  2002-12-27  8:06 pixmap problem Stan Pinte
@ 2002-12-27  9:14 ` Stan Pinte
  0 siblings, 0 replies; 2+ messages in thread
From: Stan Pinte @ 2002-12-27  9:14 UTC (permalink / raw)
  To: guile-gtk

On Fri, 27 Dec 2002 17:29:03 +0100
Stan Pinte <alto_stan@wanadoo.be> wrote:

> hello,
> 
> the 'height and 'width of the pixmap of the following example is null...
> 
> 
> (let* ((window (gtk-window-new 'toplevel))
>        (button (gtk-button-new))
>        (pixmap (gtk-pixmap-new "./my-pic.xpm" button)))
>   (gtk-container-add window pixmap)
>   (display (gtk-widget-get pixmap 'height))
>   (display (gtk-widget-get pixmap 'width))
>   (gtk-widget-show window)
>   (gtk-widget-show pixmap)
>   (gtk-repl))
> 

sorry, 

I solved my problem by calling (gtk-widget-allocation-width pixmap) after having done a gtk-widget-show-all on the window. I guess that is only at paiting time that Gtk initialize all the height and width variables.

Sorry for the mess,

Stan

> 
> any idea why?
> 
> thanks a lot,
> 
> Stan
> 
> -- 
> 
> Stanislas Pinte
> 
> Computer Consultant
> 
> Alto Software
> 20 Pl St Jacques
> B-4000 Liège
> 
> web:		http://www.altosw.be
> email:		alto_stan@wanadoo.be
> 
> 


-- 

Stanislas Pinte

Computer Consultant

Alto Software
20 Pl St Jacques
B-4000 Liège

web:		http://www.altosw.be
email:		alto_stan@wanadoo.be

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-27 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-27  8:06 pixmap problem Stan Pinte
2002-12-27  9:14 ` Stan Pinte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).