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

Doriano Blengino doriano.blengino at ...1909...
Sat Sep 4 21:41:52 CEST 2010


Benoît Minisini ha scritto:
>> 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!
>   
That is a very special case! A container having ClientWidth/ClientHeight 
bigger than Width/Height is an interesting topological object... :-)

BTW: do you know that a 15 years old guy has been accepted at the 
Cambridge University, and his aim is to solve the Riemann hypotesis?

Regards,
Doriano





More information about the User mailing list