-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7c301c
commit 6bfa314
Showing
19 changed files
with
682 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Ptk Documentation: AboutWindow Widget | ||
|
||
|
||
## AboutWindow Widget | ||
|
||
> The `AboutWindow` widget is a graphical window that displays information about an application or software, typically used in an "About" dialog. It provides an organized layout for presenting essential details such as the application name, version, developer information, license, credits, website, etc. | ||
### Parameters and Usage | ||
|
||
The `AboutWindow` widget accepts the following parameters with their types: | ||
|
||
- `application_name` (str): The name of the application or software. | ||
- `version` (str): The version number of the application. | ||
- `developer_name` (str): The name of the developer or organization. | ||
- `license_type` (str): The type of license used for the application. Possible values are: "unknown", "custom", "GPL-2", "GPL-3", "LGPL-2-1", "LGPL-3-0", "BSD", "MIX-X11", "ARTISTIC", "GPL-2-0-ONLY", "GPL-3-0-ONLY", "LGPL-2-1-ONLY", "LGPL-3-0-ONLY", "AGPL-3-0", "AGPL-3-0-ONLY", "BSD-3", "APACHE-2-0", "MPL-2-0". | ||
- `comments` (str): Additional comments or description about the application. | ||
- `website` (str): The website URL associated with the application. | ||
- `issue_url` (str): The issue or bug tracking URL for the application. | ||
- `credit_section` (tuple of str, str): A tuple containing two strings - the title and content of the credit section. | ||
- `translator_credits` (str): Credits for translators of the application. | ||
- `copyright` (str): Copyright information for the application. | ||
- `developers` (str): Information about the developers of the application. | ||
- `application_icon` (GdkPixbuf.Pixbuf): The icon representing the application. | ||
- `transient_for` (Gtk.Window): The parent window that this `AboutWindow` is transient for. | ||
- `modal` (bool): If True, the `AboutWindow` becomes a modal dialog. | ||
|
||
### Usage Example | ||
|
||
To create and display an `AboutWindow`, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create an AboutWindow instance | ||
about_window = Ptk.AboutWindow( | ||
application_name="My Awesome App", | ||
version="1.0", | ||
developer_name="John Doe", | ||
license_type="GPL-3", | ||
comments="An amazing application!", | ||
website="https://www.example.com", | ||
issue_url="https://github.com/example/myapp/issues", | ||
credit_section=("Contributors", "John Doe, Jane Smith"), | ||
translator_credits="French: Pierre Dupont, German: Hans Müller", | ||
copyright="(c) 2023 John Doe", | ||
developers="John Doe, Jane Smith", | ||
application_icon=application_icon, | ||
transient_for=parent_window, | ||
modal=True, | ||
) | ||
|
||
# Display the AboutWindow | ||
about_window.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Ptk Documentation: App Widget | ||
|
||
## App Widget | ||
|
||
> The `App` widget is responsible for creating an application instance and managing its main window. It is based on the `Adw.Application` class and provides additional functionality to set properties such as the application ID, title, window dimensions, and CSS file path. | ||
### Parameters | ||
|
||
The `App` widget accepts the following parameters with their types: | ||
|
||
- `application_id` (str): The unique identifier for the application. | ||
- `title` (str): The title or name of the application. | ||
- `height` (int): The height of the main application window. Default is -1. | ||
- `width` (int): The width of the main application window. Default is -1. | ||
- `css_file_path` (str): The path to a CSS file for styling the application (optional). | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `App` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create an App instance | ||
app = Ptk.App( | ||
application_id="com.example.myapp", | ||
title="My Awesome App", | ||
height=600, | ||
width=800, | ||
css_file_path="path/to/css/file.css", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Ptk Documentation: ApplicationWindow Widget | ||
|
||
|
||
## ApplicationWindow Widget | ||
|
||
> The `ApplicationWindow` widget is a subclass of `Gtk.ApplicationWindow` and provides additional functionality for managing an application window. It allows you to set properties such as the window title, title bar, icon, and window dimensions. | ||
### Parameters | ||
|
||
The `ApplicationWindow` widget accepts the following parameters with their types: | ||
|
||
- `title` (str): The title or name of the application window. | ||
- `titlebar` (Gtk.Widget): The custom title bar widget (optional). | ||
- `icon_name` (str): The name of the icon to be displayed in the window title bar (optional). | ||
- `height` (int): The height of the application window. Default is -1. | ||
- `width` (int): The width of the application window. Default is -1. | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `ApplicationWindow` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create an ApplicationWindow instance | ||
window = Ptk.ApplicationWindow( | ||
title="My Application", | ||
titlebar=my_custom_title_bar_widget, | ||
icon_name="app-icon", | ||
height=600, | ||
width=800, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Ptk Documentation: Box Widget | ||
|
||
## Box Widget | ||
|
||
> The `Box` widget is a container that arranges its child widgets in either a horizontal or vertical layout. It is based on `Gtk.Box` and provides additional functionality for setting properties such as orientation, spacing, homogeneity, and a custom name. | ||
### Parameters | ||
|
||
The `Box` widget accepts the following parameters with their types: | ||
|
||
- `orientation` (str): The orientation of the box. Possible values are "horizontal" and "vertical". | ||
- `homogeneous` (bool): If True, the child widgets will be given equal space within the box. | ||
- `spacing` (int): The space in pixels to insert between the child widgets. Default is -1. | ||
- `name` (str): A custom name for the box (optional). | ||
- `children` (list of Gtk.Widget): A list of child widgets to be added to the box. | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `Box` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create a Box instance with horizontal orientation and homogeneous spacing | ||
box = Ptk.Box(orientation="horizontal", homogeneous=True, spacing=10) | ||
|
||
# Add child widgets to the box | ||
label1 = Gtk.Label(label="Label 1") | ||
label2 = Gtk.Label(label="Label 2") | ||
box.append(label1) | ||
box.append(label2) | ||
|
||
# Or you can create child widgets and append it while creating box. | ||
label1 = Gtk.Label(label="Label 1") | ||
label2 = Gtk.Label(label="Label 2") | ||
box = Ptk.Box(orientation="horizontal", homogeneous=True, spacing=10,children=[label1,label2]) | ||
|
||
|
||
|
||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Ptk Documentation: Button Widget | ||
|
||
|
||
## Button Widget | ||
|
||
The `Button` widget is a subclass of `Gtk.Button` and provides additional functionality for setting properties such as the label, icon, and frame. | ||
|
||
### Parameters | ||
|
||
The `Button` widget accepts the following parameters with their types: | ||
|
||
- `label` (str): The label text to be displayed on the button. | ||
- `icon` (str): The name of the icon to be displayed on the button (optional). | ||
- `frame` (bool): If True, the button will have a frame around it. Default is True. | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `Button` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create a Button instance with a label and an optional icon | ||
button = Ptk.Button(label="Click Me", icon="my-icon",frame=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Ptk Documentation: FlowBox Widget | ||
|
||
|
||
## FlowBox Widget | ||
|
||
> The `FlowBox` widget is a container that arranges its child widgets in a flexible grid layout, where each child occupies a variable-sized box. It is based on `Gtk.FlowBox` and provides additional functionality for setting properties such as row spacing, column spacing, maximum children per line, minimum children per line, and selection mode. | ||
### Parameters | ||
|
||
The `FlowBox` widget accepts the following parameters with their types: | ||
|
||
- `row_spacing` (int): The space in pixels between rows of the flow box. Default is 0. | ||
- `column_spacing` (int): The space in pixels between columns of the flow box. Default is 0. | ||
- `max_children_per_line` (int): The maximum number of children to be displayed per line. Default is 4. | ||
- `min_children_per_line` (int): The minimum number of children to be displayed per line. Default is 0. | ||
- `selection_mode` (str): The selection mode for the flow box. Possible values are "none", "single", "browse", and "multiple". | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `FlowBox` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create a FlowBox instance with specified properties | ||
flow_box = Ptk.FlowBox( | ||
row_spacing=5, | ||
column_spacing=10, | ||
max_children_per_line=3, | ||
min_children_per_line=1, | ||
selection_mode="multiple", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Ptk Documentation: Gtk and Adw Settings | ||
|
||
|
||
## Gtk and Adw Settings | ||
|
||
> The `settings` dictionary contains mappings for commonly used Gtk and Adw settings. It allows you to conveniently refer to these settings using human-readable names in your code. | ||
### Available Settings | ||
|
||
- `horizontal`: The `Gtk.Orientation` for horizontal orientation, mapped to `Gtk.Orientation(0)`. | ||
- `vertical`: The `Gtk.Orientation` for vertical orientation, mapped to `Gtk.Orientation(1)`. | ||
- `fill`: The `Gtk.Align` for filling available space, mapped to `Gtk.Align(0)`. | ||
- `start`: The `Gtk.Align` for starting alignment, mapped to `Gtk.Align(1)`. | ||
- `end`: The `Gtk.Align` for ending alignment, mapped to `Gtk.Align(2)`. | ||
- `center`: The `Gtk.Align` for center alignment, mapped to `Gtk.Align(3)`. | ||
- `baseline`: The `Gtk.Align` for baseline alignment, mapped to `Gtk.Align(4)`. | ||
|
||
### Basic Usage | ||
|
||
You can use the `settings` dictionary in your Ptk code to set various Gtk and Adw properties more conveniently. For example: | ||
|
||
```python | ||
from libpardus import settings | ||
|
||
# Use the horizontal orientation setting | ||
orientation_horizontal = settings["horizontal"] | ||
|
||
# Use the fill alignment setting | ||
alignment_fill = settings["fill"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Ptk Documentation: Image Widget | ||
|
||
|
||
## Image Widget | ||
|
||
> The `Image` widget is a subclass of `Gtk.Image` and provides additional functionality for setting properties such as the image file, icon, icon size, and pixel size. | ||
### Parameters | ||
|
||
The `Image` widget accepts the following parameters with their types: | ||
|
||
- `file` (str): The path to an image file to be displayed (optional). | ||
- `icon` (str): The name of the icon to be displayed (optional). | ||
- `icon_size` (int): The size of the icon (optional). | ||
- `pixel_size` (int): The size of the image in pixels (optional). | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `Image` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create an Image instance with a specified image file and icon | ||
image = Ptk.Image(file="path/to/image.png", icon="my-icon", icon_size=32, pixel_size=200) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Introducing LibPardus: Your Python Gateway to the Pardus Universe | ||
|
||
<img src="https://raw.githubusercontent.com/pardus/pardus.github.io/097d38fa01966c7a95164be9bd3e42dacfc0080f/src/lib/assets/logo.svg" alt="pardus" width="200"/> | ||
|
||
> _"Explore the vast realms of Pardus with ease and efficiency using LibPardus, Python library designed as a comprehensive wrapper around gi."_ | ||
## What is LibPardus? | ||
|
||
LibPardus is an innovative Python library meticulously crafted to be your ultimate gateway into the Pardus universe. It serves as a feature-rich wrapper around the renowned **gi (GObject Introspection)** library, unlocking seamless integration with the extensive array of GObject-based libraries and frameworks that Pardus offers. | ||
|
||
## Why LibPardus? | ||
|
||
Building upon the solid foundation of gi, LibPardus empowers developers and enthusiasts to harness the true potential of the Pardus ecosystem without grappling with the complexities of low-level C code. This library has been engineered to streamline your workflow, saving precious development time and boosting productivity, so you can focus on creating exceptional applications and experiences on the Pardus platform. | ||
|
||
## Key Features | ||
|
||
1. **Simplified Interface**: LibPardus offers an intuitive and pythonic interface, abstracting away the intricacies of GObject Introspection, making it effortless to work with Pardus libraries. | ||
|
||
2. **Extensive Pardus Integration**: With LibPardus, you gain direct access to a plethora of Pardus libraries, unlocking a treasure trove of functionalities for your projects. | ||
|
||
3. **Enhanced Productivity**: By eliminating boilerplate code and providing a clear and concise API, LibPardus enables you to build robust applications more efficiently. | ||
|
||
4. **Comprehensive Documentation**: LibPardus comes with comprehensive and user-friendly documentation, making it easier for both newcomers and experienced developers to explore its capabilities. | ||
|
||
## Getting Started | ||
|
||
To dive into the world of LibPardus, all you need is basic knowledge of Python and a desire to create extraordinary applications on the Pardus platform. Whether you want to build a GUI application with **GTK+**, harness the power of **GStreamer** for multimedia processing, or utilize other GObject-based libraries, LibPardus has you covered. | ||
|
||
## Contribute | ||
|
||
LibPardus is an open-source project, and we welcome contributions from the community. Whether you want to report a bug, suggest an improvement, or submit a pull request, your involvement is highly appreciated. Join us on [GitHub](https://github.com/libpardus) and let's build a thriving ecosystem together! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Ptk Documentation: Label Widget | ||
|
||
|
||
## Label Widget | ||
|
||
> The `Label` widget is a subclass of `Gtk.Label` and provides additional functionality for setting properties such as the text label, text markup, ellipsize mode, text alignment, and line count. | ||
### Parameters | ||
|
||
The `Label` widget accepts the following parameters with their types: | ||
|
||
- `label` (str): The plain text label to be displayed. | ||
- `markup` (str): The Pango markup text to be displayed (optional). | ||
- `ellipsize` (str): The ellipsize mode for the label. Possible values are "none", "start", "middle", and "end". | ||
- `xalign` (float): The horizontal alignment of the label within its available space. Value ranges from 0.0 (left-aligned) to 1.0 (right-aligned). Default is 0.0 (left-aligned). | ||
- `yalign` (float): The vertical alignment of the label within its available space. Value ranges from 0.0 (top-aligned) to 1.0 (bottom-aligned). Default is 0.0 (top-aligned). | ||
- `lines` (int): The number of lines to wrap the text. Default is 1 (single line). | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `Label` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create a Label instance with a plain text label | ||
label = Ptk.Label(label="Hello, Ptk!") | ||
|
||
# Set markup | ||
markup = "<span> <b> Hello Ptk </b> </span>" | ||
label = Ptk.Label(markup=markup) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Ptk Documentation: ListBox Widget | ||
|
||
## ListBox Widget | ||
|
||
> The `ListBox` widget is a container that arranges its child widgets in a vertical list. It is based on `Gtk.ListBox` and provides additional functionality for setting properties such as showing separators between items. | ||
### Parameters | ||
|
||
The `ListBox` widget accepts the following parameters with their types: | ||
|
||
- `show_separators` (bool): If True, separators will be displayed between list items. Default is False. | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `ListBox` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create a ListBox instance with separators between list items | ||
listbox = Ptk.ListBox(show_separators=True) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Ptk Documentation: ListBoxRow Widget | ||
|
||
## ListBoxRow Widget | ||
|
||
> The `ListBoxRow` widget is a subclass of `Gtk.ListBoxRow` and provides additional functionality for setting the child widget within a list row. | ||
### Parameters | ||
|
||
The `ListBoxRow` widget accepts the following parameters with their types: | ||
|
||
- `child` (Gtk.Widget): The child widget to be displayed within the row. | ||
|
||
### Basic Usage | ||
|
||
To create an instance of the `ListBoxRow` widget and set its properties, you can use the following code snippet: | ||
|
||
```python | ||
from libpardus import Ptk | ||
|
||
# Create a ListBoxRow instance with a child widget | ||
child_widget = Ptk.Label(label="Ptk ListBoxRow Child") # Replace this with the child widget you want to add | ||
listbox_row = Ptk.ListBoxRow(child=child_widget) | ||
``` |
Oops, something went wrong.