Thread: [Fxruby-users] (no subject)
Status: Inactive
Brought to you by:
lyle
From: Dalibor S. <da...@in...> - 2003-06-17 08:48:23
|
Hi. I have the following code in my application (www.insula.cz/dbtalk/): # Handle interrupt to save stuff nicely application.addSignal('SIGINT', window, DbTalkWindow::ID_QUIT) # Create the windows application.create # Open the connection dialog automatically window.handle(window, MKUINT(DbTalkWindow::ID_OPENCONNECTION, SEL_COMMAND), nil) # Start event loop application.run This worked perfectly in FXRuby 1.0.20 but it crashes in 1.0.24 on the line with window.handle. It is used for automatical opening of a dialog window after the application starts-up. Is this a possible bug or did I use the feature incorrectly all the time before? Thanks Dalibor Sramek -- Dalibor Sramek http://www.insula.cz/dali | In the eyes of cats, dal...@in... | all things belong to cats. |
From: Steve T. <STU...@MU...> - 2003-06-24 18:23:21
|
Hello all, I am trying to do something simple (I think) but it is not working for me. I when the button is pressed to put another button below the first button and so on until the entire frame scrolls. Below is my code. Thanks for the help in advance Steve Tuckner ------------------------------------------------------------------------ -------------------- require "fox" include Fox class FxTestWindow < FXMainWindow def initialize(app) # Invoke base class initialize first super(app, "FxTest", nil, nil, DECOR_ALL, 0, 0, 600, 600) scrollFrame = FXScrollWindow.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) @contentFrame = FXVerticalFrame.new(scrollFrame, LAYOUT_FILL_X|LAYOUT_FILL_Y) FXText.new(@contentFrame, nil, 0, LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, 0, 0, 200, 100) i = 1 FXButton.new(@contentFrame, "Add Control").connect(SEL_COMMAND) do $stdout.print "button pressed\n" $stdout.flush v = FXButton.new(@contentFrame, "Button #{i}") $stdout.print "v = #{v}\n" $stdout.flush i += 1 end end # Start def create super show(PLACEMENT_SCREEN) end end def runGUI # Make an application $application = FXApp.new("Dialog", "FxWorld") # Open the display $application.init(ARGV) # Construct the application's main window FxTestWindow.new($application) # Create the application $application.create # Run the application $application.run end runGUI |
From: Lyle J. <jl...@cf...> - 2003-06-24 18:33:46
|
Steve Tuckner wrote: > I am trying to do something simple (I think) but it is not working for > me. I when the button is pressed to put another button below the first > button and so on until the entire frame scrolls. Below is my code. Right after the line that constructs the new button: v = FXButton.new(@contentFrame, "Button #{i}") you want to first add a line to create (or "realize") the button: v.create and then tell the vertical frame to recalculate its layout: @contentFrame.recalc Hope this helps, Lyle |
From: Steve T. <STU...@MU...> - 2003-06-24 21:47:40
|
Thanks Lyle that works great! > -----Original Message----- > From: Lyle Johnson [mailto:jl...@cf...] > Sent: Tuesday, June 24, 2003 1:44 PM > To: Steve Tuckner > Cc: fxr...@li... > Subject: Re: [Fxruby-users] (no subject) > > > Steve Tuckner wrote: > > > I am trying to do something simple (I think) but it is not > working for > > > me. I when the button is pressed to put another button > below the first > > > button and so on until the entire frame scrolls. Below is my code. > > Right after the line that constructs the new button: > > v = FXButton.new(@contentFrame, "Button #{i}") > > you want to first add a line to create (or "realize") the button: > > v.create > > and then tell the vertical frame to recalculate its layout: > > @contentFrame.recalc > > Hope this helps, > > Lyle |
From: TOGoS <chu...@ya...> - 2004-06-07 00:20:53
|
Hi all. I'm trying to use Fox to make a chat program. I want to have a list that displayes messages as they come in. Unfortunately, I'm having trouble getting the FXList to scroll down. Using makeItemVisible doesn't seem to do the trick, and neither does anything else I've tried (setCurrentItem, updateItem, etc). The following script shows the problem by periodically inserting data into a FXText and a FXList, and attempting to scroll to the bottom of each. Works for the text, but not the list. Can anyone help me out? #~/usr/bin/ruby require 'fox' app = Fox::FXApp.new() mainwin = Fox::FXMainWindow.new( app, "FoxTest", NIL,NIL, Fox::DECOR_ALL,128,128,128,64 ) frame = Fox::FXHorizontalFrame.new( mainwin, Fox::LAYOUT_FILL_X| Fox::LAYOUT_FILL_Y ) list = Fox::FXList.new( frame, 0, NIL, 0, Fox::LIST_NORMAL| Fox::LAYOUT_FILL_X| Fox::LAYOUT_FILL_Y, 0,0,64,64 ) textbox = Fox::FXText.new( frame, NIL, 0, Fox::TEXT_READONLY| Fox::LAYOUT_FILL_X| Fox::LAYOUT_FILL_Y ) app.create() mainwin.show() Thread.abort_on_exception = TRUE Thread.new do listendpos = 0 textendpos = 0 while TRUE listendpos = list.appendItem( "foonly #{listendpos}" ) list.makeItemVisible( listendpos ) textbox.appendText( "foonly #{textendpos}\n" ) textendpos = textbox.lineEnd( textbox.getBottomLine() ) textbox.makePositionVisible( textendpos ) sleep(1) end end app.run() __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
From: Lyle J. <jl...@cf...> - 2003-06-18 15:57:33
|
Dalibor Sramek wrote: > I have the following code in my application (www.insula.cz/dbtalk/): > > # Handle interrupt to save stuff nicely > application.addSignal('SIGINT', window, DbTalkWindow::ID_QUIT) > > # Create the windows > application.create > > # Open the connection dialog automatically > window.handle(window, MKUINT(DbTalkWindow::ID_OPENCONNECTION, SEL_COMMAND), nil) > > # Start event loop > application.run > > > This worked perfectly in FXRuby 1.0.20 but it crashes in 1.0.24 on the line > with window.handle. It is used for automatical opening of a dialog window after > the application starts-up. > > Is this a possible bug or did I use the feature incorrectly all the time before? Your code is OK; I think this is a bug in FXRuby. As a workaround, please see what happens if you replace this line: window.handle(window, MKUINT(DbTalkWindow::ID_OPENCONNECTION, SEL_COMMAND), nil) with this: window.onOpenConnection(nil, nil, nil) If that takes care of it, I think I know what the problem is... Lyle |