{"id":28368048,"url":"https://github.com/algoscienceacademy/shawon","last_synced_at":"2026-05-03T05:33:40.520Z","repository":{"id":293819206,"uuid":"985231592","full_name":"algoscienceacademy/shawon","owner":"algoscienceacademy","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-18T05:44:22.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T18:09:09.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/algoscienceacademy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-17T10:34:47.000Z","updated_at":"2025-05-18T05:44:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"3de50db5-93e9-49c6-8be5-0040b51db816","html_url":"https://github.com/algoscienceacademy/shawon","commit_stats":null,"previous_names":["algoscienceacademy/shawon"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/algoscienceacademy/shawon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algoscienceacademy%2Fshawon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algoscienceacademy%2Fshawon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algoscienceacademy%2Fshawon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algoscienceacademy%2Fshawon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/algoscienceacademy","download_url":"https://codeload.github.com/algoscienceacademy/shawon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algoscienceacademy%2Fshawon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32559716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T03:21:47.309Z","status":"ssl_error","status_checked_at":"2026-05-03T03:21:43.884Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-29T03:08:19.800Z","updated_at":"2026-05-03T05:33:40.514Z","avatar_url":"https://github.com/algoscienceacademy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShawonUI\n\nShawonUI is a lightweight Rust wrapper for Qt, providing a simple and ergonomic way to create cross-platform GUI applications in Rust without external dependencies.\n\n## Features\n\n- **Pure Rust API**: Create Qt GUIs using only Rust code\n- **No Qt Dependencies**: The library handles all Qt integration transparently\n- **Cross-Platform**: Works on Windows, macOS, and Linux\n- **Comprehensive Widget Set**: Includes buttons, labels, text fields, checkboxes, radio buttons, and more\n- **Layout Management**: Arrange widgets using layouts\n- **Container Widgets**: List, Tree, and Table widgets for displaying data\n- **CSS Styling**: Customize the appearance of your application using Qt's CSS-like styling system\n- **Dialog Support**: File dialogs, message boxes, and more\n- **Event Handling**: Connect callbacks to widget events\n\n## Requirements\n\n- Rust 2021 edition or newer\n- Qt 5.x installed on your system\n- A C++ compiler compatible with your platform\n\n## Installation\n\nAdd ShawonUI to your `Cargo.toml`:\n\n```toml\n[dependencies]\nshawon = \"0.1.5\n```\n\n## Quick Start\n\n```rust\nuse shawon::{Application, Button, Label, Window};\nuse std::rc::Rc;\n\nfn main() {\n    // Initialize the application\n    let app = Application::new();\n    \n    // Create a window\n    let window = Rc::new(Window::new(\"Hello ShawonUI\", 400, 200));\n    \n    // Create a label\n    let label = Label::new(\"Hello, world!\");\n    window.add_label(\u0026label);\n    \n    // Create a button\n    let mut button = Button::new(\"Click Me\");\n    \n    // Clone window for the closure\n    let window_clone = Rc::clone(\u0026window);\n    \n    // Set button click callback\n    button.set_callback(move || {\n        window_clone.show_message_box(\n            shawonui::MessageBoxIcon::Information,\n            \"Hello\",\n            \"Hello from ShawonUI!\"\n        );\n    });\n    \n    window.add_button(\u0026button);\n    \n    // Show the window\n    window.show();\n    \n    // Run the application\n    app.exec();\n}\n```\n\n## Widget Types\n\nShawonUI provides the following widget types:\n\n- `Window` - Main application window or container\n- `Button` - Standard push button\n- `Label` - Display text or images\n- `TextEntry` - Single-line text input\n- `CheckBox` - Checkbox with text label\n- `RadioButton` - Radio button with text label\n- `GroupBox` - Container with border and title\n- `TabWidget` - Container with tabbed interface\n- `ListWidget` - List of items\n- `TreeWidget` - Hierarchical tree view\n- `TableWidget` - Grid of cells\n- `Slider` - Sliding value selector\n- `ComboBox` - Dropdown list\n- `ProgressBar` - Progress indicator\n- `Splitter` - Resizable split view\n\n## Layout Management\n\nShawonUI supports horizontal layouts to arrange widgets:\n\n```rust\n// Create a layout\nlet layout = HBoxLayout::new();\n\n// Add widgets to the layout\nlayout.add_label(\u0026label);\nlayout.add_button(\u0026button);\n\n// Add the layout to a window or group box\nwindow.add_layout(\u0026layout);\n```\n\n## Styling\n\nShawonUI supports Qt's CSS-like styling system:\n\n```rust\n// Apply a stylesheet to a widget\nbutton.set_stylesheet(\"\n    background-color: #0078d7;\n    color: white;\n    border: none;\n    border-radius: 4px;\n    padding: 5px 15px;\n\");\n\n// Apply a stylesheet to the entire application\napp.set_stylesheet(\"\n    QWidget {\n        font-family: 'Segoe UI', Arial, sans-serif;\n        font-size: 10pt;\n    }\n    \n    QPushButton {\n        background-color: #0078d7;\n        color: white;\n    }\n\");\n```\n\n## Container Widgets\n\n### ListWidget\n\n```rust\nlet list_widget = ListWidget::new();\nlist_widget.add_item(\"Item 1\");\nlist_widget.add_item(\"Item 2\");\n\nlist_widget.set_item_clicked_callback(|row| {\n    println!(\"Clicked on row {}\", row);\n});\n```\n\n### TreeWidget\n\n```rust\nlet mut tree_widget = TreeWidget::new();\ntree_widget.set_headers(\u0026[\"Name\", \"Description\"]);\n\nlet parent = tree_widget.add_top_item(\"Parent\");\nlet child = tree_widget.add_child_item(parent, \"Child\").unwrap();\n\ntree_widget.set_item_text(parent, Some(child), 1, \"Description\");\n```\n\n### TableWidget\n\n```rust\nlet table_widget = TableWidget::new(3, 3);\ntable_widget.set_horizontal_headers(\u0026[\"Column 1\", \"Column 2\", \"Column 3\"]);\n\ntable_widget.set_cell_text(0, 0, \"Cell 1,1\");\ntable_widget.set_cell_text(0, 1, \"Cell 1,2\");\n```\n\n## Components\n\n### QAbstractButton\n\n`QAbstractButton` provides the basic functionality for button widgets. It can be used for clickable buttons:\n\n```rust\nuse shawon::{Application, QAbstractButton, QWidget};\n\nfn main() {\n    let app = Application::new();\n    let window = QWidget::new();\n    \n    let button = QAbstractButton::new();\n    button.set_text(\"Click Me\");\n    button.set_parent(\u0026window);\n    \n    button.on_clicked(|| {\n        println!(\"Button was clicked!\");\n    });\n    \n    window.show();\n    app.exec();\n}\n```\n\n#### Features:\n- Text labels\n- Click events\n- Checkable states\n- Toggle functionality\n\n## Dialogs\n\n```rust\n// File open dialog\nif let Some(path) = window.show_open_file_dialog(\"Open File\", \"\", \"All Files (*.*)\") {\n    println!(\"Selected file: {}\", path);\n}\n\n// Message box\nwindow.show_message_box(\n    MessageBoxIcon::Information,\n    \"Information\",\n    \"This is an information message.\"\n);\n```\n\n## How It Works\n\nShawonUI uses a C++ layer to interface with Qt, and exposes a pure Rust API. The C++ code is compiled during the build process, and linked with your Rust application. This approach allows for a clean Rust API while leveraging the power and flexibility of Qt.\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Feel free to open issues or submit pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgoscienceacademy%2Fshawon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falgoscienceacademy%2Fshawon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgoscienceacademy%2Fshawon/lists"}