Remove Stray ShowPopUpDialog?
GeDialogthat calls for a
ShowPopupDialogand in turns call another
It works but the problem is it has this stray show pop up dialog.
I can exit through it with several clicks but it comes mildly annoying.
Is there a way to force close it? Much the same way with
You can check the problem here:
Hi @bentraje can you share your code?
I will say it really probably that you call ShowPopupDialog on any BFM_INPUT event and not to an enough specific one.
Any update on this?
Thanks for the response. I'll get back to you as soon as I can. The problem is part of a larger code base and I'm having a bit of problem on trimming it down.
Can I consider it closed?
Without more information from your side, I will set the topic as solved at the end of the week.
Apologies for neglecting this one.
RE: I will say it really probably that you call ShowPopupDialog on any BFM_INPUT event and not to an enough specific one.
I had this part as a code base. So in a way I'm using the
MOUSE_RIGHTas a filter and not necessarily as any input.
self.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSERIGHT, state) if state.GetInt32(c4d.BFM_INPUT_VALUE) == True: popup_result = self.rename_cmd_popup_menu()
You can check the illustration file here:
Thank you for looking at the file. Apologies again for the trouble.
m_adam last edited by m_adam
Hi this is the same issue than Disable default Right-Click Menu.
So typically if you display a PopupDialog you have to not forward the event so to do that, call GeDialog.KillEvent before the popup dialog is open, then instead of forwarding the message with
return c4d.gui.GeDialog.Message(self, msg, result)``simplyreturn True`.
This gave us in rename_cmd_popup_menu
self.KillEvents() result = gui.ShowPopupDialog(cd=None, bc=menu, x=c4d.MOUSEPOS, y=c4d.MOUSEPOS)
popup_result = self.rename_cmd_popup_menu() return True # after a PopupDialog is open don't forward the message.
Thanks for the response (and the reference link)
Works as expected.