-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGUI.py
More file actions
executable file
·64 lines (58 loc) · 2.28 KB
/
Copy pathGUI.py
File metadata and controls
executable file
·64 lines (58 loc) · 2.28 KB
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
56
57
58
59
60
61
62
63
64
#!/usr/bin/python
# -*- coding: utf-8 -*-
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
import subprocess
import json
settings = Gtk.Settings.get_default()
settings.set_property("gtk-theme-name", "Adwaita")
settings.set_property("gtk-font-name", "DejaVu Sans 30")
settings.set_property("gtk-application-prefer-dark-theme", True)
class ourwindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="ResumeME")
Gtk.Window.set_default_size(self, 400,325)
Gtk.Window.set_position(self, Gtk.WindowPosition.CENTER)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
self.add(vbox)
self.entry = Gtk.Entry()
self.entry.set_text("Enter internsg link here")
vbox.pack_start(self.entry, True, True, 0)
hbox = Gtk.Box(spacing=6)
vbox.pack_start(hbox, True, True, 0)
button1 = Gtk.Button.new_with_label("Click when done inserting link")
button1.connect("clicked", self.whenbutton1_clicked)
hbox.pack_start(button1, True, True, 0)
def whenbutton1_clicked(self, button):
link = "./main.sh " + self.entry.get_text()
subprocess.call(link, shell=True)
window.destroy()
window = ourwindow()
window.connect("destroy", Gtk.main_quit)
window.show_all()
Gtk.main()
class TreeViewFilterWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Phrases to consider")
Gtk.Window.set_default_size(self, 400,325)
Gtk.Window.set_position(self, Gtk.WindowPosition.CENTER)
with open('filtered.json') as f:
data = json.load(f)
self.liststore = Gtk.ListStore(str, str)
for key,value in data.items():
self.liststore.append([key,value])
treeview = Gtk.TreeView(model=self.liststore)
renderer_num = Gtk.CellRendererText()
column_num = Gtk.TreeViewColumn("Number", renderer_num, text=0)
treeview.append_column(column_num)
renderer_value = Gtk.CellRendererText()
column_value = Gtk.TreeViewColumn(
"Value", renderer_value, text=1
)
treeview.append_column(column_value)
self.add(treeview)
window = TreeViewFilterWindow()
window.connect("destroy", Gtk.main_quit)
window.show_all()
Gtk.main()