WxRuby widget borders

M

Mark Volkmann

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 =3D nil
id =3D -1
super(parent_window, id, 'BoxSizer Demo')

set_sizer BoxSizer.new(HORIZONTAL)

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

border =3D 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,223
Latest member
Jurgen2087

Latest Threads

Top