Hi, I''ve written a small app implementing SplitterWindow and have a problem with specifying the sash position on Windows. At the moment, I call split_vertically and pass it a positive integer for position. This works as expected on FreeBSD and Linux (Ubuntu and Debian), but seems to have no effect on Windows. Is there something particular I need to be doing to get this to work on Windows? Thank you
timmy2000 at t-n-p.org wrote:> At the moment, I call split_vertically and pass it a positive integer for > position. This works as expected on FreeBSD and Linux (Ubuntu and > Debian), but seems to have no effect on Windows. >I just tried the following on Win XP and it seems to work as expected with a positive integer as the third arg to split_vertically (also with 0 or a negative integer) spliitter = Wx::SplitterWindow.new(self, -1) window1 = Wx::Window.new(splitter, -1) window1.set_background_colour(Wx::RED) window2 = Wx::Window.new(splitter, -1) window2.set_background_colour(Wx::GREEN) splitter.split_vertically(window1, window2, 50) Perhaps you could show us some code if it''s still not working for you? cheers alex
Hi Alex, Alex Fenton wrote:> I just tried the following on Win XP and it seems to work as expected > > splitter = Wx::SplitterWindow.new(self, -1) > window1 = Wx::Window.new(splitter, -1) > window1.set_background_colour(Wx::RED) > window2 = Wx::Window.new(splitter, -1) > window2.set_background_colour(Wx::GREEN) > splitter.split_vertically(window1, window2, 50) > > Perhaps you could show us some code if it''s still not working for you?Here''s what I have: class TreeFrame < MDIChildFrame def initialize(parent) @splitter = MySplitterWindow.new(self) @left = MyPanel.new(@splitter) @right = MyPanel.new(@splitter) @splitter.split_vertically(@left, @right, 200) end end I believe leaving out the window id is the same as giving it a value of -1. Is that correct? Other than that, I cannot see anything different. MyPanel and MySplitterWindow classes are very generic. The sash seems to be positioned at 100px on Windows, no matter of sashPosition value. I am using wxruby-0.6 here by the way, had no luck compiling wxruby2 on FreeBSD, which is my main development machine. Thanks for looking into this. -- the neptune project http://t-n-p.org
timmy2000 at t-n-p.org wrote:> I believe leaving out the window id is the same as giving it a value of > -1. Is that correct? Other than that, I cannot see anything different. > MyPanel and MySplitterWindow classes are very generic. The sash seems to > be positioned at 100px on Windows, no matter of sashPosition value. >Sorry for the delay in replying. Yes, -1 supplies the window with a default id. Your code looks good as well otherwise.> I am using wxruby-0.6 here by the way, had no luck compiling wxruby2 on > FreeBSD, which is my main development machine. >I haven''t had a chance to try this on a box with 0.6 yet, but I suspect that it''s a bug in that wxruby version. Unfortunately there''s probably no chance of this getting fixed on that version; I don''t know that codebase and AFAIK no-one else has worked on it for a couple of years. I''d be really keen to get wxruby2 working on BSD however. Perhaps you could post the compile error(s) you''re getting? alex
Alex Fenton wrote:> Unfortunately there''s probably no chance of this getting fixedThat''s not the end of the world. I can demonstrate the app working on more that one OS (in this case its Mac OS X, FreeBSD and Ubuntu/Debian), so Im happy as a tree.> I''d be really keen to get wxruby2 working on BSD however. Perhaps you > could post the compile error(s) you''re getting?With pleasure. I am building it on ruby-1.8.5.12,1 with gcc version 3.4.4 (20050518) and here''s the output from "rake --trace": <snip> ** Invoke swig/typemap.i (first_time, not_needed) ** Execute obj/AcceleratorEntry.o -c -O -pipe -march=athlon-xp -fPIC -Wno-unused-function -I /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/bin \ -I /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib \ -I /usr/local/lib/ruby -I /usr/local/lib/ruby/site_ruby/1.8 \ -I /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6 \ -I /usr/local/lib/ruby/site_ruby -I /usr/local/lib/ruby/1.8 \ -I /usr/local/lib/ruby/1.8/i386-freebsd6 -I . \ -I /usr/home/timmy/desktop/wxruby2-preview-0.0.40/doc/lib -o obj/AcceleratorEntry.o src/AcceleratorEntry.cpp rake aborted! Command failed with status (127): [ -c -O -pipe -march=athlon-xp -fPIC ...] /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:730:in `sh'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:737:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:737:in `sh'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:816:in `sh'' ./rake/rakewx.rb:321:in `create_compile_task'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in `invoke'' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:376:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `send'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:375:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:368:in `invoke'' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:376:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `send'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:375:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:368:in `invoke'' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:376:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `send'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:375:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:368:in `invoke'' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/bin/rake:7 /usr/local/bin/rake:16:in `load'' /usr/local/bin/rake:16 Hope this helps. If there''s anything else you need to know / I should try, please let me know. Thanks. -- the neptune project http://t-n-p.org
timmy2000 at t-n-p.org wrote:> That''s not the end of the world. I can demonstrate the app working on > more that one OS (in this case its Mac OS X, FreeBSD and Ubuntu/Debian), > so Im happy as a tree. > >So nice to hear from happy users...>> I''d be really keen to get wxruby2 working on BSD however. Perhaps you >> could post the compile error(s) you''re getting? >> > > With pleasure. I am building it on ruby-1.8.5.12,1 with gcc version 3.4.4 > (20050518) and here''s the output from "rake --trace":I think we are simply lacking platform-specific compile instructions for BSDs. Since you''re using gcc + GTK, I guess we can try the linux instructions. 1) Could you post the output of the following command? ruby -e ''puts RUBY_PLATFORM'' 2) Could you try editing rakefile in the base wxruby2 directory as follows and run rake again, posting any errors? At line 41, there''s a section commented ''platform specific''. Please replace the whole series of if/then statements like "if($macosx) require ''rake/rakemacosx'' with simply require ''rake/rakelinux'' thanks for your help alex
Also, please could you send the output of the following command: wx-config --cxx On my system (PowerPC OS X) this returns ''g++'' cheers alex
Alex Fenton wrote:> 1) Could you post the output of the following command? > > ruby -e ''puts RUBY_PLATFORM''i386-freebsd6> 2) Could you try editing rakefile in the base wxruby2 directory as > follows and run rake again, posting any errors?Done that and the previous error does not occur any more. Instead, I get version issues: "This version of wxRuby requires WxWidgets 2.8.3 or greater". The packages on this machine are quite outdated - only WxWidgets 2.8.0 is available. I have no time to upgrade them right now, but this is something that needs to be done soon, perhaps next week. I''ll let you know when I''ve done this and any results that follow. You also wanted to know the output of ''wxgtk2-2.4-config --cxx'', its ''c++'' Thanks for your time Tim -- the neptune project http://t-n-p.org
timmy2000 at t-n-p.org wrote: ... thanks for the helpful info.>> 2) Could you try editing rakefile in the base wxruby2 directory as >> follows and run rake again, posting any errors? >> > > Done that and the previous error does not occur any more. Instead, I get > version issues: "This version of wxRuby requires WxWidgets 2.8.3 or > greater". > > The packages on this machine are quite outdated - only WxWidgets 2.8.0 is > available. I have no time to upgrade them right now, but this is > something that needs to be done soon, perhaps next week.Ideally I''d suggest using gcc to build your own version of the latest stable wxWidgets, configured according to the linux instructions on this page: http://wxruby.rubyforge.org/wiki/wiki.pl?HowToBuildWxWidgets Wx has a plethora of compile-time options and this should guarantee that those selected are compatible with wxRuby. Wx has good mechanisms for operating multiple versions with different options side-by-side. Let us know how it goes when you get a chance. If it works out well I''ll patch the rakefile so it supports BSDs in the next release. Thanks Alex
Seemingly Similar Threads
- stuck tcltk scrollbars under Windows XP
- Documents, Views and DocManagers
- wxruby2-preview Gauge and wx-sugar with SplitterWindow
- [726] trunk/wxruby2/TODO: Sash windows appear to be working fine on current Ubuntu + GTK
- [731] trunk/wxruby2/samples/etc/sash.rb: Changed menu events so they call the correct method.