Page 1 of 1

Fading Dialogs

Posted: Tue Jun 20, 2017 5:59 am
by kgschlosser
Here is a little tidbit of code for adding some "flare" to EG


create a macro with the event Main.OnInit
add the Python Script action and paste the code below into it.
then restart EG.. and open a config dialog for an action or a plugin.

Code: Select all


import time
import wx
import threading

def Show(self):

    def run():
        transparent = 0
        while transparent < 255:
            transparent += 1
            wx.CallAfter(self.SetTransparent, transparent)
            wx.CallAfter(wx.Dialog.Show, self)
            time.sleep(0.005)
            
    self.SetTransparent(0)
    wx.Dialog.Show(self)
    
    threading.Thread(target=run).start()

eg.globals.original_destroy = eg.ConfigDialog.Destroy

def Destroy(self):
    def run():
        transparent = 255
        while transparent > 0:
            transparent -= 1
            wx.CallAfter(self.SetTransparent, transparent)
            wx.CallAfter(wx.Dialog.Show, self)
            time.sleep(0.005)
            
        eg.globals.original_destroy(self)
        
    threading.Thread(target=run).start()


eg.ConfigDialog.Show = Show
eg.ConfigDialog.Destroy = Destroy

Re: Fading Dialogs

Posted: Tue Jun 20, 2017 12:59 pm
by Diz
thats pretty awesome! by the way the indents are back when you use the 'SELECT ALL' button :(

Re: Fading Dialogs

Posted: Tue Jun 20, 2017 4:05 pm
by kgschlosser
hmmmm don't know why... I am messing with it now but it appears as tho it got reverted.. and I am not sure as to why