User forums > General (but related to Code::Blocks)

bug in wxSmith? re: Checkable menu item not checkable

(1/1)

pdsonic:
Hi,

I'm not sure if this is the right forum.

I'm using CB 5106 on WinXP SP2

On my main wxFrame I have a menu item that is checkable. In wxSmith I set the item as Check, but when I examine the object using the debugger the Menu item kind is wxITEM_NORMAL. And of course the check mark does not appear when I click on it.

However, if I set its kind MenuItem->SetKind( wxITEM_CHECK ), after it is constructed, it works.

Also, this is using the XRC file.

Thanks.

pdsonic

byo:
Yup, this is a bug, thanks for reporting :)

BYO

pdsonic:
You're welcome.   :)

And I have another one...

For obtaining the MenuItem's address the auto-generated code is as follows:

   MenuItemAbout = (wxMenuItem*)FindWindow(XRCID("idMenuItemAbout"));

But this returns NULL. After looking on the forums (MenuItem's do not inherit from wxWindow), I found that the following works for me:

   MenuItemAbout = GetMenuBar()->FindItem(XRCID("idMenuItemAbout"));


This is a minor problem, as the workaround is quite easy.


pdsonic

byo:
Thanks again :)

I'm just starting to fix it :) Should be ready today.

Regards
   BYO

EDIT: Fixed in rev. 5136

Navigation

[0] Message Index

Go to full version