Re: scrolled window viewport area?



On Tue, 26 Sep 2000, Deborah Swayne wrote:

Hi,

> How do I get the dimensions of the viewing area of
> a scrolled window?  By that I mean the size of the
> area that's currently visible, not the total possible
> size.  The scrolled_window holds an event box, which
> holds a table.
> 
> Is this what I need?  It doesn't seem to work the
> way I thought it should, but I'm not sure.
> 
>     GTK_BIN (scrolled_window)->child->allocation.height,
>     GTK_BIN (scrolled_window)->child->allocation.width

This is right solution :

GtkAdjustment *adj;

adj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(scrolled_window));
width = adj->page_size;
adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scrolled_window));
height = adj->page_size;


Best regards,
Stevo.

-- 
Stefan Ondrejicka <ondrej idata sk>
Beethovenova 11, 917 08 Trnava, Slovakia
http://www.idata.sk/~ondrej/





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