mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-09-28 22:41:56 +00:00
a2503ce86b
- Cleanup up app.rs and use the new module ui - Remove display_plugin_list - Can now render a graph and get the parse launch line.
35 lines
1.4 KiB
Rust
35 lines
1.4 KiB
Rust
// treeview.rs
|
|
//
|
|
// Copyright 2022 Stéphane Cerveau <scerveau@collabora.com>
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
use crate::app::GPSApp;
|
|
use gtk::prelude::TreeViewExt;
|
|
use gtk::{CellRendererText, TreeView, TreeViewColumn};
|
|
|
|
pub fn add_column_to_treeview(app: &GPSApp, tree_name: &str, column_name: &str, column_n: i32) {
|
|
let treeview: TreeView = app
|
|
.builder
|
|
.object(tree_name)
|
|
.expect("Couldn't get tree_name");
|
|
let column = TreeViewColumn::new();
|
|
let cell = CellRendererText::new();
|
|
column.pack_start(&cell, true);
|
|
// Association of the view's column with the model's `id` column.
|
|
column.add_attribute(&cell, "text", column_n);
|
|
column.set_title(column_name);
|
|
treeview.append_column(&column);
|
|
}
|