-
Notifications
You must be signed in to change notification settings - Fork 12
/
dialogbox.py
56 lines (45 loc) · 1.51 KB
/
dialogbox.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Dialog Box Class
# Dialog Box
import gtk
import gtk.glade
class DialogBox:
def __init__(self,parent,wTree):
# Set the Glade file
self.wTree = wTree
# Load pointer for dialog box
self.window = self.wTree.get_widget("dialogbox")
self.window.set_title("Wacom Control Panel")
self.window.set_transient_for(parent)
self.window.set_destroy_with_parent(True)
self.window.set_skip_taskbar_hint(1)
self.window.set_skip_pager_hint(1)
#self.window.present()
self.label = self.wTree.get_widget("dialoglbl")
#self.label.set_text(message)
self.window.connect("destroy",self.callbackYes)
self.window.connect("key-press-event", self.keydown)
self.button2 = self.wTree.get_widget("dialogyes")
self.button2.connect("button-press-event",self.callbackYes)
#gtk.main()
def callbackYes(self,widget=None,event=None):
self.window.hide()
try:
gtk.main_quit()
except:
pass
def keydown(self,widget=None,event=None):
Key_Enter1 = 104
Key_Enter2 = 36
Key_Escape = 9
key = event.hardware_keycode
if key == Key_Enter1 or key==Key_Enter2:
self.callbackYes()
elif key == Key_Escape:
pass
#self.callbackNo()
def NewMessage(self,message, title):
self.window.set_title(title)
self.label.set_markup(message)
self.window.present()
gtk.main()
return