Re: Sorry forgot the code itself ...



>  But it is not perfect yet. Run the new version, where I have added a
>  second canvas item, with one corner at (0,0).
>  
>  1.) Notice how it seems to offset so it actually appears to be at
>  (-3,-3) or something. When the app starts the green band is thinner on
>  the top & left edges.

Your rectangle from (0, 0) to (foo, bar) has a thick outline, so it
will extend past those bounds.  The outline stroke is centered along
the rectangle's border.

>  2.) This offset appears to be the same as the distance of the red
>  segment, that just shows on start, from the scrollbars. I don't like
>  this gap. I want the canvas to go right up flush against the scrollbars.
>  How can I solve this ?

What you want is to set the scrolling region to the area you want to
see.  If you are lazy, you can get the bounding box of the root item
with gnome_canvas_item_get_bounds() and set the scrolling region to
that.  If you are not lazy and you actually know the region you want
to display, you should use that.

>  3.) Why when I make the window really big, bigger than the canvas scroll
>  region, does the canvas appear to move as if it was stuck to the right
>  and bottom edges of the scroll window. I would like it to remain at the
>  top and left edge, and just have some sort of black background show
>  through that suggests the edge of the canvas has been reached.

The canvas tries to keep visible as much of the scrolling region as
possible.  When the canvas window is bigger than what is needed to
display the entire scrolling region, then it gets centered in the
canvas.

  Federico



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