Solved Remove Stray ShowPopUpDialog?

Hi,

I have GeDialog that calls for a ShowPopupDialog and in turns call another GeDialog.
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 GeDialog.Close()?

You can check the problem here:
https://www.dropbox.com/s/evgmizzcs205oyv/c4d210_stray_pop_up_dialog.mp4?dl=0

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.
Cheers,
Maxime.

Any update on this?

Hi @m_adam

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.

Cheers,
Maxime

Hi @m_adam,

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_RIGHT as 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:
https://www.dropbox.com/s/2xhmn4ia75f0lit/c4d210_stray_pop_up_dialog02.zip?dl=0

Thank you for looking at the file. Apologies again for the trouble.

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)``simply return True`.

This gave us in rename_cmd_popup_menu

self.KillEvents()
result = gui.ShowPopupDialog(cd=None, bc=menu, x=c4d.MOUSEPOS, y=c4d.MOUSEPOS)

in Message

popup_result = self.rename_cmd_popup_menu()
return True # after a PopupDialog is open don't forward the message.

Cheers,
Maxime.

@m_adam

Thanks for the response (and the reference link)
Works as expected.