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/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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
4
|
|
|
@@ -14,8 +14,8 @@ from gi.repository import Pango
|
|
|
14
14
|
gi.require_version('WebKit2', '4.0')
|
|
15
15
|
from gi.repository import WebKit2
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
import pgbutt
|
|
18
|
+
import pggui
|
|
19
19
|
|
|
20
20
|
class testWin(Gtk.Window):
|
|
21
21
|
|
|
@@ -26,49 +26,51 @@ class testWin(Gtk.Window):
|
|
|
26
26
|
|
|
27
27
|
vbox13 = Gtk.VBox()
|
|
28
28
|
|
|
29
|
-
vbox13.pack_start(
|
|
30
|
-
vbox13.pack_start(Gtk.Label.new("
|
|
31
|
-
#vbox13.pack_start(
|
|
29
|
+
vbox13.pack_start(pggui.ySpacer(), 0, 0, 0)
|
|
30
|
+
vbox13.pack_start(Gtk.Label.new("Smallbutt TEST implementation"), 1, 1, 0)
|
|
31
|
+
#vbox13.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
32
32
|
|
|
33
33
|
hbox13 = Gtk.HBox()
|
|
34
|
-
hbox13.pack_start(
|
|
35
|
-
butt3x = smallbutt(" _Find in Text ", self.findx, "")
|
|
34
|
+
hbox13.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
35
|
+
butt3x = pgbutt.smallbutt(" _Find in Text ", self.findx, "")
|
|
36
36
|
hbox13.pack_start(butt3x, 0, 0, 0)
|
|
37
|
-
hbox13.pack_start(
|
|
38
|
-
butt3z = smallbutt(" _Search All ", self.findx, "")
|
|
37
|
+
hbox13.pack_start(pggui.ySpacer(), 0, 0, 0)
|
|
38
|
+
butt3z = pgbutt.smallbutt(" _Search All ", self.findx, "")
|
|
39
39
|
hbox13.pack_start(butt3z, 0, 0, 0)
|
|
40
|
-
hbox13.pack_start(
|
|
40
|
+
hbox13.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
41
41
|
|
|
42
42
|
hbox16 = Gtk.HBox()
|
|
43
|
-
hbox16.pack_start(
|
|
44
|
-
butt3x = smallbutt("_Align in Text", self.findx, "")
|
|
43
|
+
hbox16.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
44
|
+
butt3x = pgbutt.smallbutt("_Align in Text", self.findx, "")
|
|
45
45
|
hbox16.pack_start(butt3x, 0, 0, 0)
|
|
46
|
-
hbox16.pack_start(
|
|
47
|
-
butt3z = smallbutt("_Delete All", self.delx, "")
|
|
46
|
+
hbox16.pack_start(pggui.ySpacer(), 0, 0, 0)
|
|
47
|
+
butt3z = pgbutt.smallbutt("_Delete All", self.delx, "")
|
|
48
48
|
hbox16.pack_start(butt3z, 0, 0, 0)
|
|
49
|
-
hbox16.pack_start(
|
|
49
|
+
hbox16.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
50
50
|
|
|
51
51
|
hbox14 = Gtk.HBox()
|
|
52
|
-
hbox14.pack_start(
|
|
53
|
-
butt3y = smallbutt("E_xit", self.exit_prog, "Exit program")
|
|
52
|
+
hbox14.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
53
|
+
butt3y = pgbutt.smallbutt("E_xit", self.exit_prog, "Exit program")
|
|
54
54
|
hbox14.pack_start(butt3y, 0, 0, 0)
|
|
55
|
-
hbox14.pack_start(
|
|
55
|
+
hbox14.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
56
56
|
|
|
57
57
|
hbox15 = Gtk.HBox()
|
|
58
|
-
hbox15.pack_start(
|
|
59
|
-
butt3z = Gtk.Button.new_with_mnemonic("Regular _Button")
|
|
58
|
+
hbox15.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
59
|
+
butt3z = Gtk.Button.new_with_mnemonic("Regular small _Button")
|
|
60
60
|
butt3z.set_relief(Gtk.ReliefStyle.NONE)
|
|
61
61
|
butt3z.connect("clicked", self.regbutt)
|
|
62
62
|
hbox15.pack_start(butt3z, 0, 0, 0)
|
|
63
|
-
hbox15.pack_start(
|
|
63
|
+
hbox15.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
64
|
+
|
|
64
65
|
|
|
65
66
|
vbox13.pack_start(hbox13, 0, 0, 0)
|
|
66
67
|
vbox13.pack_start(hbox16, 0, 0, 0)
|
|
67
|
-
#vbox13.pack_start(hbox15, 0, 0, 0)
|
|
68
68
|
vbox13.pack_start(hbox14, 0, 0, 0)
|
|
69
|
-
vbox13.pack_start(
|
|
69
|
+
vbox13.pack_start(hbox15, 0, 0, 0)
|
|
70
|
+
|
|
71
|
+
vbox13.pack_start(pggui.ySpacer(), 1, 1, 0)
|
|
70
72
|
|
|
71
|
-
self.set_size_request(
|
|
73
|
+
self.set_size_request(400, 300)
|
|
72
74
|
self.add(vbox13)
|
|
73
75
|
self.show_all()
|
|
74
76
|
|
pyvguicom/testcust.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
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 custwidg
|
|
18
|
+
|
|
19
|
+
if __name__ == "__main__":
|
|
20
|
+
|
|
21
|
+
w = Gtk.Window()
|
|
22
|
+
w.set_size_request(400, 300)
|
|
23
|
+
w.connect("destroy", Gtk.main_quit)
|
|
24
|
+
|
|
25
|
+
vbox = Gtk.VBox()
|
|
26
|
+
hbox = Gtk.HBox()
|
|
27
|
+
|
|
28
|
+
sw = custwidg.SimpleWidget()
|
|
29
|
+
|
|
30
|
+
hbox.pack_start(Gtk.Label(label=" b "), 0, 0, 0)
|
|
31
|
+
hbox.pack_start(sw, 1, 1, 0)
|
|
32
|
+
hbox.pack_start(Gtk.Label(label=" e "), 0, 0, 0)
|
|
33
|
+
|
|
34
|
+
vbox.pack_start(Gtk.Label(label=" t "), 0, 0, 0)
|
|
35
|
+
vbox.pack_start(hbox, 1, 1, 0)
|
|
36
|
+
vbox.pack_start(Gtk.Label(label=" b "), 0, 0, 0)
|
|
37
|
+
|
|
38
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
39
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
40
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
41
|
+
|
|
42
|
+
w.add(vbox)
|
|
43
|
+
w.show_all()
|
|
44
|
+
#w.present()
|
|
45
|
+
|
|
46
|
+
#signal.signal(signal.SIGINT, signal.SIG_DFL)
|
|
47
|
+
Gtk.main()
|
|
48
|
+
|
|
49
|
+
|
pyvguicom/testentry.py
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
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 GObject
|
|
13
|
+
from gi.repository import GLib
|
|
14
|
+
|
|
15
|
+
import pgentry
|
|
16
|
+
import pgutils
|
|
17
|
+
import pggui
|
|
18
|
+
|
|
19
|
+
# ------------------------------------------------------------------------
|
|
20
|
+
class testwin(Gtk.Window):
|
|
21
|
+
|
|
22
|
+
def __init__(self):
|
|
23
|
+
Gtk.Window.__init__(self)
|
|
24
|
+
#self.set_default_size(800, 600)
|
|
25
|
+
self.set_position(Gtk.WindowPosition.CENTER)
|
|
26
|
+
self.connect("unmap", Gtk.main_quit)
|
|
27
|
+
|
|
28
|
+
# ------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
class pgtestwin(testwin):
|
|
31
|
+
|
|
32
|
+
def __init__(self):
|
|
33
|
+
|
|
34
|
+
testwin.__init__(self)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
gridx = Gtk.Grid()
|
|
38
|
+
gridx.set_column_spacing(6)
|
|
39
|
+
gridx.set_row_spacing(6)
|
|
40
|
+
|
|
41
|
+
vbox = Gtk.VBox()
|
|
42
|
+
|
|
43
|
+
rowcnt = 0
|
|
44
|
+
self.dat_dict = {}
|
|
45
|
+
sumx = Gtk.HBox()
|
|
46
|
+
buttx2 = Gtk.Button.new_with_mnemonic("Sele_ct Date")
|
|
47
|
+
tp1 =("Full Nam_e: ", "name", "Enter full name (TAB to advance)", None)
|
|
48
|
+
tp2 = ("Date o_f birth: ", "dob", "Date of birth, YYYY/MM/DD", None)
|
|
49
|
+
lab1, lab2 = pgentry.gridquad(gridx, rowcnt, 0, tp1, tp2, buttx2)
|
|
50
|
+
#buttx2.connect("clicked", self.pressed_dob, lab2)
|
|
51
|
+
self.dat_dict['name'] = lab1
|
|
52
|
+
self.dat_dict['dob'] = lab2
|
|
53
|
+
rowcnt += 1
|
|
54
|
+
|
|
55
|
+
#gridx.attach(pggui.vspacer(8), 0, rowcnt, 1, 1)
|
|
56
|
+
|
|
57
|
+
tp3 = ("Location of birth: ", "lob", "Location: City / Country", None)
|
|
58
|
+
tp4 = ("Nick Name: ", "nick", "Enter nick name / Alias if available", None)
|
|
59
|
+
lab3, lab4 = pgentry.gridquad(gridx, 0, rowcnt, tp3, tp4)
|
|
60
|
+
lab2.set_gray(True)
|
|
61
|
+
self.dat_dict['lob'] = lab3
|
|
62
|
+
self.dat_dict['nick'] = lab4
|
|
63
|
+
rowcnt += 1
|
|
64
|
+
|
|
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)
|
|
77
|
+
lab6x = pgentry.gridsingle(gridx, 0, rowcnt, tp6x)
|
|
78
|
+
self.dat_dict['notes'] = lab6x
|
|
79
|
+
rowcnt += 1
|
|
80
|
+
|
|
81
|
+
#gridx.attach(pggui.vspacer(8), 0, rowcnt, 1, 1)
|
|
82
|
+
#rowcnt += 1
|
|
83
|
+
|
|
84
|
+
hbox2 = Gtk.HBox()
|
|
85
|
+
hbox2.pack_start(gridx, 1, 1, 2)
|
|
86
|
+
|
|
87
|
+
vbox.pack_start(hbox2, 0, 0, 2)
|
|
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)
|
|
93
|
+
|
|
94
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
95
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
96
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
97
|
+
|
|
98
|
+
self.add(vbox)
|
|
99
|
+
self.show_all()
|
|
100
|
+
|
|
101
|
+
tw = pgtestwin()
|
|
102
|
+
#print("test")
|
|
103
|
+
Gtk.main()
|
|
104
|
+
|
|
105
|
+
# EOF
|
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
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
from pgsel import *
|
|
9
|
+
from pgutils import *
|
|
10
|
+
|
|
11
|
+
# ------------------------------------------------------------------------
|
|
12
|
+
class testwin(Gtk.Window):
|
|
13
|
+
|
|
14
|
+
def __init__(self):
|
|
15
|
+
Gtk.Window.__init__(self)
|
|
16
|
+
#self.set_default_size(1024, 768)
|
|
17
|
+
#self.set_default_size(800, 600)
|
|
18
|
+
self.set_position(Gtk.WindowPosition.CENTER)
|
|
19
|
+
self.connect("unmap", Gtk.main_quit)
|
|
20
|
+
|
|
21
|
+
def wrapscroll(what):
|
|
22
|
+
|
|
23
|
+
scroll2 = Gtk.ScrolledWindow()
|
|
24
|
+
scroll2.add(what)
|
|
25
|
+
frame2 = Gtk.Frame()
|
|
26
|
+
frame2.add(scroll2)
|
|
27
|
+
return frame2
|
|
28
|
+
|
|
29
|
+
# ------------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
class pgtestwin(testwin):
|
|
32
|
+
|
|
33
|
+
def __init__(self):
|
|
34
|
+
|
|
35
|
+
testwin.__init__(self)
|
|
36
|
+
|
|
37
|
+
#hbox = Gtk.HBox();
|
|
38
|
+
|
|
39
|
+
vbox = Gtk.VBox()
|
|
40
|
+
|
|
41
|
+
self.selector = LetterNumberSel(self.letterfilter, "Mono 16", " ")
|
|
42
|
+
self.selector.set_tooltip_text("Arrow key to navigate, enter / space key to filter")
|
|
43
|
+
|
|
44
|
+
hbox2 = Gtk.HBox();
|
|
45
|
+
hbox2.pack_start(Gtk.Label.new(" "), 0, 0, 2)
|
|
46
|
+
hbox2.pack_start(self.selector , 1, 1, 2)
|
|
47
|
+
hbox2.pack_start(Gtk.Label.new(" "), 0, 0, 2)
|
|
48
|
+
vbox.pack_start(hbox2, 0, 0, 2)
|
|
49
|
+
|
|
50
|
+
hbox3 = Gtk.HBox();
|
|
51
|
+
self.num = NumberSel("1 2 3 4 5 6 7 8 9", self.letterfilter, "Mono 16")
|
|
52
|
+
self.num.set_tooltip_text("Arrow key to navigate, enter / space key to filter")
|
|
53
|
+
hbox3.pack_start(Gtk.Label.new(" "), 1, 1, 2)
|
|
54
|
+
hbox3.pack_start(self.num, 0, 0, 2)
|
|
55
|
+
hbox3.pack_start(Gtk.Label.new(" "), 1, 1, 2)
|
|
56
|
+
vbox.pack_start(hbox3, 0, 0, 2)
|
|
57
|
+
|
|
58
|
+
hbox4 = Gtk.HBox();
|
|
59
|
+
self.num = HourSel(self.letterfilter)
|
|
60
|
+
self.num.set_tooltip_text("Arrow key to navigate, enter / space key to filter")
|
|
61
|
+
hbox4.pack_start(Gtk.Label.new(" "), 1, 1, 2)
|
|
62
|
+
hbox4.pack_start(self.num, 0, 0, 2)
|
|
63
|
+
hbox4.pack_start(Gtk.Label.new(" "), 1, 1, 2)
|
|
64
|
+
vbox.pack_start(hbox4, 0, 0, 2)
|
|
65
|
+
|
|
66
|
+
hbox4a = Gtk.HBox();
|
|
67
|
+
self.minx = MinSel(self.letterfilter)
|
|
68
|
+
self.minx.set_tooltip_text("Arrow key to navigate, enter / space key to filter")
|
|
69
|
+
hbox4a.pack_start(Gtk.Label.new(" "), 1, 1, 2)
|
|
70
|
+
hbox4a.pack_start(self.minx, 0, 0, 2)
|
|
71
|
+
hbox4a.pack_start(Gtk.Label.new(" "), 1, 1, 2)
|
|
72
|
+
vbox.pack_start(hbox4a, 0, 0, 2)
|
|
73
|
+
|
|
74
|
+
#vbox.pack_start(hbox, 1, 1, 2)
|
|
75
|
+
|
|
76
|
+
hbox5 = Gtk.HBox()
|
|
77
|
+
self.label = Gtk.Label.new("Test callback strings here.")
|
|
78
|
+
hbox5.pack_start(self.label, 1, 1, 2)
|
|
79
|
+
vbox.pack_start(hbox5, 0, 0, 2)
|
|
80
|
+
|
|
81
|
+
butt = Gtk.Button.new_with_mnemonic("E_xit")
|
|
82
|
+
butt.connect("clicked", Gtk.main_quit)
|
|
83
|
+
vbox.pack_start(butt, 0, 0, 2)
|
|
84
|
+
|
|
85
|
+
self.add(vbox)
|
|
86
|
+
self.show_all()
|
|
87
|
+
|
|
88
|
+
def letterfilter(self, letter):
|
|
89
|
+
print("letterfilter '%s'" % letter)
|
|
90
|
+
self.label.set_text("Callback: '%s'" % letter)
|
|
91
|
+
|
|
92
|
+
tw = pgtestwin()
|
|
93
|
+
|
|
94
|
+
#print("test")
|
|
95
|
+
|
|
96
|
+
Gtk.main()
|
|
97
|
+
|
|
98
|
+
# EOF
|