-
Notifications
You must be signed in to change notification settings - Fork 4
/
simpleDialog.py
40 lines (33 loc) · 982 Bytes
/
simpleDialog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
#Simple dialog
import wx
import ctypes
import sys
def dialog(title, message,parent=None):
dialog = wx.MessageDialog(parent,message,title,wx.OK)
dialog.ShowModal()
dialog.Destroy()
return
def yesNoDialog(title, message,parent=None):
dialog = wx.MessageDialog(parent,message,title,wx.YES_NO)
result = dialog.ShowModal()
dialog.Destroy()
return result
def errorDialog(message,parent=None):
dialog = wx.MessageDialog(parent,message,"error",wx.OK|wx.ICON_ERROR)
dialog.ShowModal()
dialog.Destroy()
return
def debugDialog(message):
if hasattr(sys, "frozen") == False:
if type(message) != str:
import pprint
message = pprint.pformat(message)
dialog = wx.MessageDialog(None,message,"debug",wx.OK)
dialog.ShowModal()
dialog.Destroy()
return
def winDialog(title,message):
ctypes.windll.user32.MessageBoxW(0,message,title,0x00000040)
def simpleDialog(title,message):
ctypes.windll.user32.MessageBoxW(0,message,title,0x00000040)