# WxRuby widget borders

**URL:** <https://www.ruby-forum.com/t/wxruby-widget-borders/73979>\
**Category:** Ruby\
**Created:** [February 27, 2006, 3:09am UTC](https://www.ruby-forum.com/t/wxruby-widget-borders/73979 "2006-02-27T03:09:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markcasio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9bcb4/32.png) [@markcasio](https://www.ruby-forum.com/u/markcasio)\
**Post date:** [February 27, 2006, 3:09am UTC](https://www.ruby-forum.com/t/wxruby-widget-borders/73979/1 "2006-02-27T03:09:23Z")

</div>

I can add a border around widgets in WxRuby using the ALL flag, but  
the LEFT, RIGHT, TOP and BOTTOM flags aren’t recognized. Are those not  
supported?

Here’s some simple code that demonstates this. I really want to change  
“ALL” to “LEFT | RIGHT”.

require ‘wxruby’  
include Wx

class MyFrame \< Frame  
def initialize  
parent\_window = nil  
id = -1  
super(parent\_window, id, ‘BoxSizer Demo’)

```
set_sizer BoxSizer.new(HORIZONTAL)

for i in 1..3
  button = Button.new(self, id, "Button #{i}")

  border = 2 # only works if TOP, BOTTOM, LEFT, RIGHT or ALL flag is 

```

used  
get\_sizer.add button, DEFAULT\_POSITION, ALL, border  
end

```
fit

```

end  
end

class MyApp \< App  
def on\_init()  
MyFrame.new.show  
end  
end

MyApp.new.main\_loop
