Jump to content


Photo

[Solved] execute a function when closing a tool window??

show_custom_dialog function when closing dialog renoise.app()

  • Please log in to reply
2 replies to this topic

#1 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1035 posts
  • Gender:Male
  • Location:Spain

Posted 10 August 2017 - 21:34

I use "renoise.app():show_custom_dialog" for a window tool. This window has a X  to "close window".  Is it possible to execute a function by pressing this "X"?

 

I want to stop a timer when I close the window. Actually, this window (secondary window) is invoked from another tool window (principal window).

 

Thanks for the help!


Edited by Raul (ulneiz), 11 August 2017 - 15:39.

  • encryptedmind likes this

:excl: Development of my tool: GT16-Colors

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#2 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1505 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 11 August 2017 - 07:11

The only way to do this, currently, is to use an idle notifier and check the property "visible" of the dialog object.

 

(This, or the even uglier solution of using a modal dialog and your very own custom close button.)


Edited by joule, 11 August 2017 - 07:12.


#3 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1035 posts
  • Gender:Male
  • Location:Spain

Posted 11 August 2017 - 15:39

Thanks Joule! Ok, I will use a notifier to check dialog.visible. I do not really like using a notifier to close a timer.  It would be great to be able to execute a function when closing a window, since it requires an action (press a button or command).

 

I already have a custom button that opens and closes the window. There is no problem here. I miss being able to control the top bar of the tool window, the title, the X button ...


:excl: Development of my tool: GT16-Colors

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler