Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Fading Dialogs

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Fading Dialogs

Post 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
If you like the work I have been doing then feel free to Image
Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: Fading Dialogs

Post by Diz »

thats pretty awesome! by the way the indents are back when you use the 'SELECT ALL' button :(
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Fading Dialogs

Post 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
If you like the work I have been doing then feel free to Image
Post Reply