1 unstable release
Uses new Rust 2024
new 0.1.1 | Apr 2, 2025 |
---|
#9 in #table-column
44 downloads per month
Used in 90 crates
(3 directly)
2.5MB
17K
SLoC
Aloe Table Crate
aloe-table
is a Rust crate that facilitates the creation of dynamic and customizable tables within a graphical user interface (GUI). It provides a robust structure for handling table interactions such as column resizing, moving, sorting, and cell manipulation. This crate is particularly useful for applications requiring a dynamic display of tabulated data, with support for user interactions and custom rendering.
Features
- Table Interaction: Respond to column resizing, movement, and sorting through a comprehensive set of traits.
- Custom Rendering: Implement your own cell and row rendering logic using the
TableListBoxModel
trait. - Event Management: Register and manage event listeners for table header changes.
- Accessibility: Includes support for accessibility features, ensuring your tables are usable for all users.
Technical Overview
Key Concepts
- TableHeaderComponent: Manages column headers, allowing them to be resized and reordered by users.
- TableListBox: Acts as the main container for rows and columns, relying on a data model defined by
TableListBoxModel
. - Event Listeners: Implement various traits like
TableHeaderComponentListener
to handle events triggered by user interactions with the table. - Rendering and Updating: Override methods to customize the painting of cells and headers, and handle the updating of components for dynamic data.
Usage Example
To get started with aloe-table
, implement the TableListBoxModel
trait, providing logic for how your data should be rendered in the table cells. Register a TableHeaderComponentListener
to respond to user interactions such as column sorting or resizing. Below is a simplified example of setting up a table:
use aloe_table::{TableListBox, TableListBoxModel, TableHeaderComponent};
struct MyTableModel;
impl TableListBoxModel for MyTableModel {
// Implement required methods for handling table data
}
fn main() {
let table_list_box = TableListBox::new(Some("My Table"), &mut MyTableModel);
let header = TableHeaderComponent::default();
table_list_box.set_header(Box::new(header));
// Additional setup...
}
Installation
To use aloe-table
in your project, add the following to your Cargo.toml
:
[dependencies]
aloe-table = "0.1.0"
Contributing
Contributions are welcome! Please adhere to the repository's contribution guidelines available on the project's GitHub page: Aloe RS Repository.
License
This project is licensed under the GPL-3.0 license.
This README.md file was generated by an AI model and may not be 100% accurate; however, it should be pretty good.
This crate is a translation of the JUCE module.
JUCE is a c++ software framework for developing high performance audio applications.
Usage falls under the GPLv3 as well as the JUCE commercial license.
See github.com/juce-framework/JUCE and the JUCE license page for details.
This crate is in the process of being translated from c++ to rust. For progress updates, please see the workspacer rust project. designed specifically for rust projects.
Dependencies
~25–39MB
~596K SLoC