Maximizing an MDI child window in a FXRuby application

  • Thread starter Stephan Kämper
  • Start date
S

Stephan Kämper

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
 
S

Stephan Kämper

Lyle said:
Well, the short answer is, compare your reduced program to the original
mditest.rbw example and figure out what you took out ;)

Oh dear. Being able to read is such a Good Thing. ;-) Perhaps it should actually do it. Blush...
(Now that I _have_ read it, I actually understand what the comment says... )

Thanks Lyle!


Happy Rubying


StePhan
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top