disappearing dot in menus with radio items
-
- Knows some wx things
- Posts: 34
- Joined: Mon Jan 15, 2007 11:53 am
disappearing dot in menus with radio items
I have a group of radio menu items appended dynamically to my main menu. Every time I get EVT_MENU_OPEN I Destroy each radio item in the group and Append each radio menu item again. During this process, for one of the radio items I call Check to mark it as selected.
It works from the beginning, I can see the dot appearing close to the selected radio item. However the dot disappears after some time, say 10 minutes of using my program. Under debugger I see that a call to Check is executed every time I handle EVT_MENU_OPEN. I even assert that the item I want selected IsChecked() and yes, the assertion is true.
Funny...
It works from the beginning, I can see the dot appearing close to the selected radio item. However the dot disappears after some time, say 10 minutes of using my program. Under debugger I see that a call to Check is executed every time I handle EVT_MENU_OPEN. I even assert that the item I want selected IsChecked() and yes, the assertion is true.
Funny...
Piotr
-
- Knows some wx things
- Posts: 34
- Joined: Mon Jan 15, 2007 11:53 am
Let me explain the function of my group of radio items.
My app allows displaying multiple top windows. One document is open in one window, similarly to what MS Word does. The main menu has a "Window" menu that lists names of all currently open documents. The list may be different each time user opens "Window" menu.
My app allows displaying multiple top windows. One document is open in one window, similarly to what MS Word does. The main menu has a "Window" menu that lists names of all currently open documents. The list may be different each time user opens "Window" menu.
Piotr
-
- Knows some wx things
- Posts: 34
- Joined: Mon Jan 15, 2007 11:53 am
-
- wxWorld Domination!
- Posts: 1471
- Joined: Tue Nov 14, 2006 7:58 am
- Location: Saint-Petersburg, Russia
Re: disappearing dot in menus with radio items
Hi,
I don't sure it will help though, did you try to call wxMenu::UpdateUI() after all?piotrtrojanowski wrote:I have a group of radio menu items appended dynamically to my main menu. Every time I get EVT_MENU_OPEN I Destroy each radio item in the group and Append each radio menu item again. During this process, for one of the radio items I call Check to mark it as selected.
It works from the beginning, I can see the dot appearing close to the selected radio item. However the dot disappears after some time, say 10 minutes of using my program. Under debugger I see that a call to Check is executed every time I handle EVT_MENU_OPEN. I even assert that the item I want selected IsChecked() and yes, the assertion is true.
Funny...
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
-
- Knows some wx things
- Posts: 34
- Joined: Mon Jan 15, 2007 11:53 am
-
- Knows some wx things
- Posts: 34
- Joined: Mon Jan 15, 2007 11:53 am
Its a menu item your trying to check?
Try this?
Try this?
Code: Select all
menuPointer->Check(menuitem_id,true);
-
- Knows some wx things
- Posts: 34
- Joined: Mon Jan 15, 2007 11:53 am
-
- Knows some wx things
- Posts: 34
- Joined: Mon Jan 15, 2007 11:53 am
I have another group of radio menu items in the main menu. In the case of this group they are created once - at the program startup, as a part of main menu creation.
Interestingly I can make the dot disappear for this group as well.
This eliminates all doubts about correctness of code dealing with dynamic creation of menu items as a cause of the problem.
Interestingly I can make the dot disappear for this group as well.
This eliminates all doubts about correctness of code dealing with dynamic creation of menu items as a cause of the problem.
Piotr
Did you already finda solution for this problem?
I am working with a dynamic submenu. I add or remove radio menu items dynamically to this menu. One of this item should always be activated, but if I activate the last item in this submenu, the dot, that marks the active item, has disappeared.
If you solve this problem, I would appreciate it, if you post the solution ...
Thanks,
Xenia
I am working with a dynamic submenu. I add or remove radio menu items dynamically to this menu. One of this item should always be activated, but if I activate the last item in this submenu, the dot, that marks the active item, has disappeared.
If you solve this problem, I would appreciate it, if you post the solution ...
Thanks,
Xenia
-
- Knows some wx things
- Posts: 34
- Joined: Mon Jan 15, 2007 11:53 am