[fxruby-users] resizing main window on the fly

Don Wilde dwilde1 at gmail.com
Thu Nov 6 13:01:25 EST 2008


Hi, all -

Is it possible to resize the main window on the fly? I want to default to an
800x600 window but give the user an option to resize to 1024.

This approach didn't work:

class MyWindow < FXMainWindow
  def initialize( app )
  #...

    @mainWindowWidth = 800

    # Build the overall Application GUI
    # ---------------------------------
    super( app,
           "  MyWindow  ",
           :width => @mainWindowWidth, :height => 600, :vSpacing => 0 )
  #...
    winWidth = FXListBox.new( blk1, :opts => LISTBOX_NORMAL )
    winWidth.appendItem("800")
    winWidth.appendItem("1024")
    winWidth.connect( SEL_COMMAND ) do | sender, sel, data |
      @mainWindowWidth = data.to_i
      app.forceRefresh
    end
  end
end
#...

if __FILE__ == $0
  FXApp.new do | app |
    FXToolTip.new( app )
    gui = MyWindow.new( app )
    app.create
    app.run
  end
end

My fallback is to save to a file and load the value on the next start, but
is that necessary?

Another question, is this discussion list archived and visible anywhere?
Lyle, your time is better spent coding than answering the same questions
more than once. :)))

-- :D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081106/67a40b38/attachment.html>


More information about the fxruby-users mailing list