pits and exits
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
|
||||
use super::*;
|
||||
|
||||
/// A wrapper around gtk::ListBox for Pawns
|
||||
#[derive(Debug,Clone)]
|
||||
pub struct PawnList {
|
||||
inner: gtk::ListBox,
|
||||
}
|
||||
|
||||
impl PawnList {
|
||||
/// Initialize from the given existing ListBox
|
||||
pub fn init(inner: gtk::ListBox) -> Self {
|
||||
PawnList{ inner }
|
||||
}
|
||||
|
||||
/// Adds a Pawn to the list
|
||||
pub fn add(&self, pawn: &Pawn) {
|
||||
let row = gtk::ListBoxRow::new();
|
||||
row.add(pawn.as_ref());
|
||||
@@ -18,12 +21,14 @@ impl PawnList {
|
||||
}
|
||||
}
|
||||
|
||||
/// Application data related to a Pawn
|
||||
#[derive(Debug,Clone)]
|
||||
pub struct PawnData {
|
||||
pub name: String,
|
||||
pub position: Option<String>, // Content of label from CellWidget
|
||||
}
|
||||
|
||||
/// A wrapper widget for pawns.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Pawn {
|
||||
data: PawnData,
|
||||
|
||||
Reference in New Issue
Block a user