centering a view inside of a container

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

centering a view inside of a container

Shaping-3
When I center one view inside of another container view, using different
background colors for each (so that I can see any problems), I notice that
the contained view gaps slightly (a few pixels) from the left and top
margins of the container, but is flush with the right and bottom sides.  In
the VC, the contained view is sized the same as the container view.  I don't
see how this can occur, regardless of the layout.  All offsets are 0 @ 0.


Shaping


Reply | Threaded
Open this post in threaded view
|

left- and top-margin gaps around contained view

Shaping-3
Does anyone see how the left- and top-margin gapping below is possible?  I
recall an odd bug from years ago where there was a similar small gap of five
or so pixels involved, but don't remember the details.  I wondering whether
this is the same

Shaping

"Shaping" <[hidden email]> wrote in message
news:[hidden email]...

> When I center one view inside of another container view, using different
> background colors for each (so that I can see any problems), I notice that
> the contained view gaps slightly (a few pixels) from the left and top
> margins of the container, but is flush with the right and bottom sides.
> In the VC, the contained view is sized the same as the container view.  I
> don't see how this can occur, regardless of the layout.  All offsets are 0
> @ 0.
>
>
> Shaping
>


Reply | Threaded
Open this post in threaded view
|

Re: left- and top-margin gaps around contained view

Ian Bartholomew-19
"Shaping" <[hidden email]> wrote in message
news:[hidden email]...
> Does anyone see how the left- and top-margin gapping below is possible?  I
> recall an odd bug from years ago where there was a similar small gap of
> five or so pixels involved, but don't remember the details.  I wondering
> whether this is the same

Can you come up with an example of the problem.  I can't see it with this
simple test ...

s := Shell show.
s view layoutManager: BorderLayout new.
s view addSubView: (c1 := ContainerView new).
c1 backcolor: Color red.
c1 arrangement: #center.
c1 layoutManager: BorderLayout new.
c1 addSubView: (c2 := ContainerView new).
c2 backcolor: Color white.
c2 arrangement: #center

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.