Thread: [Fxruby-users] FXSplitterWindow move splitter programatically
Status: Inactive
Brought to you by:
lyle
From: Steve T. <STU...@MU...> - 2004-01-11 21:32:28
|
Is there a way to programatically set the position of the splitter bar? Thanks in advance (and also for all your work on this framework) Steve Tuckner |
From: Joel V. <vj...@PA...> - 2004-01-12 01:16:40
|
Steve Tuckner wrote: > Is there a way to programatically set the position of the splitter bar? I don't see any "setSplit" or equivalent methods in FXSplitter, either. FWIW, FX4Splitter has methods #getVSplit, #setVSplit, #getHSplit, and #setHSplit. The API doc says there should also be accessors for vSplit and hSplit, but these aren't defined. The setters take a number representing the proportion of split. The max is 10_000 (so 5_000 means 50% split). (This is by experimentation. I didn't see anything in the docs that would explain this.) -- Joel VanderWerf California PATH, UC Berkeley mailto:vj...@pa... Ph. (510) 231-9446 http://www.path.berkeley.edu FAX (510) 231-9565 |
From: Lyle J. <ly...@kn...> - 2004-01-12 02:37:24
|
On Jan 11, 2004, at 7:16 PM, Joel VanderWerf wrote: > Steve Tuckner wrote: >> Is there a way to programatically set the position of the splitter >> bar? > > I don't see any "setSplit" or equivalent methods in FXSplitter, either. I think Jeroen has added a setSplit() method for fox-1.2 but it's not that direct in fox-1.0. Please see my separate response to Steve for more information about how to programmatically set the split size in fox-1.0. > FWIW, FX4Splitter has methods #getVSplit, #setVSplit, #getHSplit, and > #setHSplit. > > The API doc says there should also be accessors for vSplit and hSplit, > but these aren't defined. Hmm, worse than that, it doesn't look like any of the attribute accessors for FX4Splitter are defined. I'll get this fixed. > The setters take a number representing the proportion of split. The > max is 10_000 (so 5_000 means 50% split). (This is by experimentation. > I didn't see anything in the docs that would explain this.) Yes, this appears to be how it works (looking at the FOX source code for FX4Splitter). I'll add something to the FXRuby API docs for this as well. |
From: Lyle J. <ly...@kn...> - 2004-01-12 02:26:34
|
On Jan 11, 2004, at 3:32 PM, Steve Tuckner wrote: > Is there a way to programatically set the position of the splitter = bar? > =A0 > Thanks in advance (and also for all your work on this framework) > > Steve Tuckner > Steve, Please see the note on this page: http://www.fifthplanet.net/cgi-bin/wiki.pl?Cookbook/=20 Setting_The_Relative_Sizes_Of_Panes_In_An_FXSplitter about how to set the split sizes programmatically. Hope this helps, Lyle |
From: Steve T. <STU...@MU...> - 2004-01-13 15:07:06
|
So here is my test program to try to do as your link says. What am I doing wrong? Steve Tuckner ------------------------------------------------------------------ require "fox" include Fox class FxTestWindow < FXMainWindow TIMER_INTERVAL = 20 def initialize(app) # Invoke base class initialize first super(app, "FxSplitterTest", nil, nil, DECOR_ALL, 0, 0, 600, 600) splitter = FXSplitter.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y|SPLITTER_TRACKING|SPLITTER_VERTI CAL) frame1 = FXVerticalFrame.new(splitter, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y) text1 = FXText.new(frame1, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 600, 50) text1.setHeight 500 frame2 = FXVerticalFrame.new(splitter, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y) text2 = FXText.new(frame2, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 600, 50) end # Start def create super show(PLACEMENT_SCREEN) end end def runGUI $application = FXApp.new("Dialog", "FxSplitterTest") $application.init(ARGV) FxTestWindow.new($application) $application.create $application.run end runGUI > -----Original Message----- > From: Lyle Johnson [mailto:ly...@kn...] > Sent: Sunday, January 11, 2004 8:26 PM > To: Steve Tuckner > Cc: fxr...@li... > Subject: Re: [Fxruby-users] FXSplitterWindow move splitter > programatically > > > > > On Jan 11, 2004, at 3:32 PM, Steve Tuckner wrote: > > > > Is there a way to programatically set the position of the splitter > > bar? > > > > Thanks in advance (and also for all your work on this framework) > > > > Steve Tuckner > > > > > > > Steve, > > Please see the note on this page: > > > http://www.fifthplanet.net/cgi-bin/wiki.pl?Cookbook/Setting_Th e_Relative _Sizes_Of_Panes_In_An_FXSplitter about how to set the split sizes programmatically. Hope this helps, Lyle |
From: Lyle J. <jl...@cf...> - 2004-01-13 15:33:42
|
Steve Tuckner wrote: > So here is my test program to try to do as your link says. What am I doing > wrong? The two direct child widgets of the splitter are the vertical frames (frame1 and frame2), and you want to set the height of the top frame (frame1) to be 500 pixels; so instead of this: text1.setHeight 500 you need this: frame1.setHeight 500 Hope this helps, Lyle |
From: Steve T. <STU...@MU...> - 2004-01-13 17:35:46
|
Thanks, that did the trick! > -----Original Message----- > From: Lyle Johnson [mailto:jl...@cf...] > Sent: Tuesday, January 13, 2004 9:33 AM > To: Steve Tuckner > Cc: fxr...@li... > Subject: Re: [Fxruby-users] FXSplitterWindow move splitter > programatically > > > Steve Tuckner wrote: > > > So here is my test program to try to do as your link says. What am I > doing > > wrong? > > The two direct child widgets of the splitter are the vertical frames > (frame1 and frame2), and you want to set the height of the top frame > (frame1) to be 500 pixels; so instead of this: > > text1.setHeight 500 > > you need this: > > frame1.setHeight 500 > > Hope this helps, > > Lyle |
From: Rich <ri...@li...> - 2004-01-14 04:01:38
|
What about when you need the splitter to give _equal_ space to each child - but you don't know how much that is to start, or how much it will be later? I'm looking for something like a FXMatrix widget with PACK_UNIFORM_WIDTH and the children with LAYOUT_FILL_X|LAYOUT_FILL_Y. Can you make the FXMatrix widget dynamically resizable by the user - something like FXSplitter is? -Rich ----- Original Message ----- From: "Lyle Johnson" <jl...@cf...> To: "Steve Tuckner" <STU...@MU...> Cc: <fxr...@li...> Sent: Tuesday, January 13, 2004 8:33 AM Subject: Re: [Fxruby-users] FXSplitterWindow move splitter programatically > Steve Tuckner wrote: > > > So here is my test program to try to do as your link says. What am I doing > > wrong? > > The two direct child widgets of the splitter are the vertical frames > (frame1 and frame2), and you want to set the height of the top frame > (frame1) to be 500 pixels; so instead of this: > > text1.setHeight 500 > > you need this: > > frame1.setHeight 500 > > Hope this helps, > > Lyle > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Perforce Software. > Perforce is the Fast Software Configuration Management System offering > advanced branching capabilities and atomic changes on 50+ platforms. > Free Eval! http://www.perforce.com/perforce/loadprog.html > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users > |