pyfigures 0.1.0__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.
pyfigures/__init__.py ADDED
File without changes
pyfigures/__main__.py ADDED
@@ -0,0 +1,53 @@
1
+ from batoolset.settings.global_settings import set_UI
2
+ set_UI()
3
+ from qtpy.QtWidgets import QApplication
4
+ from batoolset.img import start_JVM
5
+ import sys
6
+ from pyfigures.gui.pfgui import EZFIG_GUI
7
+
8
+
9
+
10
+
11
+
12
+ def run_pyfigures():
13
+ """
14
+ Runs the PyFigures GUI.
15
+
16
+ This function sets the UI and initializes the QApplication.
17
+ The EPySeg PyFigures window is created and shown.
18
+ The application event loop is started and the program exits
19
+ when the GUI window is closed.
20
+
21
+ # Examples:
22
+ # >>> run_pyfigures()
23
+ """
24
+
25
+ # start JVM to enable the bioformat image reader
26
+ start_JVM()
27
+
28
+ # Initialize the QApplication
29
+ app = QApplication(sys.argv)
30
+
31
+ if False:
32
+ # just a trick to override the default cursor...
33
+ from qtpy.QtGui import QCursor, QPixmap
34
+ # Load a custom cursor image
35
+ cursor_image = QPixmap("/home/aigouy/Téléchargements/cursor-mini.png")
36
+
37
+ # Create a custom cursor object with the cursor image
38
+ custom_cursor = QCursor(cursor_image)
39
+
40
+ # Set the custom cursor globally for the application
41
+ QApplication.setOverrideCursor(custom_cursor)
42
+
43
+ # Create and show the PyFigures GUI window
44
+ w = EZFIG_GUI()
45
+ w.show()
46
+
47
+ # Start the application event loop and exit when the GUI window is closed
48
+ sys.exit(app.exec_())
49
+
50
+
51
+ if __name__ == '__main__':
52
+ # Run the PyFigures GUI
53
+ run_pyfigures()
File without changes
@@ -0,0 +1,68 @@
1
+ from batoolset.settings.global_settings import set_UI # set the UI to qtpy
2
+ set_UI()
3
+ from qtpy.QtWidgets import QApplication, QDialog, QVBoxLayout, QLabel, QPushButton
4
+ from qtpy.QtCore import Qt
5
+ import sys
6
+
7
+ class AboutDialog(QDialog):
8
+ def __init__(self, parent=None, title="About My Software", name="My Software", version="Version 1.0.0", description="""
9
+ This is a brief description of My Software.
10
+ You can provide more information about its features and functionality here.
11
+ """, copyright="© 2023 Your Name", email='benoit.aigouy@gmail.com', ok_or_close="Ok"):
12
+ super().__init__(parent)
13
+
14
+ # Set dialog properties
15
+ self.setWindowTitle(title)
16
+ self.setMinimumWidth(400)
17
+
18
+ # Create layout
19
+ layout = QVBoxLayout(self)
20
+ layout.setAlignment(Qt.AlignCenter)
21
+
22
+ # Add application icon (optional)
23
+ # icon_label = QLabel(self)
24
+ # icon_label.setPixmap(QPixmap("path/to/your/icon.png")))
25
+ # layout.addWidget(icon_label)
26
+
27
+ # Add application name and version
28
+ name_label = QLabel(name, self)
29
+ name_label.setStyleSheet("font-size: 24px; font-weight: bold;")
30
+ layout.addWidget(name_label)
31
+
32
+ version_label = QLabel(version, self)
33
+ layout.addWidget(version_label)
34
+
35
+ # Add description
36
+ description_label = QLabel(description, self)
37
+ description_label.setWordWrap(True)
38
+ layout.addWidget(description_label)
39
+
40
+ # Add email label
41
+ email_label = QLabel(email, self)
42
+ email_label.setStyleSheet("font-weight: bold; color: blue;")
43
+ email_label.setOpenExternalLinks(True)
44
+ email_link = f'<a href="mailto:{email}">{email}</a>'
45
+ email_label.setText(email_link)
46
+ layout.addWidget(email_label)
47
+
48
+
49
+ # Add copyright and attribution
50
+ copyright_label = QLabel(copyright, self)
51
+ layout.addWidget(copyright_label)
52
+
53
+ # Add close button
54
+ close_button = QPushButton(ok_or_close, self)
55
+ close_button.clicked.connect(self.close)
56
+ layout.addWidget(close_button)
57
+
58
+ self.adjustSize()
59
+
60
+ def main():
61
+ app = QApplication([])
62
+
63
+ # Show the About dialog
64
+ about_dialog = AboutDialog()
65
+ about_dialog.exec_()
66
+
67
+ if __name__ == '__main__':
68
+ main()