Stephan Kämper
11/1/2003 2:15:00 PM
Hi all,
I'm trying to figure out how to write a small application that's just capable of displaying some
text in child windows. (I reduced the "mditest.rbw" script that comes with FXRuby to show the
problem I have).
My problem is:
If I run the script below and maximize the chlid window, there's no way to resize it.
The three widgets on the top right (child) window corner will dissaprear (The "under score",
"square" and "X" icons to minimize, close and maximize the window).
# Originally written on this config:
# Ruby version: 1.8.0 / 2003-08-04
# Dave & Andy's 1-click-installer
# with the latest FXRuby added to it
#
# System type: i386-mswin32
# FXRuby Version: 1.0.27
# FOX Version: 1.0.46
require "fox"
require "fox/responder"
include Fox
class Bb < FXMainWindow
include Responder
def initialize( app )
super( app, "Bare Bones...", nil, nil, DECOR_ALL, 0, 0, 500, 400, 0, 0 )
menubar = createMenu
@mdiclient = FXMDIClient.new( self, LAYOUT_FILL_X | LAYOUT_FILL_Y )
mdichild = createTestWindow( 10, 10, 400, 300 )
@mdiclient.setActiveChild( mdichild )
end
def createMenu
menuBar = FXMenubar.new( self, LAYOUT_SIDE_TOP | LAYOUT_FILL_X )
fileMenu = FXMenuPane.new( self )
FXMenuCommand.new( fileMenu, "&Quit", nil, app, FXApp::ID_QUIT )
FXMenuTitle.new( menuBar, "&File", nil, fileMenu )
return menuBar
end
# Create a new MDI child window
def createTestWindow( x, y, w, h )
mdichild = FXMDIChild.new(@mdiclient, "Child", nil, nil, 0, x, y, w, h )
scrollwindow = FXScrollWindow.new( mdichild, 0 )
text = FXText.new( scrollwindow, mdichild, LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT, 0, 0, 0, 100 )
text.text = "A Rose is a rose is a rose.\n\n Gertrude Stein"
mdichild
end
def Bb.run
application = FXApp.new( "Bare bones ...", "Stephan Kämper" )
application.init( ARGV )
main = Bb.new( application )
application.create()
main.show( PLACEMENT_SCREEN )
application.run()
end
end
if __FILE__ == $0
Bb.run
end