PDA

View Full Version : Moving a window / Closing a window (ScriptJob)


th0rse
11-02-2009, 01:17 PM
Is it possible to execute a command when I move a window?
I am also wondering if it's possible to execute some code when someone clicks on the close button of the window (But before actually closing it)

It sounds like I will have to use a scriptJob for that.
Any ideas about how to do that?

Thanks

Robert Bateman
11-02-2009, 02:58 PM
Minimise / Maximise yes.

AFAIK, there's no on-move script job available.

As for deleting a UI element, there's MUiMessage::addUiDeletedCallbackin the API, but no idea about an equivalent for script job. There probably is one if you list the events....

ewerybody
11-03-2009, 08:25 AM
scriptJob -parent $windowName -uiDeleted $controlName $scriptCommand;

th0rse
11-03-2009, 11:20 AM
Nice one Eric! That's exactly what I was looking for!

Is it possible to have a piece of code to execute when a window is re sized as well ?


Thanks Robert and Eric for your replies.

norbertnacu
11-05-2009, 03:02 AM
Try this:

string $win = "dummyWindow";
if( `window -ex $win` )
{
deleteUI $win;
}

window -mnc "confirmDialog -m \"minimized\"" -rc "confirmDialog -m \"resized\"" -mxb false -t (interToUI( $win )) $win;
showWindow $win;

ewerybody
11-05-2009, 05:41 AM
@th0rse: yea it would be nice to have such a possibility. But unfortunately there is none. What you can do is: parent a scriptjob under your window that fires a command on selectionCHange to rearrange your window. Thats not instant but .. there isn't really much you can do :/

CGTalk Moderation
11-05-2009, 05:41 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.