The GetHMenuOf() macro seems not available ... -- Posted via http://www.ruby-forum.com/.
Lui Kore wrote:> The GetHMenuOf() macro seems not available ... >Wx::Frame#get_menu_bar , I think alex
Sorry, I mean the handle of a popup menu. On Windows it''s an HMENU value, which is an Fixnum in ruby. I need this handle to do some platform specific operations (for example, add shell context menu) but still don''t know how to get it. In wxwidgets(C++), the prototype in wxMenu is: class WXDLLEXPORT wxMenu : public wxMenuBase { public: ... WXHMENU GetHMenu() const { return m_hMenu; } But there''s no such get_hmenu in wxRuby. Alex Fenton wrote:> Lui Kore wrote: >> The GetHMenuOf() macro seems not available ... >> > > Wx::Frame#get_menu_bar , I think > > alex-- Posted via http://www.ruby-forum.com/.
Forgive my terrible English ... This function seems to be a windows-only feature, it lives in %WXWIN%/include/msw/menu.h -- Posted via http://www.ruby-forum.com/.
Solved. I added these lines to swig/classes/include/wxMenu.h, at about line 43: #ifdef __WXMSW__ long GetHMenu() { return (long)m_hMenu; } #endif Re-swig and re-compile, then Menu#get_h_menu works. -- Posted via http://www.ruby-forum.com/.
On 08/03/2010 17:36, Lui Kore wrote:> Solved. I added these lines to swig/classes/include/wxMenu.h, at about > line 43: > > #ifdef __WXMSW__ > long GetHMenu() { return (long)m_hMenu; } > #endif > > Re-swig and re-compile, then Menu#get_h_menu works. >Thanks - the macros in Wx aren''t documented very systematically so some important ones might be missing from wxRuby. Could you submit this as a bug or feature request on the Rubyforge site please, and we should be able to put it in the next main release. thanks alex
Done. http://rubyforge.org/tracker/index.php?func=detail&aid=27945&group_id=35&atid=221 Alex Fenton wrote:> On 08/03/2010 17:36, Lui Kore wrote: >> Solved. I added these lines to swig/classes/include/wxMenu.h, at about >> line 43: >> >> #ifdef __WXMSW__ >> long GetHMenu() { return (long)m_hMenu; } >> #endif >> >> Re-swig and re-compile, then Menu#get_h_menu works. >> > > Thanks - the macros in Wx aren''t documented very systematically so some > important ones might be missing from wxRuby. > > Could you submit this as a bug or feature request on the Rubyforge site > please, and we should be able to put it in the next main release. > > thanks > alex-- Posted via http://www.ruby-forum.com/.