mirror of
https://github.com/Taiko2k/GTK4PythonTutorial.git
synced 2025-07-21 04:31:09 +02:00
Add Adw.AboutWindow example
This commit is contained in:
16
README.md
16
README.md
@@ -440,6 +440,22 @@ from gi.repository import Gtk, Adw, Gio, GLib # Add GLib to imports
|
||||
|
||||
```
|
||||
|
||||
### add about window (better About Dialog)
|
||||
```python
|
||||
dialog = Adw.AboutWindow(transient_for=app.get_active_window())
|
||||
dialog.set_application_name=("App name")
|
||||
dialog.set_version("1.0")
|
||||
dialog.set_developer_name("Developer")
|
||||
dialog.set_license_type(Gtk.License(Gtk.License.GPL_3_0))
|
||||
dialog.set_comments("Adw about Window example")
|
||||
dialog.set_website("https://github.com/Tailko2k/GTK4PythonTutorial")
|
||||
dialog.set_issue_url("https://github.com/Tailko2k/GTK4PythonTutorial/issues")
|
||||
dialog.add_credit_section("Contributors", ["Name1 url"])
|
||||
dialog.set_translator_credi("Name1 url")
|
||||
dialog.set_copyright("© 2022 developer")
|
||||
dialog.set_developers(["Developer"])
|
||||
dialog.set_application_icon("com.github.devname.appname") # icon must be uploaded in ~/.local/share/icons or /usr/share/icons
|
||||
```
|
||||
For further reading on what you can add, see [***AboutDialog***](https://docs.gtk.org/gtk4/class.AboutDialog.html).
|
||||
|
||||

|
||||
|
Reference in New Issue
Block a user