Fading Dialogs
Posted: Tue Jun 20, 2017 5:59 am
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.
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