Hello,
What I am looking to do is set up the OK and Cancel buttons for the action Show Message Box. Is there a way to set up the OK button to do something.
Here is what I am trying to do:
What I would like to is when I hit the ok button I want to open a folder.
I'd really like to learn how to configure the other buttons as well but the ok and cancel button explinations would be awesome.
Eventghost Version: 0.4.1.r.1722
Windows 10
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.
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.
How to configure the Show Message Box buttons
-
internaltheory79
- Posts: 3
- Joined: Thu Oct 16, 2014 12:10 am
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: How to configure the Show Message Box buttons
you need to be opening the message box from a script or a plugin
so what you would do is this.
this is all pseudo code and I have not tested it but it looks right. could have a typo somewhere tho
so what you would do is this.
Code: Select all
# different styles available
# wx.ICON_EXCLAMATION
# wx.ICON_HAND
# wx.ICON_ERROR
# wx.ICON_QUESTION
# wx.ICON_INFORMATION
# these can be added to the styles above with a | as a seperator
# wx.YES_NO
# wx.OK
# this style can be added if the wx.YES_NO is used
# wx.NO_DEFAULT
# these styles can be added to any combination of the above
# wx.STAY_ON_TOP
# wx.CANCEL
dlg = eg.MessageDialog(
parent=eg.document.frame,
message='This is a Test Message',
caption='This shows in the dialog title bar',
style=wx.YES_NO | wx.ICON_QUESTION,
pos=(100, 200) # this is for where you want the dialog to show up on the screen
)
if dlg.ShowModal() == wx.ID_YES:
CODE YOU WANT TO RUN IF THE YES BUTTON IS PRESSED
else:
CODE YOU WANT TO RUN IF THE NO BUTTON IS PRESSED
dlg.Destroy()
Re: How to configure the Show Message Box buttons
@ kgschlosser: I think he refers to
Hello internaltheory79,
if you press one of the buttons, EventGhost generates an event automatically, you should see it in the log if you press a button.
You can use this event to execute whatever action you want (e.g. open a folder)
Code: Select all
eg.plugins.EventGhost.ShowMessageBox()if you press one of the buttons, EventGhost generates an event automatically, you should see it in the log if you press a button.
You can use this event to execute whatever action you want (e.g. open a folder)
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: How to configure the Show Message Box buttons
OK I have never used that before
thanks Semi
thanks Semi

