[MonoDevelop] Auto-size of DrawingArea derived widgets

Andrey Gankov gankov.andrey at inbox.ru
Tue Mar 1 06:17:46 UTC 2016

Paweł Wieczorek wrote
> As you can see this class does nothing. I would expect that it behaves
> identically to the DrawingArea widget from the Toolbox, but it doesn't.
> When I drag 'OtherDrawingArea' on the right column then I see that
> designer
> (gtk?) gives whole window to the TextView.

Because OtherDrawingArea Expand = false, If you set  Expand = true, on both
widget available space is divided between them. If one has Expand = false,
widget will take up minimal space.

Paweł Wieczorek wrote
> I was analyzing generated ::Build method and I have found that for
> OtherDrawingArea designers puts those lines:
> w3.Expand = false;
> w3.Fill = false;
> while It does not put similar lines for DrawingArea from Toolbox. Why?
> What
> is a difference between DrawingArea from Toolbox and OtherDrawingArea?

May be because static(Designer) set difference default property for native
and custom widgets. 

Paweł Wieczorek wrote
>  How to control generation of those lines?

Set propery Expand to true from designer.

Paweł Wieczorek wrote
> On the properties window I see that both DrawingArea and OtherDrawingArea
> have set "Auto Size" property to True and disabled "Expand" and "Fill"
> properties. I do not see any property which could differentiate
> DrawingArea
> from Toolbox and OtherDrawingArea widgets.

I don't know how work "Auto Size", in my projects i always set "Expand" and
"Fill", when i need.

View this message in context: http://mono.1490590.n4.nabble.com/Auto-size-of-DrawingArea-derived-widgets-tp4667480p4667523.html
Sent from the Mono - MonoDevelop IDE mailing list archive at Nabble.com.

More information about the Monodevelop-list mailing list