I added the Listbook class (basically the same as the Notebook class with some name changes). I also took the time to write a sample that uses it. The sample interface uses XRC and is slightly more advanced than the current XRC sample. Sean _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Use the attached file instead of the one in previous message. Sean On 8/16/05, Sean Long <sean.m.long@gmail.com> wrote:> I added the Listbook class (basically the same as the Notebook class > with some name changes). I also took the time to write a sample that > uses it. The sample interface uses XRC and is slightly more advanced > than the current XRC sample. > > > Sean > > >-------------- next part -------------- A non-text attachment was scrubbed... Name: wxListbook.h Type: application/octet-stream Size: 4234 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050817/79257821/wxListbook.obj
Sean Long wrote:> Use the attached file instead of the one in previous message.Ok.>>I added the Listbook class (basically the same as the Notebook class >>with some name changes). I also took the time to write a sample that >>uses it. The sample interface uses XRC and is slightly more advanced >>than the current XRC sample.Sounds cool. I have committed this, but on my machine the sample window is completely blank. I mean *completely* blank, without even a menu bar. The other xrc sample appears to work for me (the dialog that pops up has three working buttons). Your patch still had lots of unchanged diff entries in it, probably due to line-ending issues. Not sure how to avoid that, and it wasn''t too bad this time, but would be nicer if the patch only contained stuff that had actually changed. Kevin
> Your patch still had lots of unchanged diff entries in it, probably due > to line-ending issues. Not sure how to avoid that, and it wasn''t too bad > this time, but would be nicer if the patch only contained stuff that had > actually changed.Yeah sorry about that I am not sure where all that crap came from. Tonight I may look over the sample again to see if I spot any parts that may be platform specific. Sean
Just checked out HEAD and in wxListbook.h the GetPage signature is: wxNotebookPage* GetPage(int page ) ; and should be wxListbookPage* GetPage(int page ) ; which was in the second version of wxListbook.h I attached in this thread, on windows both versions work fine but Mac OS X needs the second which is the correct version. Sean On 8/17/05, Sean Long <sean.m.long@gmail.com> wrote:> > Your patch still had lots of unchanged diff entries in it, probably due > > to line-ending issues. Not sure how to avoid that, and it wasn''t too bad > > this time, but would be nicer if the patch only contained stuff that had > > actually changed. > > Yeah sorry about that I am not sure where all that crap came from. > Tonight I may look over the sample again to see if I spot any parts > that may be platform specific. > > Sean >
Sean Long wrote:> Just checked out HEAD and in wxListbook.h the GetPage signature is: > wxNotebookPage* GetPage(int page ) ; > > and should be > wxListbookPage* GetPage(int page ) ; > > which was in the second version of wxListbook.h I attached in this > thread, on windows both versions work fine but Mac OS X needs the > second which is the correct version.On my local copy, and in the CVS repo as shown by the rubyforge web browser, the signature is correct, with wxListbookPage. Here''s what I just copy/pasted from rubyforge: wxListbookPage* GetPage(int page ) ; So please recheck on your end. If there''s still a problem, please submit it as a patch. I did just notice that the string constant default parameter at the end of the Create signature says "notebook" instead of "listbook". Thanks, Kevin
Just tested the listbook sample on OS X and it works fine here, I guess I need to get my Linux VM up and running to test against. I did make one small change so the About menu is put in the proper place on OS X, this probably should be done to all the other samples also. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: listbook.rb.patch Type: application/octet-stream Size: 891 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050817/c980d386/listbook.rb.obj
Regarding sample not working on Linux, I was just looking over the code in the sample and maybe the rename in the XmlResource.i file is not working: %rename(LoadFrameSubclass) wxXmlResource::LoadFrame(wxFrame *frame, wxWindow *parent, const wxString &name); Try just using load_frame, maybe it will work? Sean On 8/17/05, Sean Long <sean.m.long@gmail.com> wrote:> Just tested the listbook sample on OS X and it works fine here, I > guess I need to get my Linux VM up and running to test against. > > I did make one small change so the About menu is put in the proper > place on OS X, this probably should be done to all the other samples > also. > > Sean > > >
Sean Long wrote: > I did make one small change so the About menu is put in the proper > place on OS X, Committed, thanks.> Regarding sample not working on Linux, > > I was just looking over the code in the sample and maybe the rename in > the XmlResource.i file is not working: > > %rename(LoadFrameSubclass) wxXmlResource::LoadFrame(wxFrame *frame, > wxWindow *parent, const wxString &name); > > Try just using load_frame, maybe it will work?The %rename certainly appears to be working, based on a glance at src/XmlResource.cpp. I tried deleting everything in the Frame constructor after the menu events, and the entire window was still blank. When I commented out the load_frame_subclass call, the menubar appeared and worked. Perhaps you need to embed a Window inside the Frame, and load the xrc resources into that child window? It looks like xrc files contain menubars, so maybe the lack of a menu bar in the xrc file is causing problems? I''m just guessing...I know almost nothing about xrc. Kevin
> I tried deleting everything in the Frame constructor after the menu > events, and the entire window was still blank. When I commented out the > load_frame_subclass call, the menubar appeared and worked.The menu code is in the *.rb file not in the XRC file so it probably is a XRC problem.> Perhaps you need to embed a Window inside the Frame, and load the xrc > resources into that child window? It looks like xrc files contain > menubars, so maybe the lack of a menu bar in the xrc file is causing > problems? I''m just guessing...I know almost nothing about xrc.The menu bar in the XRC actually is a new feature that did not exist in wx2.4.2 and it is optional (the new XRC features in 2.6.x are actually what got me working on wxruby2 in the first place and also the wxCheckListBox). I have played around with using the XRC menubar feature but found it not as slick when trying to get the menus to show up in the right spot on Mac OS X. I will need to play with it more, strange that it works on OS X and Windows, maybe GTK is a bit more strict. Sean