[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

WxRuby widget borders

Mark Volkmann

2/27/2006 2:07:00 AM

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

--
R. Mark Volkmann
Partner, Object Computing, Inc.