pyvguicom 1.0.0__py3-none-any.whl → 1.1.1__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/__init__.py +1 -0
- pyvguicom/browsewin.py +10 -11
- pyvguicom/custwidg.py +110 -0
- pyvguicom/pgbox.py +59 -118
- pyvguicom/pgbutt.py +3 -2
- pyvguicom/pgentry.py +183 -22
- pyvguicom/pggui.py +239 -55
- pyvguicom/pgsel.py +441 -0
- pyvguicom/pgsimp.py +34 -265
- pyvguicom/pgtests.py +128 -0
- pyvguicom/pgtextview.py +0 -1
- pyvguicom/pgutils.py +391 -405
- pyvguicom/pgwkit.py +36 -27
- pyvguicom/testbutt.py +27 -25
- pyvguicom/testcust.py +49 -0
- pyvguicom/testentry.py +105 -0
- pyvguicom/testgui.py +125 -0
- pyvguicom/testlettsel.py +98 -0
- pyvguicom/testmsgs.py +142 -0
- pyvguicom/testnums.py +7 -12
- pyvguicom/testroot.py +7 -6
- pyvguicom/testsimple.py +24 -29
- pyvguicom/testtests.py +79 -0
- pyvguicom/testtextv.py +5 -14
- pyvguicom/testutils.py +139 -0
- {pyvguicom-1.0.0.dist-info → pyvguicom-1.1.1.dist-info}/METADATA +11 -5
- pyvguicom-1.1.1.dist-info/RECORD +32 -0
- pyvguicom/sutil.py +0 -344
- pyvguicom-1.0.0.dist-info/RECORD +0 -23
- {pyvguicom-1.0.0.dist-info → pyvguicom-1.1.1.dist-info}/WHEEL +0 -0
- {pyvguicom-1.0.0.dist-info → pyvguicom-1.1.1.dist-info}/top_level.txt +0 -0
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
from __future__ import print_function
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ from gi.repository import Gdk
|
|
|
12
12
|
from gi.repository import GObject
|
|
13
13
|
from gi.repository import GLib
|
|
14
14
|
|
|
15
|
-
from
|
|
15
|
+
from pgsel import *
|
|
16
16
|
from pgutils import *
|
|
17
17
|
from pggui import *
|
|
18
18
|
from pgbox import *
|
|
@@ -26,19 +26,11 @@ class testwin(Gtk.Window):
|
|
|
26
26
|
|
|
27
27
|
def __init__(self):
|
|
28
28
|
Gtk.Window.__init__(self)
|
|
29
|
-
self.set_default_size(1024, 768)
|
|
29
|
+
#self.set_default_size(1024, 768)
|
|
30
30
|
#self.set_default_size(800, 600)
|
|
31
31
|
self.set_position(Gtk.WindowPosition.CENTER)
|
|
32
32
|
self.connect("unmap", Gtk.main_quit)
|
|
33
33
|
|
|
34
|
-
def wrapscroll(what):
|
|
35
|
-
|
|
36
|
-
scroll2 = Gtk.ScrolledWindow()
|
|
37
|
-
scroll2.add(what)
|
|
38
|
-
frame2 = Gtk.Frame()
|
|
39
|
-
frame2.add(scroll2)
|
|
40
|
-
return frame2
|
|
41
|
-
|
|
42
34
|
# ------------------------------------------------------------------------
|
|
43
35
|
|
|
44
36
|
class pgtestwin(testwin):
|
|
@@ -82,6 +74,10 @@ class pgtestwin(testwin):
|
|
|
82
74
|
vbox.pack_start(hbox, 1, 1, 2)
|
|
83
75
|
vbox.pack_start(hbox5, 0, 0, 2)
|
|
84
76
|
|
|
77
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
78
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
79
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
80
|
+
|
|
85
81
|
self.add(vbox)
|
|
86
82
|
self.show_all()
|
|
87
83
|
|
|
@@ -110,7 +106,6 @@ class pgtestwin(testwin):
|
|
|
110
106
|
pass
|
|
111
107
|
|
|
112
108
|
tw = pgtestwin()
|
|
113
|
-
|
|
114
109
|
cnt = 0;
|
|
115
110
|
|
|
116
111
|
def handler_tick(ww):
|
pyvguicom/testroot.py
CHANGED
|
@@ -15,7 +15,7 @@ from gi.repository import Pango
|
|
|
15
15
|
#from gi.repository import WebKit2
|
|
16
16
|
|
|
17
17
|
from pgbutt import *
|
|
18
|
-
|
|
18
|
+
import pggui
|
|
19
19
|
|
|
20
20
|
# Allow the core to search pydbase
|
|
21
21
|
#fff = os.path.realpath(os.path.dirname(__file__) + os.sep + "../pydbase/")
|
|
@@ -100,7 +100,7 @@ class testWin(Gtk.Window):
|
|
|
100
100
|
|
|
101
101
|
vbox13 = Gtk.VBox()
|
|
102
102
|
|
|
103
|
-
#vbox13.pack_start(
|
|
103
|
+
#vbox13.pack_start(pggui.ySpacer(), 0, 0, 0)
|
|
104
104
|
vbox13.pack_start(Gtk.Label.new(" Test root entry window implementation "), 1, 1, 0)
|
|
105
105
|
|
|
106
106
|
#popup.set_titlebar(Gtk.Button())
|
|
@@ -109,16 +109,17 @@ class testWin(Gtk.Window):
|
|
|
109
109
|
self.arr = []
|
|
110
110
|
for aa in range(3):
|
|
111
111
|
self.arr.append(PopWin())
|
|
112
|
-
|
|
112
|
+
|
|
113
|
+
vbox13.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
113
114
|
|
|
114
115
|
hbox14 = Gtk.HBox()
|
|
115
|
-
hbox14.pack_start(
|
|
116
|
+
hbox14.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
116
117
|
butt3y = smallbutt("E_xit", self.exit_prog, "Exit program")
|
|
117
118
|
hbox14.pack_start(butt3y, 0, 0, 0)
|
|
118
|
-
hbox14.pack_start(
|
|
119
|
+
hbox14.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
119
120
|
|
|
120
121
|
vbox13.pack_start(hbox14, 0, 0, 0)
|
|
121
|
-
vbox13.pack_start(
|
|
122
|
+
vbox13.pack_start(pggui.ySpacer(12), 0, 0, 0)
|
|
122
123
|
|
|
123
124
|
self.set_size_request(300, 200)
|
|
124
125
|
self.add(vbox13)
|
pyvguicom/testsimple.py
CHANGED
|
@@ -1,36 +1,32 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
from __future__ import print_function
|
|
4
4
|
|
|
5
5
|
import os, sys, getopt, signal, select, string, time
|
|
6
6
|
import struct, stat, base64, random, zlib
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import gi
|
|
9
|
+
gi.require_version("Gtk", "3.0")
|
|
10
|
+
from gi.repository import Gtk
|
|
11
|
+
from gi.repository import Gdk
|
|
12
|
+
from gi.repository import GLib
|
|
13
|
+
from gi.repository import GObject
|
|
14
|
+
from gi.repository import Pango
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
import pgsimp
|
|
17
|
+
import pgutils
|
|
18
|
+
import pgtests
|
|
14
19
|
|
|
15
20
|
# ------------------------------------------------------------------------
|
|
16
21
|
class testwin(Gtk.Window):
|
|
17
22
|
|
|
18
23
|
def __init__(self):
|
|
19
24
|
Gtk.Window.__init__(self)
|
|
20
|
-
self.set_default_size(1024, 768)
|
|
21
|
-
|
|
25
|
+
#self.set_default_size(1024, 768)
|
|
26
|
+
self.set_default_size(800, 600)
|
|
22
27
|
self.set_position(Gtk.WindowPosition.CENTER)
|
|
23
28
|
self.connect("unmap", Gtk.main_quit)
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
def wrapscroll(what):
|
|
27
|
-
|
|
28
|
-
scroll2 = Gtk.ScrolledWindow()
|
|
29
|
-
scroll2.add(what)
|
|
30
|
-
frame2 = Gtk.Frame()
|
|
31
|
-
frame2.add(scroll2)
|
|
32
|
-
return frame2
|
|
33
|
-
|
|
34
30
|
# ------------------------------------------------------------------------
|
|
35
31
|
|
|
36
32
|
class pgtestwin(testwin):
|
|
@@ -48,30 +44,27 @@ class pgtestwin(testwin):
|
|
|
48
44
|
|
|
49
45
|
vbox = Gtk.VBox()
|
|
50
46
|
|
|
51
|
-
self.treeview = SimpleTree(("Hour", "Subject", "Alarm", "Notes"))
|
|
52
|
-
frame2 = wrapscroll(self.treeview)
|
|
47
|
+
self.treeview = pgsimp.SimpleTree(("Hour", "Subject", "Alarm", "Notes"))
|
|
48
|
+
frame2 = pgutils.wrapscroll(self.treeview)
|
|
53
49
|
hbox.pack_start(frame2, 1, 1, 2)
|
|
54
50
|
|
|
55
|
-
self.editor = SimpleEdit()
|
|
56
|
-
frame3 = wrapscroll(self.editor)
|
|
51
|
+
self.editor = pgsimp.SimpleEdit()
|
|
52
|
+
frame3 = pgutils.wrapscroll(self.editor)
|
|
57
53
|
hbox.pack_start(frame3, 1, 1, 2)
|
|
58
54
|
|
|
59
|
-
self.selector = LetterNumberSel(self.letterfilter, "Mono 16")
|
|
60
|
-
hbox2.pack_start(self.selector , 1, 1, 2)
|
|
61
|
-
|
|
62
55
|
vbox.pack_start(hbox3, 0, 0, 2)
|
|
63
56
|
vbox.pack_start(hbox2, 0, 0, 2)
|
|
64
57
|
vbox.pack_start(hbox4, 0, 0, 2)
|
|
65
58
|
vbox.pack_start(hbox, 1, 1, 2)
|
|
66
59
|
vbox.pack_start(hbox5, 0, 0, 2)
|
|
67
60
|
|
|
61
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
62
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
63
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
64
|
+
|
|
68
65
|
self.add(vbox)
|
|
69
66
|
self.show_all()
|
|
70
67
|
|
|
71
|
-
def letterfilter(self, letter):
|
|
72
|
-
#print("letterfilter", letter)
|
|
73
|
-
self.label.set_text(letter)
|
|
74
|
-
|
|
75
68
|
tw = pgtestwin()
|
|
76
69
|
|
|
77
70
|
#print("test")
|
|
@@ -79,7 +72,8 @@ tw = pgtestwin()
|
|
|
79
72
|
def fillrand():
|
|
80
73
|
aaa = []
|
|
81
74
|
for aa in range(10):
|
|
82
|
-
aaa.append( (randstr(12), randstr(12),
|
|
75
|
+
aaa.append( (pgtests.randstr(12), pgtests.randstr(12),
|
|
76
|
+
pgtests.randstr(12), pgtests.randstr(12)) )
|
|
83
77
|
return aaa
|
|
84
78
|
|
|
85
79
|
aaa = fillrand()
|
|
@@ -101,3 +95,4 @@ for aa in aaa:
|
|
|
101
95
|
|
|
102
96
|
Gtk.main()
|
|
103
97
|
|
|
98
|
+
# EOF
|
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,20 +1,11 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
'''
|
|
4
|
-
|
|
5
4
|
This is a test application for driving the pgTextView control;
|
|
6
5
|
It has load / save functionality.
|
|
7
|
-
|
|
8
6
|
'''
|
|
9
|
-
|
|
10
7
|
import os, sys, getopt, signal, random, time, warnings
|
|
11
8
|
|
|
12
|
-
#from pgutil import *
|
|
13
|
-
#from pgui import *
|
|
14
|
-
|
|
15
|
-
import pgutils
|
|
16
|
-
import pgtextview
|
|
17
|
-
|
|
18
9
|
import gi
|
|
19
10
|
gi.require_version("Gtk", "3.0")
|
|
20
11
|
from gi.repository import Gtk
|
|
@@ -23,12 +14,12 @@ from gi.repository import GLib
|
|
|
23
14
|
from gi.repository import GObject
|
|
24
15
|
from gi.repository import Pango
|
|
25
16
|
|
|
26
|
-
import
|
|
27
|
-
import
|
|
17
|
+
import pgutils
|
|
18
|
+
import pgtextview
|
|
28
19
|
|
|
29
20
|
#deftext = "It puzzles me when I see a person lacking fundamentals is \
|
|
30
|
-
# able to amass a fortune to the tune of billions. What is even more \
|
|
31
|
-
#puzziling is that they beleive their 'BS' and
|
|
21
|
+
# able to amass a fortune to the tune of billions. What is even more \3
|
|
22
|
+
#puzziling is that they beleive their own 'BS' and openly flout all."
|
|
32
23
|
|
|
33
24
|
# The pango example text
|
|
34
25
|
|
pyvguicom/testutils.py
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
from __future__ import print_function
|
|
4
|
+
|
|
5
|
+
import os, sys, getopt, signal, select, string, time
|
|
6
|
+
import struct, stat, base64, random, zlib
|
|
7
|
+
|
|
8
|
+
import gi
|
|
9
|
+
gi.require_version("Gtk", "3.0")
|
|
10
|
+
from gi.repository import Gtk
|
|
11
|
+
from gi.repository import Gdk
|
|
12
|
+
from gi.repository import GLib
|
|
13
|
+
from gi.repository import GObject
|
|
14
|
+
from gi.repository import Pango
|
|
15
|
+
|
|
16
|
+
import pgsimp
|
|
17
|
+
import pggui
|
|
18
|
+
import pgutils
|
|
19
|
+
|
|
20
|
+
def subdialog(arg2):
|
|
21
|
+
|
|
22
|
+
def pressed(arg2, arg3):
|
|
23
|
+
#print("pressed")
|
|
24
|
+
pggui.message("From sub", parent=arg3)
|
|
25
|
+
def pressed2(arg2, arg3):
|
|
26
|
+
#print("pressed2", arg2, arg3)
|
|
27
|
+
arg3.response(Gtk.ResponseType.OK)
|
|
28
|
+
arg3.destroy()
|
|
29
|
+
|
|
30
|
+
dialog = Gtk.Dialog()
|
|
31
|
+
dialog.set_size_request(200, 100)
|
|
32
|
+
dialog.add_button = (Gtk.ButtonsType.CLOSE, Gtk.ResponseType.OK)
|
|
33
|
+
bbb = Gtk.Button("Message")
|
|
34
|
+
dialog.vbox.pack_start(bbb, 0, 0, 0)
|
|
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, 0)
|
|
39
|
+
bbb.connect("pressed", pressed2, dialog)
|
|
40
|
+
dialog.show_all()
|
|
41
|
+
dialog.run()
|
|
42
|
+
|
|
43
|
+
# ------------------------------------------------------------------------
|
|
44
|
+
class testwin(Gtk.Window):
|
|
45
|
+
|
|
46
|
+
def __init__(self):
|
|
47
|
+
Gtk.Window.__init__(self)
|
|
48
|
+
#self.set_default_size(800, 600)
|
|
49
|
+
self.set_position(Gtk.WindowPosition.CENTER)
|
|
50
|
+
self.connect("unmap", Gtk.main_quit)
|
|
51
|
+
|
|
52
|
+
# ------------------------------------------------------------------------
|
|
53
|
+
|
|
54
|
+
class pgtestwin(testwin):
|
|
55
|
+
|
|
56
|
+
def __init__(self):
|
|
57
|
+
|
|
58
|
+
testwin.__init__(self)
|
|
59
|
+
|
|
60
|
+
hbox = Gtk.HBox(); hbox3 = Gtk.HBox()
|
|
61
|
+
hbox2 = Gtk.HBox(); hbox4 = Gtk.HBox()
|
|
62
|
+
hbox5 = Gtk.HBox()
|
|
63
|
+
|
|
64
|
+
self.label = Gtk.Label.new("Test strings here")
|
|
65
|
+
hbox5.pack_start(self.label, 0, 0, 2)
|
|
66
|
+
|
|
67
|
+
vbox = Gtk.VBox()
|
|
68
|
+
|
|
69
|
+
#vbox.pack_start(Gtk.Label(label="hello"), 1, 1, 2)
|
|
70
|
+
|
|
71
|
+
butt = Gtk.Button.new_with_mnemonic("Test about")
|
|
72
|
+
butt.connect("clicked", self.test_about)
|
|
73
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
74
|
+
|
|
75
|
+
#butt = Gtk.Button.new_with_mnemonic("Test Yes_no _cancel2")
|
|
76
|
+
#butt.connect("clicked", self.test_yes_no_cancel2)
|
|
77
|
+
#vbox.pack_start(butt, 0, 0, 2)
|
|
78
|
+
|
|
79
|
+
butt = Gtk.Button.new_with_mnemonic("Test Yes_no _cancel")
|
|
80
|
+
butt.connect("clicked", self.test_yes_no_cancel)
|
|
81
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
82
|
+
|
|
83
|
+
butt = Gtk.Button.new_with_mnemonic("Test Yes_no")
|
|
84
|
+
butt.connect("clicked", self.test_yes_no)
|
|
85
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
86
|
+
|
|
87
|
+
#butt = Gtk.Button.new_with_mnemonic("Test Yes_no2")
|
|
88
|
+
#butt.connect("clicked", self.test_yes_no2)
|
|
89
|
+
#vbox.pack_start(butt, 0, 0, 2)
|
|
90
|
+
#
|
|
91
|
+
#butt = Gtk.Button.new_with_mnemonic("Test M_essage2")
|
|
92
|
+
#butt.connect("clicked", self.test_message2)
|
|
93
|
+
#vbox.pack_start(butt, 0, 0, 2)
|
|
94
|
+
|
|
95
|
+
butt = Gtk.Button.new_with_mnemonic("Test M_essage")
|
|
96
|
+
butt.connect("clicked", self.test_message)
|
|
97
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
98
|
+
|
|
99
|
+
butt = Gtk.Button.new_with_mnemonic("Test Sub Dialog")
|
|
100
|
+
butt.connect("clicked", subdialog)
|
|
101
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
105
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
106
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
107
|
+
|
|
108
|
+
self.add(vbox)
|
|
109
|
+
self.show_all()
|
|
110
|
+
|
|
111
|
+
def test_about(self, arg2):
|
|
112
|
+
print(pgutils.about("Tester"))
|
|
113
|
+
|
|
114
|
+
def test_yes_no_cancel2(self, arg2):
|
|
115
|
+
print(pggui.yes_no_cancel2("Yes No Message"))
|
|
116
|
+
|
|
117
|
+
def test_yes_no_cancel(self, arg2):
|
|
118
|
+
print(pggui.yes_no_cancel("Yes No Message"))
|
|
119
|
+
|
|
120
|
+
def test_yes_no(self, arg2):
|
|
121
|
+
print(pggui.yes_no("Yes No Message"))
|
|
122
|
+
|
|
123
|
+
def test_yes_no2(self, arg2):
|
|
124
|
+
print(pggui.yes_no2("Yes No Message"))
|
|
125
|
+
|
|
126
|
+
def test_message2(self, arg2):
|
|
127
|
+
pggui.message2("Hello Message")
|
|
128
|
+
|
|
129
|
+
def test_message(self, arg2):
|
|
130
|
+
pggui.message("Hello Message")
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
tw = pgtestwin()
|
|
134
|
+
|
|
135
|
+
#print("test")
|
|
136
|
+
|
|
137
|
+
Gtk.main()
|
|
138
|
+
|
|
139
|
+
# EOF
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyvguicom
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: High power secure server GUI utility helpers.
|
|
5
|
-
Home-page: https://github.com/pglen/
|
|
5
|
+
Home-page: https://github.com/pglen/pyguicom.git
|
|
6
6
|
Author: Peter Glen
|
|
7
7
|
Author-email: peterglen99@gmail.com
|
|
8
|
-
Classifier:
|
|
9
|
-
Classifier:
|
|
10
|
-
Classifier:
|
|
8
|
+
Classifier: Development Status :: 6 - Mature
|
|
9
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Intended Audience :: System Administrators
|
|
12
|
+
Classifier: License :: OSI Approved :: Python Software Foundation License
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Classifier: Operating System :: POSIX
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
11
17
|
Requires-Python: >=3
|
|
12
18
|
Description-Content-Type: text/markdown
|
|
13
19
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
pyvguicom/__init__.py,sha256=2k_ZeqU7FvqZMFqGm-EYRiV98uxUxmiy5wXygvIobPU,13
|
|
2
|
+
pyvguicom/browsewin.py,sha256=gGSkwzkzFgQpZ2TvCfBH7uENnNL4d5uHhx9rkm-4938,7590
|
|
3
|
+
pyvguicom/custwidg.py,sha256=oaBg9ZeYORcBklXxZjN6jdeaQaisdLDZllshYy-w9QM,3693
|
|
4
|
+
pyvguicom/htmledit.py,sha256=gSxabFFGFxgaNvYtWOsXaaHCzYB-r6i7J5dhVLriQ94,10064
|
|
5
|
+
pyvguicom/pgbox.py,sha256=kI25mzT1o0PP-q6DT1Tg32geHKslnxIN5FjqVYe77Fc,20271
|
|
6
|
+
pyvguicom/pgbutt.py,sha256=GP_to9fMGuQXmAlYlHcvCYLHaCOb76mTt-SFvYS5BwY,6723
|
|
7
|
+
pyvguicom/pgentry.py,sha256=GJj7hHeSO_p6nVtExOy98TZwtOn-mahuBHC8t-K6xrM,10486
|
|
8
|
+
pyvguicom/pggui.py,sha256=fFig_4UxBEK8aqF_FhwiK83x9M19tfjwPFRn-VDKcJg,46488
|
|
9
|
+
pyvguicom/pgsel.py,sha256=VTmyeXB83sLxR5vbgLKcpPQlaVi8A4GdNCRdP4G3A5c,13350
|
|
10
|
+
pyvguicom/pgsimp.py,sha256=CrdyTrvtii3KCS-HAJ1W6WDnfRqmkHyI_dRHHzRrTBU,7628
|
|
11
|
+
pyvguicom/pgtests.py,sha256=ndlTMnRd4ECHziOixJcgT1KtCJxIXTJfnMGZhajKoYI,3228
|
|
12
|
+
pyvguicom/pgtextview.py,sha256=aAlmJX4UISI3MQtUI-_OoFacVLFIhcNIILzezC_x0DI,29341
|
|
13
|
+
pyvguicom/pgutils.py,sha256=t0HQNQCFWLA7mc0GPRs5tIL95FWfEsTnXKZ8jijm07M,31329
|
|
14
|
+
pyvguicom/pgwkit.py,sha256=bCyGJA5ILCLmHZGQEDkIu38NRhYFa8nxdYu30eBqK_Y,26237
|
|
15
|
+
pyvguicom/plug.py,sha256=qyoJtpEWCBwyp5DG9fwzrcJL-SqTjL9KzZ418YSaPwc,1017
|
|
16
|
+
pyvguicom/testbutt.py,sha256=6Bee05gI46Bw2EfWaZDH9PbIbtw5FKJbLd66HDelXmg,2902
|
|
17
|
+
pyvguicom/testcust.py,sha256=KKQLArvostu2uTKNEMyDFRF2rFU0h32fc1Y7hywnDq4,1150
|
|
18
|
+
pyvguicom/testentry.py,sha256=Rt5Q6dXb6Asfhg2fgxyyGR-Q1eUoL48IRcsKJV572nI,3091
|
|
19
|
+
pyvguicom/testgui.py,sha256=JLf3d5Kze7nglAquvqi_D0btxTY7us8OTtk-cEeP5nA,3624
|
|
20
|
+
pyvguicom/testicons.py,sha256=5Wd7Rk3vIyv61K4tvwCDVh_NclVrvf30ALsvfEhyQnQ,8947
|
|
21
|
+
pyvguicom/testlettsel.py,sha256=ZZMNUqaabZjd0RQdDUZ1hkuRqQxhurrg8FkuRrSKLhU,3019
|
|
22
|
+
pyvguicom/testmsgs.py,sha256=VhGRO5WZFDtloAMlw773hpXlmWCjRQI2jSqIoZLgLRU,4067
|
|
23
|
+
pyvguicom/testnums.py,sha256=T8NQFAviRv7Wx5IbBgEHfmthwXixuj6XgbGd8oUrq-o,3214
|
|
24
|
+
pyvguicom/testroot.py,sha256=MwGooMkNczSAQOj5aJbNnfPjSLsPmQrHk5OWY68rI3A,4082
|
|
25
|
+
pyvguicom/testsimple.py,sha256=IB5_5AKVpxeXHCYDc2pZxI0iA8b8Ps4mwiBitBajiq8,2371
|
|
26
|
+
pyvguicom/testtests.py,sha256=U3LGeByhFRBD4tc56uqM69xX3UY24efukMEWfro8ZOA,1883
|
|
27
|
+
pyvguicom/testtextv.py,sha256=3BkdjE5nLL3ZFLHQqeP2eAhO31BKjQO8SwHfBEMffdU,7126
|
|
28
|
+
pyvguicom/testutils.py,sha256=2mznZUNREo-tiOs1OWDPDNWBcMSq1kOYNvlTG0TsZ_s,3965
|
|
29
|
+
pyvguicom-1.1.1.dist-info/METADATA,sha256=UwXZ3p4N2WWqFtQyjc1C6DvZIC9sg4rdqa6vrd2TfuM,3109
|
|
30
|
+
pyvguicom-1.1.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
31
|
+
pyvguicom-1.1.1.dist-info/top_level.txt,sha256=TWIDRa6pMhB1Y4N_lGT1aO6tLoV7ZSUMlj0IaAHjm38,10
|
|
32
|
+
pyvguicom-1.1.1.dist-info/RECORD,,
|