Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui #82

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Gui #82

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion pynars/GUI/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# from PySide6
from PySide6.QtWidgets import QMainWindow, QLabel, QPushButton, QApplication
from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QStackedLayout
from PySide6.QtWidgets import QFrame, QTextEdit, QToolBar, QPushButton, QSlider, QSplitter, QDockWidget
from PySide6.QtWidgets import QFrame, QTextEdit, QToolBar, QPushButton, QSlider, QSplitter, QDockWidget, QMenuBar, QMenu
from PySide6.QtCore import Qt, QSize
from PySide6.QtGui import QScreen, QAction, QIcon, QColor, QFont, QKeyEvent, QFontDatabase
import qtawesome as qta
Expand Down Expand Up @@ -71,6 +71,7 @@ def init_layout(self):
main_layout.addWidget(left_widget)
main_layout.addWidget(right_splitter) # 添加可调整大小的右侧区域

self.init_menubar()
self.init_output_toolbar()
self.init_output_textbox()
self.init_input_textbox()
Expand All @@ -84,6 +85,26 @@ def init_layout(self):
self.button_clear.clicked.connect(
lambda *args: self.text_output.clear())

def init_menubar(self):
''''''
menubar = self.menuBar()
menubar.setNativeMenuBar(False)
self.left_layout.setMenuBar(menubar)
# Memory
menu_memory = menubar.addMenu("Memory")
menu_memory.addAction("Reset")
menu_memory.addSeparator()
menu_memory.addAction("Load Experience")
menu_memory.addAction("Save Experience")
menu_memory.addAction("Load Memory")
menu_memory.addAction("Save Memory")

# menu_windows = menubar.addMenu("Windows")

# Help
menu_help = menubar.addMenu("Help")
menu_help.addAction("About NARS")

def init_output_toolbar(self):
''''''
# tools bar
Expand Down
Loading