[Mono-list] Mono GUI designer issues..

Chris Howie cdhowie at gmail.com
Fri Apr 10 12:52:34 EDT 2009


On Sat, Mar 28, 2009 at 2:13 AM, digitalsoftware
<aricholland2003 at gmail.com> wrote:
> I am new to mono. I was trying to write an software project in C#, but my
> project is GUI based, so I have to rely on mono's gui designer. Well you see
> the problem is, the grid container control, which I add to my form does not
> allow me to precisely align my controls to the grid. I don't know what im
> doing wrong, but it's quite annoying. I'm basically looking for a grid
> system comparable to Visual Studio's.
>
> Also, when I resize my forms in the GUI Designer, and run the compiled
> result. Guess what? The dimensions of what are set in the gui designer, DO
> NOT match the actual compiled result. Leaving me in complete fusturation.
>
> Please help me, I am new to mono, and trying to follow the Linux route for
> my software development.

Are you adding a Fixed/Grid container to the window?  If so, please
not that for most applications *this is wrong*.

GTK+ uses container-based layout, which means that instead of saying
something like "here are three controls, align their tops and put
their X coordinates at 10, 50, and 90" you say something like "divide
the space in the window into three vertical regions, put a menu bar in
the top and a status bar in the bottom, then divide the middle region
into three horizontal regions..." etc.  This approach is much better
because it allows the layout engine to automatically position widgets
on your window, even if it is resized.  Plus if your users change
their font size or something your layout doesn't go to hell -- the
minimum widget sizes will increase with the font size and your layout
will be retained.

Look in particular at the VBox and HBox widgets.  Just about /any/
visual layout can be achieved with those alone, and what can't usually
can be with a Table too.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers


More information about the Mono-list mailing list