pyvguicom 1.0.1__py3-none-any.whl → 1.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyvguicom might be problematic. Click here for more details.
- pyvguicom/browsewin.py +10 -11
- pyvguicom/docs/__index__.py +0 -0
- pyvguicom/docs/browsewin.html +956 -0
- pyvguicom/docs/htmledit.html +903 -0
- pyvguicom/docs/pgbox.html +2470 -0
- pyvguicom/docs/pgbutt.html +727 -0
- pyvguicom/docs/pgentry.html +1024 -0
- pyvguicom/docs/pggui.html +5476 -0
- pyvguicom/docs/pgsel.html +1539 -0
- pyvguicom/docs/pgsimp.html +1048 -0
- pyvguicom/docs/pgtextview.html +2421 -0
- pyvguicom/docs/pgutils.html +2664 -0
- pyvguicom/docs/pgwkit.html +2277 -0
- pyvguicom/docs/sutil.html +907 -0
- pyvguicom/pgentry.py +75 -9
- pyvguicom/pggui.py +191 -92
- pyvguicom/pgsel.py +9 -7
- pyvguicom/pgtests.py +128 -0
- pyvguicom/pgutils.py +42 -394
- pyvguicom/pgwkit.py +36 -27
- pyvguicom/testbutt.py +1 -1
- pyvguicom/testcust.py +1 -1
- pyvguicom/testentry.py +19 -7
- pyvguicom/testgui.py +125 -0
- pyvguicom/testlettsel.py +1 -1
- pyvguicom/testmsgs.py +142 -0
- pyvguicom/testnums.py +1 -1
- pyvguicom/testsimple.py +4 -3
- pyvguicom/testtests.py +79 -0
- pyvguicom/testtextv.py +2 -2
- pyvguicom/testutils.py +139 -0
- {pyvguicom-1.0.1.dist-info → pyvguicom-1.1.2.dist-info}/METADATA +8 -11
- pyvguicom-1.1.2.dist-info/RECORD +45 -0
- pyvguicom-1.0.1.dist-info/RECORD +0 -27
- {pyvguicom-1.0.1.dist-info → pyvguicom-1.1.2.dist-info}/WHEEL +0 -0
- {pyvguicom-1.0.1.dist-info → pyvguicom-1.1.2.dist-info}/top_level.txt +0 -0
pyvguicom/pgwkit.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
|
|
3
|
-
''' This encapsulates the webkit '''
|
|
3
|
+
''' This encapsulates the webkit import and failure thereof '''
|
|
4
4
|
|
|
5
5
|
import os, sys, getopt, signal, random, time, warnings
|
|
6
6
|
import inspect
|
|
7
7
|
|
|
8
|
-
realinc = os.path.realpath(os.path.dirname(__file__) + os.sep + "../pycommon")
|
|
9
|
-
sys.path.append(realinc)
|
|
8
|
+
#realinc = os.path.realpath(os.path.dirname(__file__) + os.sep + "../pycommon")
|
|
9
|
+
#sys.path.append(realinc)
|
|
10
10
|
|
|
11
11
|
from pgutils import *
|
|
12
12
|
from pggui import *
|
|
@@ -22,25 +22,48 @@ from gi.repository import GLib
|
|
|
22
22
|
from gi.repository import GObject
|
|
23
23
|
from gi.repository import Pango
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
WebKit2 = None
|
|
26
|
+
|
|
27
|
+
class dummywebview(Gtk.VBox):
|
|
28
|
+
|
|
29
|
+
def __int__(self):
|
|
30
|
+
super().__init__(self)
|
|
31
|
+
#self.pack_start(Gtk.Label(label="No WebView"), 1, 1, 0)
|
|
26
32
|
def set_editable(self, flag):
|
|
33
|
+
self.pack_start(Gtk.Label(label="No WebView Available"), 1, 1, 0)
|
|
27
34
|
pass
|
|
28
|
-
def load_html(self, ff, kk):
|
|
35
|
+
def load_html(self, ff, kk = None):
|
|
29
36
|
pass
|
|
30
37
|
def connect(self, aa, bb):
|
|
31
38
|
pass
|
|
32
39
|
|
|
33
40
|
class dummywebkit():
|
|
34
41
|
WebView = dummywebview
|
|
35
|
-
def __init(self):
|
|
36
|
-
pass
|
|
37
|
-
|
|
38
|
-
# Here is where / how the toolbar is constructed
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
#
|
|
43
|
+
try:
|
|
44
|
+
gi.require_version("WebKit2", '4.1')
|
|
45
|
+
from gi.repository import WebKit2
|
|
46
|
+
#present = 1
|
|
47
|
+
except:
|
|
48
|
+
try:
|
|
49
|
+
#print("Trying V 4.0:", sys.exc_info())
|
|
50
|
+
gi.require_version("WebKit2", '4.0')
|
|
51
|
+
from gi.repository import WebKit2
|
|
52
|
+
except:
|
|
53
|
+
try:
|
|
54
|
+
#print("Trying with jno qualifier")
|
|
55
|
+
#gi.require_version("WebKit2", '4.0')
|
|
56
|
+
from gi.repository import WebKit2
|
|
57
|
+
except:
|
|
58
|
+
# Giving up, patch fake one
|
|
59
|
+
print("Cannot import:", sys.exc_info())
|
|
60
|
+
print("WebWiew is not available.")
|
|
61
|
+
try:
|
|
62
|
+
WebKit2 = dummywebkit
|
|
63
|
+
except:
|
|
64
|
+
print("Fake kit Exc:", sys.exc_info())
|
|
65
|
+
#print("Fake kit:", WebKit2)
|
|
66
|
+
#raise
|
|
44
67
|
|
|
45
68
|
ui_def = """
|
|
46
69
|
<ui>
|
|
@@ -80,20 +103,6 @@ ui_def = """
|
|
|
80
103
|
</ui>
|
|
81
104
|
"""
|
|
82
105
|
|
|
83
|
-
try:
|
|
84
|
-
gi.require_version('WebKit2', '4.0')
|
|
85
|
-
from gi.repository import WebKit2
|
|
86
|
-
|
|
87
|
-
#print(WebKit2)
|
|
88
|
-
#print("Webkit ver", WebKit2.get_major_version(), WebKit2.get_minor_version(), WebKit2.get_micro_version())
|
|
89
|
-
present = 1
|
|
90
|
-
|
|
91
|
-
except:
|
|
92
|
-
print("Cannot import webkit2, web functions may not be available.")
|
|
93
|
-
present = 0
|
|
94
|
-
WebKit2 = dummywebkit
|
|
95
|
-
#raise
|
|
96
|
-
|
|
97
106
|
#unmask_reserved = Gdk.ModifierType.GDK_MODIFIER_RESERVED_13_MASK | \
|
|
98
107
|
# Gdk.ModifierType.GDK_MODIFIER_RESERVED_14_MASK | \
|
|
99
108
|
# Gdk.ModifierType.GDK_MODIFIER_RESERVED_15_MASK | \
|
pyvguicom/testbutt.py
CHANGED
pyvguicom/testcust.py
CHANGED
pyvguicom/testentry.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
from __future__ import print_function
|
|
4
4
|
|
|
@@ -33,10 +33,6 @@ class pgtestwin(testwin):
|
|
|
33
33
|
|
|
34
34
|
testwin.__init__(self)
|
|
35
35
|
|
|
36
|
-
hbox5 = Gtk.HBox()
|
|
37
|
-
|
|
38
|
-
self.label = Gtk.Label.new("Test strings here")
|
|
39
|
-
hbox5.pack_start(self.label, 1, 1, 2)
|
|
40
36
|
|
|
41
37
|
gridx = Gtk.Grid()
|
|
42
38
|
gridx.set_column_spacing(6)
|
|
@@ -61,11 +57,23 @@ class pgtestwin(testwin):
|
|
|
61
57
|
tp3 = ("Location of birth: ", "lob", "Location: City / Country", None)
|
|
62
58
|
tp4 = ("Nick Name: ", "nick", "Enter nick name / Alias if available", None)
|
|
63
59
|
lab3, lab4 = pgentry.gridquad(gridx, 0, rowcnt, tp3, tp4)
|
|
60
|
+
lab2.set_gray(True)
|
|
64
61
|
self.dat_dict['lob'] = lab3
|
|
65
62
|
self.dat_dict['nick'] = lab4
|
|
66
63
|
rowcnt += 1
|
|
67
64
|
|
|
68
|
-
|
|
65
|
+
tp5 = ("Long entr_y ", "nick", "Test Long entry", None)
|
|
66
|
+
lab5 = pgentry.griddouble(gridx, 0, rowcnt, tp5)
|
|
67
|
+
self.dat_dict['lob'] = lab5
|
|
68
|
+
rowcnt += 1
|
|
69
|
+
|
|
70
|
+
tp6 = ("Long entr_y (read only)", "nick", "Test Long entry", None)
|
|
71
|
+
lab6 = pgentry.griddouble(gridx, 0, rowcnt, tp6)
|
|
72
|
+
lab6.set_gray(True)
|
|
73
|
+
self.dat_dict['lob'] = lab6
|
|
74
|
+
rowcnt += 1
|
|
75
|
+
|
|
76
|
+
tp6x = ("Note_s: ", "", "Text for Notes. Press Shift Enter to advance Tab", None)
|
|
69
77
|
lab6x = pgentry.gridsingle(gridx, 0, rowcnt, tp6x)
|
|
70
78
|
self.dat_dict['notes'] = lab6x
|
|
71
79
|
rowcnt += 1
|
|
@@ -77,7 +85,11 @@ class pgtestwin(testwin):
|
|
|
77
85
|
hbox2.pack_start(gridx, 1, 1, 2)
|
|
78
86
|
|
|
79
87
|
vbox.pack_start(hbox2, 0, 0, 2)
|
|
80
|
-
|
|
88
|
+
|
|
89
|
+
#hbox5 = Gtk.HBox()
|
|
90
|
+
#self.label = Gtk.Label.new("Test strings here")
|
|
91
|
+
#hbox5.pack_start(self.label, 1, 1, 2)
|
|
92
|
+
#vbox.pack_start(hbox5, 0, 0, 2)
|
|
81
93
|
|
|
82
94
|
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
83
95
|
butt.connect("clicked", Gtk.main_quit)
|
pyvguicom/testgui.py
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import os, sys, getopt, signal, select, string, time
|
|
4
|
+
import struct, stat, base64, random, zlib
|
|
5
|
+
|
|
6
|
+
import gi
|
|
7
|
+
gi.require_version("Gtk", "3.0")
|
|
8
|
+
from gi.repository import Gtk
|
|
9
|
+
from gi.repository import Gdk
|
|
10
|
+
from gi.repository import GObject
|
|
11
|
+
from gi.repository import GLib
|
|
12
|
+
from gi.repository import Pango
|
|
13
|
+
|
|
14
|
+
gi.require_version('PangoCairo', '1.0')
|
|
15
|
+
from gi.repository import PangoCairo
|
|
16
|
+
|
|
17
|
+
import pggui
|
|
18
|
+
|
|
19
|
+
def timer(ledx):
|
|
20
|
+
# Reset LED
|
|
21
|
+
ledx.set_color(ledx.orgcolor) #"#ffffff")
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
if __name__ == "__main__":
|
|
25
|
+
|
|
26
|
+
w = Gtk.Window()
|
|
27
|
+
w.set_size_request(400, 300)
|
|
28
|
+
w.connect("destroy", Gtk.main_quit)
|
|
29
|
+
|
|
30
|
+
vbox = Gtk.VBox(); hbox = Gtk.HBox()
|
|
31
|
+
|
|
32
|
+
lab1=Gtk.Label(label="Test\nText\n Here\n")
|
|
33
|
+
hbox.pack_start(lab1, 1, 1, 0)
|
|
34
|
+
vbox.pack_start(hbox, 1, 1, 0)
|
|
35
|
+
|
|
36
|
+
arr = [("111 ", "222 "), ("333 ", "444")]
|
|
37
|
+
tt = pggui.TextTable(arr)
|
|
38
|
+
|
|
39
|
+
hbox4b = Gtk.HBox()
|
|
40
|
+
hbox4b.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
41
|
+
hbox4b.pack_start(tt, 0, 0, 0)
|
|
42
|
+
hbox4b.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
43
|
+
vbox.pack_start(hbox4b, 0, 0, 2)
|
|
44
|
+
|
|
45
|
+
#tr = pggui.TextRow("aa", "bb", w)
|
|
46
|
+
#vbox.pack_start(tr, 0, 0, 2)
|
|
47
|
+
|
|
48
|
+
def _callb(arg2, arg3 = 0, arg4 = 0):
|
|
49
|
+
print("callb", arg2, arg3, arg4)
|
|
50
|
+
lab1.set_text("callb \n" + str(arg2)[:24] \
|
|
51
|
+
+ "\n" + str(arg3)[:24] + "\n" + str(arg4)[:24])
|
|
52
|
+
led.set_color("#ff0000")
|
|
53
|
+
GLib.timeout_add(300, timer, led)
|
|
54
|
+
|
|
55
|
+
logo = pggui.Logo("Logo", font="Dejavu 32")
|
|
56
|
+
vbox.pack_start(logo, 0, 0, 2)
|
|
57
|
+
|
|
58
|
+
hbox4a = Gtk.HBox()
|
|
59
|
+
wb = pggui.WideButt("Wide Button", _callb, 24)
|
|
60
|
+
hbox4a.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
61
|
+
hbox4a.pack_start(wb, 0, 0, 0)
|
|
62
|
+
hbox4a.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
63
|
+
vbox.pack_start(hbox4a, 0, 0, 2)
|
|
64
|
+
|
|
65
|
+
lb = pggui.LabelButt("Label Button", _callb, None)
|
|
66
|
+
vbox.pack_start(lb, 0, 0, 2)
|
|
67
|
+
|
|
68
|
+
la = pggui.Label("Label", font="italic")
|
|
69
|
+
vbox.pack_start(la, 0, 0, 2)
|
|
70
|
+
|
|
71
|
+
ft = pggui.FrameTextView()
|
|
72
|
+
for aa in range(10):
|
|
73
|
+
ft.append("Hello %d\n" % aa)
|
|
74
|
+
|
|
75
|
+
vbox.pack_start(ft, 0, 0, 2)
|
|
76
|
+
|
|
77
|
+
marr = ["First Menu Item","Second Menu Item","Third Menu Item",
|
|
78
|
+
"Fourth Menu Item", ]
|
|
79
|
+
|
|
80
|
+
hbox3 = Gtk.HBox()
|
|
81
|
+
mb = pggui.MenuButt(marr, _callb, None)
|
|
82
|
+
hbox3.pack_start(mb, 0, 0, 0)
|
|
83
|
+
|
|
84
|
+
hbox3.pack_start(Gtk.Label(label=" Menu Button "), 0, 0, 0)
|
|
85
|
+
hbox3.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
86
|
+
led = pggui.Led("#fffffff")
|
|
87
|
+
hbox3.pack_start(led, 0, 0, 0)
|
|
88
|
+
hbox3.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
89
|
+
#hbox3.pack_start(led, 1, 1, 0)
|
|
90
|
+
vbox.pack_start(hbox3, 0, 0, 2)
|
|
91
|
+
|
|
92
|
+
#hbox4 = Gtk.HBox()
|
|
93
|
+
#hbox4.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
94
|
+
#hbox4.pack_start(led, 0, 0, 0)
|
|
95
|
+
#hbox4.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
96
|
+
#vbox.pack_start(hbox4, 0, 0, 2)
|
|
97
|
+
|
|
98
|
+
rarr = ["One", "Two", "Three", "Four", "Five"]
|
|
99
|
+
rg = pggui.RadioGroup(rarr, _callb, True)
|
|
100
|
+
vbox.pack_start(rg, 0, 0, 2)
|
|
101
|
+
|
|
102
|
+
hbox5 = Gtk.HBox()
|
|
103
|
+
cb = pggui.ComboBox(marr, _callb)
|
|
104
|
+
hbox5.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
105
|
+
hbox5.pack_start(cb, 0, 0, 2)
|
|
106
|
+
hbox5.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
107
|
+
vbox.pack_start(hbox5, 0, 0, 2)
|
|
108
|
+
|
|
109
|
+
hbox6 = Gtk.HBox()
|
|
110
|
+
sp = pggui.Spinner(cb=_callb)
|
|
111
|
+
hbox6.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
112
|
+
hbox6.pack_start(sp, 0, 0, 2)
|
|
113
|
+
hbox6.pack_start(Gtk.Label(label=" "), 1, 1, 0)
|
|
114
|
+
vbox.pack_start(hbox6, 0, 0, 2)
|
|
115
|
+
|
|
116
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
117
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
118
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
119
|
+
|
|
120
|
+
w.add(vbox)
|
|
121
|
+
w.show_all()
|
|
122
|
+
w.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
|
|
123
|
+
Gtk.main()
|
|
124
|
+
|
|
125
|
+
# EOF
|
pyvguicom/testlettsel.py
CHANGED
pyvguicom/testmsgs.py
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import os, sys, getopt, signal, select, string, time
|
|
4
|
+
import struct, stat, base64, random, zlib
|
|
5
|
+
|
|
6
|
+
import gi
|
|
7
|
+
gi.require_version("Gtk", "3.0")
|
|
8
|
+
from gi.repository import Gtk
|
|
9
|
+
from gi.repository import Gdk
|
|
10
|
+
from gi.repository import GObject
|
|
11
|
+
from gi.repository import GLib
|
|
12
|
+
from gi.repository import Pango
|
|
13
|
+
|
|
14
|
+
gi.require_version('PangoCairo', '1.0')
|
|
15
|
+
from gi.repository import PangoCairo
|
|
16
|
+
|
|
17
|
+
import pgtests, pggui
|
|
18
|
+
|
|
19
|
+
def subdialog(arg2):
|
|
20
|
+
|
|
21
|
+
def pressed(arg2, arg3):
|
|
22
|
+
#print("pressed")
|
|
23
|
+
pggui.message("From sub", parent=arg3)
|
|
24
|
+
def pressed2(arg2, arg3):
|
|
25
|
+
#print("pressed2", arg2, arg3)
|
|
26
|
+
arg3.response(Gtk.ResponseType.OK)
|
|
27
|
+
arg3.destroy()
|
|
28
|
+
|
|
29
|
+
dialog = Gtk.Dialog(title="Sub")
|
|
30
|
+
#dialog.set_size_request(200, 100)
|
|
31
|
+
dialog.add_button("OK", Gtk.ResponseType.OK)
|
|
32
|
+
|
|
33
|
+
bbb = Gtk.Button.new_with_mnemonic("Message")
|
|
34
|
+
dialog.vbox.pack_start(bbb, 0, 0, 4)
|
|
35
|
+
bbb.connect("pressed", pressed, dialog)
|
|
36
|
+
#buttons=Gtk.ButtonsType.CLOSE)
|
|
37
|
+
bbb = Gtk.Button.new_with_mnemonic("E_xit Sub")
|
|
38
|
+
dialog.vbox.pack_start(bbb, 0, 0, 4)
|
|
39
|
+
bbb.connect("pressed", pressed2, dialog)
|
|
40
|
+
dialog.connect("response", lambda d, r: d.destroy())
|
|
41
|
+
dialog.show_all()
|
|
42
|
+
dialog.run()
|
|
43
|
+
|
|
44
|
+
def test_message(arg2):
|
|
45
|
+
pggui.message("Hello Message")
|
|
46
|
+
|
|
47
|
+
def test_message_long(arg2):
|
|
48
|
+
pggui.message("Hello Message\nHere we go, longer str.")
|
|
49
|
+
|
|
50
|
+
def test_yes_no_cancel(arg2):
|
|
51
|
+
ret = pggui.yes_no_cancel("Test Yes No Cancel Message\n" \
|
|
52
|
+
"Are you sure?")
|
|
53
|
+
mmm = pggui.resp2str(ret)
|
|
54
|
+
print(mmm)
|
|
55
|
+
lab1.set_text(mmm)
|
|
56
|
+
|
|
57
|
+
def test_no_yes_cancel(arg2):
|
|
58
|
+
ret = pggui.yes_no_cancel("Test No Yes Cancel Message\n" \
|
|
59
|
+
"Are you sure?", default="No")
|
|
60
|
+
mmm = pggui.resp2str(ret)
|
|
61
|
+
print(mmm)
|
|
62
|
+
lab1.set_text(mmm)
|
|
63
|
+
|
|
64
|
+
def test_cancel_no_yes(arg2):
|
|
65
|
+
ret = pggui.yes_no_cancel("Test No Yes Cancel Message\n" \
|
|
66
|
+
"Are you sure?", default="Cancel")
|
|
67
|
+
mmm = pggui.resp2str(ret)
|
|
68
|
+
print(mmm)
|
|
69
|
+
lab1.set_text(mmm)
|
|
70
|
+
|
|
71
|
+
def test_yes_no(arg2):
|
|
72
|
+
ret = pggui.yes_no("Test Yes No Message\n" \
|
|
73
|
+
"Are You sure?")
|
|
74
|
+
mmm = pggui.resp2str(ret)
|
|
75
|
+
print(mmm)
|
|
76
|
+
lab1.set_text(mmm)
|
|
77
|
+
|
|
78
|
+
def test_no_yes(arg2):
|
|
79
|
+
ret = pggui.yes_no("Test No Yes Message\n" \
|
|
80
|
+
"Are You sure?", default="No")
|
|
81
|
+
mmm = pggui.resp2str(ret)
|
|
82
|
+
print(mmm)
|
|
83
|
+
lab1.set_text(mmm)
|
|
84
|
+
|
|
85
|
+
if __name__ == "__main__":
|
|
86
|
+
|
|
87
|
+
ww = Gtk.Window()
|
|
88
|
+
#ww.set_size_request(400, 300)
|
|
89
|
+
ww.connect("destroy", Gtk.main_quit)
|
|
90
|
+
|
|
91
|
+
vbox = Gtk.VBox()
|
|
92
|
+
hbox = Gtk.HBox()
|
|
93
|
+
|
|
94
|
+
global lab1
|
|
95
|
+
lab1 = Gtk.Label(label="Test Label")
|
|
96
|
+
hbox.pack_start(lab1, 1, 1, 4)
|
|
97
|
+
vbox.pack_start(hbox, 1, 1, 4)
|
|
98
|
+
|
|
99
|
+
butt = Gtk.Button.new_with_mnemonic("Test M_essage")
|
|
100
|
+
butt.connect("clicked", test_message)
|
|
101
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
102
|
+
|
|
103
|
+
butt = Gtk.Button.new_with_mnemonic("Subdialog M_essage")
|
|
104
|
+
butt.connect("clicked", subdialog)
|
|
105
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
106
|
+
|
|
107
|
+
butt = Gtk.Button.new_with_mnemonic("Test Longer Message")
|
|
108
|
+
butt.connect("clicked", test_message_long)
|
|
109
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
110
|
+
|
|
111
|
+
butt = Gtk.Button.new_with_mnemonic("Test Yes _no")
|
|
112
|
+
butt.connect("clicked", test_yes_no)
|
|
113
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
114
|
+
|
|
115
|
+
butt = Gtk.Button.new_with_mnemonic("Test No Yes")
|
|
116
|
+
butt.connect("clicked", test_no_yes)
|
|
117
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
118
|
+
|
|
119
|
+
butt = Gtk.Button.new_with_mnemonic("Test Yes _no _cancel")
|
|
120
|
+
butt.connect("clicked", test_yes_no_cancel)
|
|
121
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
122
|
+
|
|
123
|
+
butt = Gtk.Button.new_with_mnemonic("Test _no Yes _cancel")
|
|
124
|
+
butt.connect("clicked", test_no_yes_cancel)
|
|
125
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
126
|
+
|
|
127
|
+
butt = Gtk.Button.new_with_mnemonic("Test cancel _Yes Nol")
|
|
128
|
+
butt.connect("clicked", test_cancel_no_yes)
|
|
129
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
133
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
134
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
135
|
+
|
|
136
|
+
ww.add(vbox)
|
|
137
|
+
ww.show_all()
|
|
138
|
+
|
|
139
|
+
#signal.signal(signal.SIGINT, signal.SIG_DFL)
|
|
140
|
+
Gtk.main()
|
|
141
|
+
|
|
142
|
+
|
pyvguicom/testnums.py
CHANGED
pyvguicom/testsimple.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
from __future__ import print_function
|
|
4
4
|
|
|
@@ -15,6 +15,7 @@ from gi.repository import Pango
|
|
|
15
15
|
|
|
16
16
|
import pgsimp
|
|
17
17
|
import pgutils
|
|
18
|
+
import pgtests
|
|
18
19
|
|
|
19
20
|
# ------------------------------------------------------------------------
|
|
20
21
|
class testwin(Gtk.Window):
|
|
@@ -71,8 +72,8 @@ tw = pgtestwin()
|
|
|
71
72
|
def fillrand():
|
|
72
73
|
aaa = []
|
|
73
74
|
for aa in range(10):
|
|
74
|
-
aaa.append( (
|
|
75
|
-
|
|
75
|
+
aaa.append( (pgtests.randstr(12), pgtests.randstr(12),
|
|
76
|
+
pgtests.randstr(12), pgtests.randstr(12)) )
|
|
76
77
|
return aaa
|
|
77
78
|
|
|
78
79
|
aaa = fillrand()
|
pyvguicom/testtests.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import os, sys, getopt, signal, select, string, time
|
|
4
|
+
import struct, stat, base64, random, zlib
|
|
5
|
+
|
|
6
|
+
import gi
|
|
7
|
+
gi.require_version("Gtk", "3.0")
|
|
8
|
+
from gi.repository import Gtk
|
|
9
|
+
from gi.repository import Gdk
|
|
10
|
+
from gi.repository import GObject
|
|
11
|
+
from gi.repository import GLib
|
|
12
|
+
from gi.repository import Pango
|
|
13
|
+
|
|
14
|
+
gi.require_version('PangoCairo', '1.0')
|
|
15
|
+
from gi.repository import PangoCairo
|
|
16
|
+
|
|
17
|
+
import pgtests
|
|
18
|
+
|
|
19
|
+
def test_rand(arg2, arg3):
|
|
20
|
+
rrr = pgtests.randascii(12)
|
|
21
|
+
print(rrr)
|
|
22
|
+
arg3.set_text(rrr)
|
|
23
|
+
|
|
24
|
+
def test_rand2(arg2, arg3):
|
|
25
|
+
rrr = pgtests.randisodate()
|
|
26
|
+
print(rrr)
|
|
27
|
+
arg3.set_text(rrr)
|
|
28
|
+
|
|
29
|
+
def test_rand3(arg2, arg3):
|
|
30
|
+
rrr = pgtests.simname(12)
|
|
31
|
+
print(rrr)
|
|
32
|
+
arg3.set_text(rrr)
|
|
33
|
+
|
|
34
|
+
def test_rand4(arg2, arg3):
|
|
35
|
+
rrr = pgtests.randate()
|
|
36
|
+
print(rrr)
|
|
37
|
+
arg3.set_text(rrr)
|
|
38
|
+
|
|
39
|
+
if __name__ == "__main__":
|
|
40
|
+
|
|
41
|
+
w = Gtk.Window()
|
|
42
|
+
w.set_size_request(400, 300)
|
|
43
|
+
w.connect("destroy", Gtk.main_quit)
|
|
44
|
+
|
|
45
|
+
vbox = Gtk.VBox()
|
|
46
|
+
hbox = Gtk.HBox()
|
|
47
|
+
|
|
48
|
+
lab1 = Gtk.Label(label="Test Label")
|
|
49
|
+
hbox.pack_start(lab1, 1, 1, 0)
|
|
50
|
+
vbox.pack_start(hbox, 1, 1, 0)
|
|
51
|
+
|
|
52
|
+
butt = Gtk.Button.new_with_mnemonic("Test Rand")
|
|
53
|
+
butt.connect("clicked", test_rand, lab1)
|
|
54
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
55
|
+
|
|
56
|
+
butt = Gtk.Button.new_with_mnemonic("Test randisodate")
|
|
57
|
+
butt.connect("clicked", test_rand2, lab1)
|
|
58
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
59
|
+
|
|
60
|
+
butt = Gtk.Button.new_with_mnemonic("Test simname")
|
|
61
|
+
butt.connect("clicked", test_rand3, lab1)
|
|
62
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
63
|
+
|
|
64
|
+
butt = Gtk.Button.new_with_mnemonic("Test randdate")
|
|
65
|
+
butt.connect("clicked", test_rand4, lab1)
|
|
66
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
67
|
+
|
|
68
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
69
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
70
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
71
|
+
|
|
72
|
+
w.add(vbox)
|
|
73
|
+
w.show_all()
|
|
74
|
+
#w.present()
|
|
75
|
+
|
|
76
|
+
#signal.signal(signal.SIGINT, signal.SIG_DFL)
|
|
77
|
+
Gtk.main()
|
|
78
|
+
|
|
79
|
+
|
pyvguicom/testtextv.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
'''
|
|
4
4
|
This is a test application for driving the pgTextView control;
|
|
@@ -18,7 +18,7 @@ import pgutils
|
|
|
18
18
|
import pgtextview
|
|
19
19
|
|
|
20
20
|
#deftext = "It puzzles me when I see a person lacking fundamentals is \
|
|
21
|
-
# able to amass a fortune to the tune of billions. What is even more \
|
|
21
|
+
# able to amass a fortune to the tune of billions. What is even more \3
|
|
22
22
|
#puzziling is that they beleive their own 'BS' and openly flout all."
|
|
23
23
|
|
|
24
24
|
# The pango example text
|