I am trying to use a grid widget in my application, but run into a number of issues: -- Can they be placed in a panel? Or better yet, placed in sizer with other controls? I have only been able to place a grid inside a frame. -- Can you designate multiple rows (or columns) as being used for labels? -- Can you create cells that span cols (or rows)? -- What events are available to trigger on? How does one capture updates to certain cells of the grid? If my questions seem silly, it is because I am a newbie to wxRuby. Thanks, Dale Martenson
Dale Martenson wrote:> I am trying to use a grid widget in my application, but run into a > number of issues: > -- Can they be placed in a panel? Or better yet, placed in sizer with > other controls? I have only been able to place a grid inside a frame.yes they can, you need to set the size and location of the grid, then make sure you call create_grid. see below: require "wxruby" class MyApp < Wx::App def on_init @frame = Wx::Frame.new( nil , -1 , "Title" , Wx::Point.new( 0 , 0 ) , Wx::Size.new( 500 , 500 ) ) @panel = Wx::Panel.new( @frame , -1 ) @grid = Wx::Grid.new( @panel , -1 , Wx::Point.new( 1 , 1 ) , Wx::Size.new( 200 , 200 ) ) @grid.create_grid( 20 , 20 ) @frame.show self.main_loop end end m = MyApp.new> -- Can you designate multiple rows (or columns) as being used for labels?Labels as in column headers and row labels?> -- Can you create cells that span cols (or rows)?i dont think so.> -- What events are available to trigger on? How does one capture updates > to certain cells of the grid?At one point I went through all of the evt_xxx calls for Wx::Grid and wrote down what did what, but I''ll have to see if I still have that document. You could refer to: http://wxruby.rubyforge.org/wxrubydoc.html and check out: http://www.kochandreas.com/home/language/cases/SPREADSHEET_RUBY.HTM Look at the "on_init" and the "createGridEvtHandler" methods.> > If my questions seem silly, it is because I am a newbie to wxRuby. >Nope, these are all good questions. I asked the same ones a few months back when I wrote the MiniSpreadSheetAppp you''ll find at the www.kochandreas.com. Zach
I''ve used the wxGrid in C++, but not wxruby. What platform/ruby version are you using? Dale Martenson wrote:> I am trying to use a grid widget in my application, but run into a > number of issues: > -- Can they be placed in a panel? Or better yet, placed in sizer with > other controls? I have only been able to place a grid inside a frame.I know they can be inside of a panel. What behavior are you seeing?> -- Can you designate multiple rows (or columns) as being used for labels?> -- Can you create cells that span cols (or rows)?I don''t think so on either.> -- What events are available to trigger on? How does one capture > updates to certain cells of the grid?Wow.... I just checked, and the grid event handlers don''t exist! This seems like a pretty big oversight. Lemme see how hard it is to address this. Nick
Nick wrote: [snip]> > >> -- What events are available to trigger on? How does one capture >> updates to certain cells of the grid? > > > Wow.... I just checked, and the grid event handlers don''t exist! This > seems like a pretty big oversight. Lemme see how hard it is to address > this.Wx::Grid responds to some of the generic Events like evt_key_down. When you say "address" this, are you going to create a Grid Event class and wrap the events with that class? Zach
Zach Dennis wrote:> Dale Martenson wrote: > >> I am trying to use a grid widget in my application, but run into a >> number of issues: >> -- Can they be placed in a panel? Or better yet, placed in sizer with >> other controls? I have only been able to place a grid inside a frame. > > > yes they can, you need to set the size and location of the grid, then > make sure you call create_grid. see below: > > require "wxruby" > class MyApp < Wx::App > def on_init > @frame = Wx::Frame.new( nil , -1 , "Title" , Wx::Point.new( 0 , 0 > ) , Wx::Size.new( 500 , 500 ) ) > > @panel = Wx::Panel.new( @frame , -1 ) > > @grid = Wx::Grid.new( @panel , -1 , Wx::Point.new( 1 , 1 ) , > Wx::Size.new( 200 , 200 ) ) > @grid.create_grid( 20 , 20 ) > > @frame.show > self.main_loop > end > end > > m = MyApp.new >Thanks, I will give it a try.>> -- Can you designate multiple rows (or columns) as being used for >> labels? > > > Labels as in column headers and row labels? >Yes, that is what I meant. It kind of goes along with the next question about spanning columns. I wanted to group columns by having several column labels under a single spanning column label. This is all in an attempt to clean-up the output. It is not functionally necessary, but makes it look better.>> -- Can you create cells that span cols (or rows)? > > > i dont think so. > >> -- What events are available to trigger on? How does one capture >> updates to certain cells of the grid? > > > At one point I went through all of the evt_xxx calls for Wx::Grid and > wrote down what did what, but I''ll have to see if I still have that > document. You could refer to: > > http://wxruby.rubyforge.org/wxrubydoc.html > > and check out: > > http://www.kochandreas.com/home/language/cases/SPREADSHEET_RUBY.HTM > > Look at the "on_init" and the "createGridEvtHandler" methods. >Thanks, I will look into that.> >> >> If my questions seem silly, it is because I am a newbie to wxRuby. >> > > Nope, these are all good questions. I asked the same ones a few months > back when I wrote the MiniSpreadSheetAppp you''ll find at the > www.kochandreas.com. > > Zach > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >
Nick wrote:> > I''ve used the wxGrid in C++, but not wxruby. What platform/ruby > version are you using? >Windows XP and Ruby 1.8.2 I hope to have the application running on Linux also.> >> -- What events are available to trigger on? How does one capture >> updates to certain cells of the grid? > > > Wow.... I just checked, and the grid event handlers don''t exist! This > seems like a pretty big oversight. Lemme see how hard it is to address > this. >That does seem like an Oops. Please, let me know what you find out.> Nick > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >
> > Wx::Grid responds to some of the generic Events like evt_key_down. > When you say "address" this, are you going to create a Grid Event > class and wrap the events with that class?Yes, but it will have to wait for now. We''re trying to get wxruby 0.6 released, despite two of the developers buried in work and my linux box kernel panic-ing on boot. Nick
Nick wrote:> > >> >> Wx::Grid responds to some of the generic Events like evt_key_down. >> When you say "address" this, are you going to create a Grid Event >> class and wrap the events with that class? > > > > Yes, but it will have to wait for now. We''re trying to get wxruby 0.6 > released, despite two of the developers buried in work and my linux box > kernel panic-ing on boot. >I downloaded the cvs wxruby source (not swig) and wrote in the grid events. I''ve got everything compiling fine, but for example the EVT_GRID_CELL_LEFT_CLICK events fires when I left click on a cell, but when it does I get a error and application quits: splitterWindow.rb:46:in `main_loop'': wrong argument type false (expected Class) (TypeError) from splitterWindow.rb:46:in `on_init'' from splitterWindow.rb:50:in `initialize'' from splitterWindow.rb:50:in `new'' from splitterWindow.rb:50 Nick,Curt,Kevin....any ideas? Have you seen this type of error before? I''m running: - ruby 1.8.2 - windows 2000 - latest cvs pull of wxruby - msvc++ 6 Thanks, Zach
Nick wrote:> Wow.... I just checked, and the grid event handlers don''t exist! This > seems like a pretty big oversight. Lemme see how hard it is to address > this.Awesome ! Just in time for me to hold on to my plan of commercializing the application (closed-source) I delivered early this month (thanks to a lot many folks on this list, but especially Kevin, Curt, Nick, Zach, Assaph, Alex). We were thinking of moving to something else (FxRuby/VisualuRuby/.NET) mainly due to lack of grid event handlers. Looks like I might not have to do that after all :-) Speaking of releasing commercial apps, does wxRuby''s licensing scheme allow that ? I read in archives, Kevin mentioning about changing to MIT License which I think is liberal and permissive. But does it (wxRuby''s license) also depend on wxWidgets License (which is slightly confusing to me)? This is what wxWdigets License says (http://www.wxwindows.org/newlicen.htm): "The wxWidgets 2 licence is essentially the L-GPL (Library General Public Licence), with an exception stating that derived works in binary form may be distributed on the user''s own terms. This is a solution that satisfies those who wish to produce GPL''ed software using wxWidgets, and also those producing proprietary software." I am not sure I understand these issues well.> NickThanks, -- Shashank
Not specifically. Can you send me the evthandler.cpp change and your sample so I can take a look? Nick Zach Dennis wrote:> Nick wrote: > >> >> >>> >>> Wx::Grid responds to some of the generic Events like evt_key_down. >>> When you say "address" this, are you going to create a Grid Event >>> class and wrap the events with that class? >> >> >> >> >> Yes, but it will have to wait for now. We''re trying to get wxruby 0.6 >> released, despite two of the developers buried in work and my linux >> box kernel panic-ing on boot. >> > > I downloaded the cvs wxruby source (not swig) and wrote in the grid > events. I''ve got everything compiling fine, but for example the > EVT_GRID_CELL_LEFT_CLICK events fires when I left click on a cell, but > when it does I get a error and application quits: > > splitterWindow.rb:46:in `main_loop'': wrong argument type false > (expected Class) > (TypeError) > from splitterWindow.rb:46:in `on_init'' > from splitterWindow.rb:50:in `initialize'' > from splitterWindow.rb:50:in `new'' > from splitterWindow.rb:50 > > > Nick,Curt,Kevin....any ideas? Have you seen this type of error before? > > I''m running: > - ruby 1.8.2 > - windows 2000 > - latest cvs pull of wxruby > - msvc++ 6 > > Thanks, > > Zach > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
It''s all a bit confusing due to the number of licences involved. Here''s my understanding of commercialization: 1) The ruby licence is semi-gpl, but it allows for binary ruby releases as long as you (a) include the libraries that come along, or (b) rename the executable so it won''t be confused with the real ruby. 2) The wxWidgets licence is the very liberal, and basically allows distribution in binary form without the need to open up the application''s source. There are two small caveats: using TIFF''s or using JPEG. See the Gotcha''s section of the wxruby licence. 3) I *thought* Keven had changed the licence to something MIT based, but I don''t see a mention of it in the licence file. So long story short, wxRuby is allowed in commercial apps. Nick Shashank Date wrote:> Nick wrote: > >> Wow.... I just checked, and the grid event handlers don''t exist! This >> seems like a pretty big oversight. Lemme see how hard it is to >> address this. > > > Awesome ! Just in time for me to hold on to my plan of > commercializing the application (closed-source) I delivered early this > month (thanks to a lot many folks on this list, but especially Kevin, > Curt, Nick, Zach, Assaph, Alex). > > We were thinking of moving to something else > (FxRuby/VisualuRuby/.NET) mainly due to lack of grid event handlers. > Looks like I might not have to do that after all :-) > > Speaking of releasing commercial apps, does wxRuby''s licensing scheme > allow that ? I read in archives, Kevin mentioning about changing to > MIT License which I think is liberal and permissive. But does it > (wxRuby''s license) also depend on wxWidgets License (which is slightly > confusing to me)? This is what wxWdigets License says > (http://www.wxwindows.org/newlicen.htm): > > "The wxWidgets 2 licence is essentially the L-GPL (Library General > Public Licence), with an exception stating that derived works in > binary form may be distributed on the user''s own terms. This is a > solution that satisfies those who wish to produce GPL''ed software > using wxWidgets, and also those producing proprietary software." > > I am not sure I understand these issues well. > >> Nick > > > Thanks, > -- Shashank > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
I added Zach''s changes into wxruby, and tested them. They''ll go into the 0.6 release Nick Zach Dennis wrote:> Nick wrote: > >> >> >>> >>> Wx::Grid responds to some of the generic Events like evt_key_down. >>> When you say "address" this, are you going to create a Grid Event >>> class and wrap the events with that class? >> >> >> >> >> Yes, but it will have to wait for now. We''re trying to get wxruby 0.6 >> released, despite two of the developers buried in work and my linux >> box kernel panic-ing on boot. >> > > I downloaded the cvs wxruby source (not swig) and wrote in the grid > events. I''ve got everything compiling fine, but for example the > EVT_GRID_CELL_LEFT_CLICK events fires when I left click on a cell, but > when it does I get a error and application quits: > > splitterWindow.rb:46:in `main_loop'': wrong argument type false > (expected Class) > (TypeError) > from splitterWindow.rb:46:in `on_init'' > from splitterWindow.rb:50:in `initialize'' > from splitterWindow.rb:50:in `new'' > from splitterWindow.rb:50 > > > Nick,Curt,Kevin....any ideas? Have you seen this type of error before? > > I''m running: > - ruby 1.8.2 > - windows 2000 > - latest cvs pull of wxruby > - msvc++ 6 > > Thanks, > > Zach > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Nick wrote:> > I added Zach''s changes into wxruby, and tested them. They''ll go into the > 0.6 release >Any idea when the 0.6 release will be? Zach
It would be today, but my linux box has gone to the bit-bucket in the sky. If a linux user could get the latest CVS code and make sure it builds and runs, I think we would be good to go. Nick Zach Dennis wrote:> Nick wrote: > >> >> I added Zach''s changes into wxruby, and tested them. They''ll go into >> the 0.6 release >> > > Any idea when the 0.6 release will be? > > Zach > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Nick wrote:> It''s all a bit confusing due to the number of licences involved. > Here''s my understanding of commercialization: > > 1) The ruby licence is semi-gpl, but it allows for binary ruby > releases as long as you (a) include the libraries that come along, or > (b) rename the executable so it won''t be confused with the real ruby.And what about the regex library which is still GPL (soon to be replaced with Oniguruma)? If I have to release the app before the replacement becomes mainstream, will I be able to compile it myself into ruby and then build my app, thereby escaping the issue?> 2) The wxWidgets licence is the very liberal, and basically allows > distribution in binary form without the need to open up the > application''s source. There are two small caveats: using TIFF''s or > using JPEG. See the Gotcha''s section of the wxruby licence.OK ... that will not bother me since I do not use TIFF''s/JPEGs.> 3) I *thought* Keven had changed the licence to something MIT based, > but I don''t see a mention of it in the licence file.Hmmm ... I will wait for Kevin to respond.> So long story short, wxRuby is allowed in commercial apps.Good to know. Is there some ritual we will have to perform to keep the law sharks at bay, like getting it approved from a copyright lawyer or some such? Thanks,> Nick-- Shashank
I tested in on my linux box. Everything appears to be working just fine. If you need access to a linux box I can get you ssh access to a debian box, you can have your pick at window managers from TWM, FVWM or IceWM and choose between desktop managers Ice, Gnome or KDE, and vnc or xport forward in. Just let me know if you need access, and I''ll get you the account. Zach Nick wrote:> > It would be today, but my linux box has gone to the bit-bucket in the > sky. If a linux user could get the latest CVS code and make sure it > builds and runs, I think we would be good to go. > > Nick > > Zach Dennis wrote: > >> Nick wrote: >> >>> >>> I added Zach''s changes into wxruby, and tested them. They''ll go into >>> the 0.6 release >>> >> >> Any idea when the 0.6 release will be? >> >> Zach >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > >
Zach Dennis wrote:> I tested in on my linux box. Everything appears to be working just fine.Thanks! Thats what I needed to hear. Nick
Kevin Smith
2004-Nov-21 01:13 UTC
[Wxruby-users] wxRuby license questions (was: Wx::Grid Questions ...)
Shashank Date wrote:> Nick wrote: > >> It''s all a bit confusing due to the number of licences involved.True.>> Here''s my understanding of commercialization: >> >> 1) The ruby licence is semi-gpl, but it allows for binary rubyI''m no expert on the ruby license, but I think I agree with your summary.>> 2) The wxWidgets licence is the very liberal, and basically allows >> distribution in binary form without the need to open up the >> application''s source. There are two small caveats: using TIFF''s or >> using JPEG. See the Gotcha''s section of the wxruby licence.Sounds right. The wxWindows (wxWidgets) wiki has a page or two about copyrights, licenses, patents, and other legal issues. Sorry I don''t have a link handy.>> 3) I *thought* Keven had changed the licence to something MIT based, >> but I don''t see a mention of it in the licence file. > > Hmmm ... I will wait for Kevin to respond.The older (non-swig) wxruby code is still under the same license that it had when I inherited the project, because I didn''t feel comfortable changing the license of someone else''s work. When I started wxruby-swig (from scratch), I chose a very simple and liberal MIT-style license, mostly because the wxWindows license is so confusing,>> So long story short, wxRuby is allowed in commercial apps.To the best of my knowlege, yes.> Good to know. Is there some ritual we will have to perform to keep the > law sharks at bay, like getting it approved from a copyright lawyer or > some such?Because both versions reuse existing licenses (wxWindows and MIT), I think we''re in pretty good shape. Kevin