From: Jason Persampieri Date: 2003-02-25T11:44:45+09:00 Subject: Re: FXRuby FXText width? --- Chris Morris wrote: > I have the following (1.0.20) code. All FXTextFields are set to a default > width, regardless of what I pass the constructor or set afterwards. What am > I doing wrong? > > class DBLogin < FXMainWindow > include Responder > > attr_accessor :dblogin > > def initialize(app) > @app = app > super(@app, "Login", nil, nil, DECOR_ALL, 0, 0, 400) > > FXLabel.new(self, 'Server') > @server = FXTextField.new(self, 1, nil, 0, TEXTFIELD_NORMAL, 0, 0, > 500) > FXLabel.new(self, 'Database') > @database = FXTextField.new(self, 1) > FXLabel.new(self, 'User') > @username = FXTextField.new(self, 1) > FXLabel.new(self, 'Password') > @password = FXTextField.new(self, 1) > ... > If you want to specify the width (or height) of a widget, you must specifiy that you are doing so. FXTextField(self, 1, nil, 0, LAYOUT_FIX_WIDTH, 0, 0, 500) this threw me off for a while as well ;) I kinda wish you could do this automagically by passing in 'nil' for the values you don't want to specify. What do ya think, Lyle? Jason