The GetHMenuOf() macro seems not available ...
on 2010-03-08 14:56
Lui Kore wrote: > The GetHMenuOf() macro seems not available ... > Wx::Frame#get_menu_bar , I think alex
on 2010-03-08 16:00
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
on 2010-03-08 16:11
Forgive my terrible English ... This function seems to be a windows-only feature, it lives in %WXWIN%/include/msw/menu.h
on 2010-03-08 18:36
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.
on 2010-03-09 01:27
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
on 2010-03-09 04:54
Done. http://rubyforge.org/tracker/index.php?func=detail... 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
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.