Re: [gtk-list] Re: "Features" in Gtk



On Sun, 19 Mar 2000, Eric Gillespie, Jr. wrote:

> On Sat, Mar 18, 2000 at 23:40:52 -0600,
> Count Zero <countzero@cyberdeck.org> wrote:
> > We have gtk_wdget_set_usize() but no gtk_widget_get_usize() (Yes I know 
> > that you can use gdk_window_get_size, but that doesn't always work for 
> > every widget.) This makes it very hard to save the positions of things 
> > like vpaned and hpaned windows. (Something the users of my application 
> > are begging for.) 
> 
> You can connect to the size_allocate signal of the top or left
> widget in a vpaned or hpaned window. In the callback,
> allocation.height (vpaned) or allocation.width (hpaned) will be
> the value you would use in a call to gtk_paned_set_position().
> 
> This may not be the right way, but it works. :)

rather than connecting to the size allocate signal (which may not always
give you the correct size, since widgets are allowed to shrink the allocation
given to them), you simply want to evaluate
  widget->allocation
to retrive its x, y, width and height.

> 
> -- 
> Eric Gillespie, Jr. <*> epg@pobox.com
> 

---
ciaoTJ



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