[Gambas-user] Can you put a big box into a small one?

Benoît Minisini gambas at ...1...
Sat Sep 4 19:44:34 CEST 2010


> Benoît Minisini ha scritto:
> >> 2010/9/3 Benoît Minisini <gambas at ...1...>:
> >>> Controls are always clipped by their container, because they are
> >>> windows inside windows, and this is how X-Window works.
> >>> 
> >>> *But* (there is always a *but*), now QT4 and GTK+ do not create one
> >>> window for each control. They manage the imbrication internally. So
> >>> technically they can make a control draw outside of its frame. But this
> >>> is generally avoided.
> >>> 
> >>> Regards,
> >>> 
> >>> --
> >>> Benoît Minisini
> >> 
> >> But, is possible to do that in Gambas or this behaviour indicates a
> >> problem in my code?
> > 
> > The rule is: a control never draws outside of its frame, even if some
> > specific cases it is technically possible (i.e. the container cannot
> > forbid that).
> 
> Sorry for dropping in - I think that having a widget bigger than its
> container is different than drawing outside a container. Can it be that
> you two are talking about two different things?

Maybe!

> 
> About the first case, to be sincere, I never tried to experiment with
> Gambas, nor with GTK, but I am sure that, at least on ms windows, it is
> possible. Every widget can extend or be put totally outside the visible
> part of its container - nothing strange: simply it will be in part or in
> total invisible.
> 
> About the second case, if a widget does not have an own X11 window, it
> will be painted on the surface of its container, and again, anything
> will be visible outside of its container.
> 
> So, the title of this thread has a single reply: yes. You can put a big
> box inside a smaller one. If this is not possible, then there is a bug
> somewhere or some "container rearranging its childrens" logic.
> 
> Regards,
> Doriano
> 

Anyway, having a control bigger that its container is perfectly possible. 
Otherwise you would not have a ScrollView container!

Regards,

-- 
Benoît Minisini




More information about the User mailing list