Creating corrent menuitems with xrcise

Hi List,

actually I’m trying to generate my UI with wxFormBuilder. But I
haven’t managed to create correct plattform-independent Quit- and
About-Menuitem with the correct IDs (Wx::ID_EXIT, Wx::ID_ABOUT). Can
anyone tell me how to do this?

Everything I tried so far leads to not working menu items or false
menu items in i.e. Mac OS.

Regards,
Timo

Timo S. wrote:

actually I’m trying to generate my UI with wxFormBuilder. But I
haven’t managed to create correct plattform-independent Quit- and
About-Menuitem with the correct IDs (Wx::ID_EXIT, Wx::ID_ABOUT). Can
anyone tell me how to do this?

I haven’t used wxFormBuilder. But looking at the screenshots, there is a
box in a panel on the right-hand side called “Object Properties”. At the
top of the yellow tinted section in this list of properties, there is an
entry called “id” which I guess has the default value “wxID_ANY”. To use
one of the standard ids, change this to wxID_EXIT, wxID_ABOUT.

Generally to map from C++ constant and class names to Ruby, replace the
preceding wx (lower case) with Wx:: (module name).

C++ -> Ruby
wxWindow -> Wx::Window
wxID_EXIT -> Wx::ID_EXIT

a

Hey guys,

Sorry, been busy with RL. Actually, you just need to define wxID_EXIT,
and
wxID_ABOUT in the wxFormBuilder. On the Ruby side, you need to use
Wx::ID_EXIT and Wx::ID_ABOUT to catch it. This is cause of the naming
conventions, and how Ruby doesn’t allow constants to be formed with a
lowercase first letter. EG: All constants, classes, and modules need to
start their first character as an Uppercase letter. Ruby will throw a
tissy
fit when you don’t do this.

Again, sorry for the late reply.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs