-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
87 lines (66 loc) · 3.08 KB
/
main.py
File metadata and controls
87 lines (66 loc) · 3.08 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import sys
from PyQt6.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget, QMenuBar, QMenu
from PyQt6.QtGui import QAction, QFont
from PyQt6.QtCore import Qt
class GraphVisualizationApp(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Graph Visualization Tool")
self.setGeometry(100, 100, 800, 600)
menubar = self.menuBar()
menubar.setStyleSheet("background-color: #444444; color: white;")
# Create 'Examples' menu
examples_menu = QMenu("Examples", self)
examples_menu.setStyleSheet("background-color: #444444; color: white;")
menubar.addMenu(examples_menu)
# Add 'Built in examples' action
built_in_action = QAction("Built in examples", self)
built_in_action.setFont(QFont("Arial", 14, QFont.Weight.Bold))
built_in_action.triggered.connect(self.show_built_in_examples)
examples_menu.addAction(built_in_action)
# Add 'Create example' action
create_action = QAction("Create example", self)
create_action.setFont(QFont("Arial", 14, QFont.Weight.Bold))
create_action.triggered.connect(self.show_create_example)
examples_menu.addAction(create_action)
# Add 'Help' action
help_action = QAction("Help", self)
help_action.setFont(QFont("Arial", 10))
help_action.setShortcut('Ctrl+H')
help_action.triggered.connect(self.show_help)
menubar.addAction(help_action)
# Set central widget
central_widget = QWidget()
self.setCentralWidget(central_widget)
# Create layout for central widget
layout = QVBoxLayout()
# Create labels for 'Built in examples' and 'Create example'
built_in_label = QLabel("Built in examples")
built_in_label.setFont(QFont("Arial", 14, QFont.Weight.Bold))
built_in_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
built_in_label.setStyleSheet("color: white; background-color: #007ACC; padding: 10px; border-radius: 5px;")
create_label = QLabel("Create example")
create_label.setFont(QFont("Arial", 14, QFont.Weight.Bold))
create_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
create_label.setStyleSheet("color: white; background-color: #FF6600; padding: 10px; border-radius: 5px;")
# Add labels to layout
layout.addWidget(built_in_label)
layout.addWidget(create_label)
central_widget.setLayout(layout)
central_widget.setStyleSheet("background-color: #2D2D2D;")
def show_built_in_examples(self):
# Placeholder function for 'Built in examples' action
print("Built in examples clicked")
def show_create_example(self):
# Placeholder function for 'Create example' action
print("Create example clicked")
def show_help(self):
# Placeholder function for 'Help' action
print("Help clicked")
def main():
app = QApplication(sys.argv)
main_window = GraphVisualizationApp()
main_window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()