Forum: Ruby WxRuby widget borders

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mark V. (Guest)
on 2006-02-27 04:09
(Received via mailing list)
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
This topic is locked and can not be replied to.