# Problem with spacing

**URL:** <https://www.ruby-forum.com/t/problem-with-spacing/164662>\
**Category:** wxRuby\
**Created:** [April 3, 2009, 7:14pm UTC](https://www.ruby-forum.com/t/problem-with-spacing/164662 "2009-04-03T19:14:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 3, 2009, 7:14pm UTC](https://www.ruby-forum.com/t/problem-with-spacing/164662/1 "2009-04-03T19:14:22Z")

</div>

I’m having the devil’s time trying to get things laid out correctly.  
I’ve attached a screenshot so that you can get an idea of what I’m  
seeing. I’ve got a very unattractive space under the two combo boxes,  
and another one under the buttons. I don’t understand how to reduce  
this.

I know it’s impossible to guess what idiocy I might have created.  
Therefore, (even though I don’t like doing this) the .xrc file for this  
screen follows. I want to thank everyone willing to look at this and  
help teach this beginner with wxRuby. Here it is:

\<?xml version="1.0" encoding="UTF-8" standalone="yes" ?\> wxDEFAULT\_FRAME\_STYLE|wxTAB\_TRAVERSAL 574,336 Contact Management wxVERTICAL 1 5 wxHORIZONTAL 0 wxALL 5 Contact Group: 0 wxALL 5 Select Group 1 wxEXPAND 5 40,0 0 wxALL 5 Contact: 0 wxRIGHT 15 1 wxEXPAND 5 6 2 0 0 0 wxALL 5 Company: 0 wxALL 5 200,-1 0 0 wxALL 5 Phone: 0 wxALL 5 125,-1 0 0 wxALL 5 Contact Name: 0 wxALL 5 200,-1 0 0 wxALL 5 Address: 0 wxALL 5 200,100 0 1 wxEXPAND 5 wxHORIZONTAL 0 wxALL 5 Add Contact 0 0 wxALL 5 \_Update Contact 0 0 wxALL 5 \_Delete Contact 0 0 wxALL 5 C\_lear Form 0 0 wxALL 5 E\_xit 0 MyMenuBar \_File \_Data Contact Group

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 5, 2009, 11:23am UTC](https://www.ruby-forum.com/t/problem-with-spacing/164662/2 "2009-04-05T11:23:26Z")

</div>

Hello Michael,

I went directly to your screenshot, and realized what the problem was  
without even looking at your message. Then I went and read your  
message.  
😉

Anyways, the problem, is that your xrc has the problem, of telling your  
wxHORIZONTAL box, to have a proportion of 1, which is what you get ,  
cause  
it’s taking up an even space between the three actual sizers you have in  
your XRC Code.

The specific line in the XRC is here:

> ```
> <flag>wxALL</flag>
> <border>5</border>
> <object class="wxStaticText" name="groupLabel">
> <label>Contact Group:</label>
> </object>
> </object>
> 
> ```

You need to change that 1 to 0 Which  
handles the Proportion of your Horizontal box sizer. Once you do that,  
you  
should get the correct layout.

If your using wxFormBuilder, you can find this in the properties of the  
wxHorizontal sizer, under the heading of sizeritem.

hth,

Mario

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 5, 2009, 5:12pm UTC](https://www.ruby-forum.com/t/problem-with-spacing/164662/3 "2009-04-05T17:12:34Z")

</div>

Mario S. wrote:

> Hello Michael,
> 
> I went directly to your screenshot, and realized what the problem was  
> without even looking at your message. Then I went and read your  
> message.  
> 😉

Thank you _VERY_ much.

I’m still trying to get the various options regarding spacers and sizers  
into my head. I really appreciate you helping me here.

—Michael
