Hello again, I''m noticing that many of the headers in swig/classes/include have the comment: // This file was automatically generated // by extractxml.rb, part of the wxRuby project // Do not make changes directly to this file! Is this still the case, or was this just a one-time conversion? 228 out of 441 files in that directory don''t have the comment. I ask this because I''m investigating why I can''t seem to call GetClientRect (or get_client_rect, or just client_rect) on Wx::Window. It''s not in swig/classes/include/wxWindow.h, but I don''t know if this file should be hand-edited or if there is some XML file hiding from me somewhere. I''m sure one of you guys could probably fix this problem pretty easily, but I''d like to figure it out. If someone could just give me a few pointers, that would be great. Thanks, David
David, extractxml.rb is no longer used, way back when we were transitioning to the SWIG version of wxRuby this was used. Now we hand edit all the *.i and *.h files. Sean On Thu, Mar 6, 2008 at 8:42 PM, David Whetstone <dwhetstone at gmail.com> wrote:> Hello again, > > I''m noticing that many of the headers in swig/classes/include have the > comment: > > // This file was automatically generated > // by extractxml.rb, part of the wxRuby project > // Do not make changes directly to this file! > > Is this still the case, or was this just a one-time conversion? 228 > out of 441 files in that directory don''t have the comment. > > I ask this because I''m investigating why I can''t seem to call > GetClientRect (or get_client_rect, or just client_rect) on > Wx::Window. It''s not in swig/classes/include/wxWindow.h, but I don''t > know if this file should be hand-edited or if there is some XML file > hiding from me somewhere. I''m sure one of you guys could probably fix > this problem pretty easily, but I''d like to figure it out. If someone > could just give me a few pointers, that would be great. > > Thanks, > David > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >
David Whetstone wrote:> I ask this because I''m investigating why I can''t seem to call > GetClientRect (or get_client_rect, or just client_rect) on > Wx::Window.Sean''s given you the background. There are odd mistakes and omissions, but I don''t believe there is any such method as Window#get_client_rect. The normal reference is the public documented API as per http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html Maybe get_rect which is already there? Where did you see this reference? cheers alex
Thanks for your replies, Sean and Alex. Alex, The code I''m working with was originally written in C++ using wxWidgets. You''re right, the function isn''t documented in the wxWidgets API docs, but I think that must be an unintentional omission. It''s in the public interface of wxWindowBase, and wxPython exports it as well. It''s mentioned in the book "Cross-platform GUI Programming with wxWidgets" (http://tinyurl.com/yvsbsk [Google Books]). The current docs are (AFAIK) hand-edited and therefore prone to deviate from reality. There''s talk on the wxWidgets wiki about switching to doxygen for their API docs, one of the reasons being "No more unintentionally undocumented functions." I think, regardless of what the current API docs say, if a function is publicly accessible in wxWidgets, it should also be available in wxRuby. What do you guys think? - David On Mar 7, 2008, at 12:45 AM, Alex Fenton wrote:> David Whetstone wrote: >> I ask this because I''m investigating why I can''t seem to call >> GetClientRect (or get_client_rect, or just client_rect) on >> Wx::Window. > Sean''s given you the background. There are odd mistakes and omissions, > but I don''t believe there is any such method as > Window#get_client_rect. > The normal reference is the public documented API as per > http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html > > Maybe get_rect which is already there? Where did you see this > reference? > > cheers > alex > > > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development
David Whetstone wrote:> You''re right, the function isn''t documented in the > wxWidgets API docs, but I think that must be an unintentional > omission.I''ve come across others in the past.> I think, regardless of what the current API docs say, if a function is > publicly accessible in wxWidgets, it should also be available in > wxRuby. What do you guys think? >Sounds good to me. The API docs are just a guide. I wouldn''t say we want to expose any and all methods and members that are ''public'' in the C++ sense, but any that can be usefully added to wxRuby. I presume GetClientRect returns the Rect that can be drawn on (excluding window decorations), rather than the whole area occupied by the window. If so it''s definitely useful so feel free to submit a patch (pref including a doc patch to accompany it). alex
Ok, here''s the patch. I filched the doc comment from wxPython.
Sorry about that - slip of the finger and off went my unfinished email. As I was saying, here''s the patch, and I got the comment from wxPython. Hopefully that won''t be a problem. -------------- next part -------------- A non-text attachment was scrubbed... Name: diff.patch Type: application/octet-stream Size: 1516 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-development/attachments/20080307/cdb6e7f2/attachment.obj -------------- next part -------------- Let me know if I should have done anything differently. - David
David Whetstone wrote:> As I was saying, here''s the patch, and I got the comment from > wxPython. Hopefully that won''t be a problem. > > Let me know if I should have done anything differently.Absolutely fine; committed by SVN:1589. I added a little more detail to the method doc. Thank you very much for the patch alex