get an event when something is done [SOLVED]

On 19/05/2015 at 03:20, xxxxxxxx wrote:

Hi all,

I'm working on a Modal Dialog Plungin.
And I whant to change my Plugin-Dialog when a object or a Tag is selectet while the Dialog is open.
I've found thomething in the SDK under "Continuous polling"
But I dont know what and where to insert.

I only need something like:

def something_is_seleced_or_deseleckted(doc) :   
    something_is_done = False   
    # here is the dedection....   
    something_is_done = True   
    return something_is_done   
if something_is_seleced_or_deseleckted(doc) :   

Thanks a lot

On 19/05/2015 at 08:48, xxxxxxxx wrote:

Hi Kissling,

I did not find 'continuous polling' in the SDK.  In any case, modal dialogs are meant to block all other UI to inform the user with a message, usually with a warning or error, or to get needed input of some kind before it can continue, especially in terms of accepting other input from the dialog it spawned from.  Therefore, what you describe cannot be done with a modal dialog, whether with a messaging system or polling.

To implement more or less what you describe, you must create a asynchronous (or modeless) dialog and make your main dialog send messages to it.  The asynchronous dialog will have to have message processing code to handle the updates.

Let me know if you need more info.

Joey Gaspe
SDK Support Engineer

On 19/05/2015 at 14:15, xxxxxxxx wrote:

Hy Joey,

in the C4D-SDK
at the end of the page I found this: polling

while gui.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, state) :   
    if state.GetInt32(c4d.BFM_INPUT_VALUE)==0: break   
    #x, y   

On 19/05/2015 at 16:15, xxxxxxxx wrote:

You can't interact with anything but the dialog when using a modal dialog.

On 20/05/2015 at 07:48, xxxxxxxx wrote:

Hi Kissling,

The continuous polling you pointed out is for modeless dialogs only. As I already stated and NiklasR also pointed out, a modal dialog cannot receive messages once it's created.  Please read the following Wikipedia page for an explanation of modal and modeless dialogs (the later ones are called asynchronous dialogs in the SDK) :

Joey Gaspe
SDK Support Engineer

On 21/05/2015 at 11:20, xxxxxxxx wrote:

i will beleve in you :-)

So I will change to non-modal-dialog!
Thanks a lot.

On 21/05/2015 at 11:30, xxxxxxxx wrote:

Hi Kissling,

Thanks for replying! I'll flag this topic as closed but leave it open for any follow up questions.

Joey Gaspe
SDK Support Engineer