From 93bd7e3aa2d2b615018c6d118ef3bf13aa0b0ab1 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Fri, 15 Oct 2021 21:37:43 -0400 Subject: Update dependencies --- src/gui/boardwidget.rs | 28 ++++++++++++++-------------- src/gui/mod.rs | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 35 deletions(-) (limited to 'src/gui') diff --git a/src/gui/boardwidget.rs b/src/gui/boardwidget.rs index 2708f21..bbddfb4 100644 --- a/src/gui/boardwidget.rs +++ b/src/gui/boardwidget.rs @@ -1,21 +1,21 @@ /* - This file is part of Takwrap. +This file is part of Takwrap. - Takwrap 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. +Takwrap 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. - Takwrap 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. +Takwrap 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 Takwrap. If not, see . -*/ +You should have received a copy of the GNU General Public License +along with Takwrap. If not, see . + */ -use fltk::{app::*, button::*, draw::*}; +use fltk::{button::*, draw::*, enums::Color, prelude::*}; use std::rc::*; use crate::game::*; @@ -233,7 +233,7 @@ impl BoardWidget { pub fn new(button: Button, size: i32) -> BoardWidget { let renderer = Rc::new(BoardRenderer::default().with_size(size).with_org(&button)); let mut g = BoardWidget { button, renderer }; - g.button.draw2(g.generate_draw(&Vec::new())); + g.button.draw(g.generate_draw(&Vec::new())); return g; } diff --git a/src/gui/mod.rs b/src/gui/mod.rs index 1980fdb..3c94abc 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -1,24 +1,28 @@ /* - This file is part of Takwrap. +This file is part of Takwrap. - Takwrap 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. +Takwrap 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. - Takwrap 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. +Takwrap 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 Takwrap. If not, see . -*/ +You should have received a copy of the GNU General Public License +along with Takwrap. If not, see . + */ mod boardwidget; use crate::gui::boardwidget::*; -use fltk::{app::*, button::*, menu::*, text::*, window::*}; +use fltk::{ + app::*, button::*, enums::Color, enums::FrameType, enums::Shortcut, menu::*, text::*, window::*, +}; + +use fltk::prelude::*; #[derive(Clone, Copy)] enum GUIMessage { @@ -42,13 +46,12 @@ impl GUI { // TODO: Why is this not the same as /* - let mut window = Window::default() - .with_size(800, 600) - .with_label("Takwrap") - .center_screen(); - */ + let mut window = Window::default() + .with_size(800, 600) + .with_label("Takwrap") + .center_screen(); + */ // Windows made that way are not resizable? - let mut window = DoubleWindow::new(0, 0, 800, 600, "Takwrap").center_screen(); let (sender, receiver) = channel::(); @@ -59,14 +62,14 @@ impl GUI { menu.set_color(Color::Light2); menu.add_emit( "&File/New...\t", - Shortcut::None, + Shortcut::empty(), MenuFlag::Normal, sender, GUIMessage::None, ); menu.add_emit( "&File/Open...\t", - Shortcut::None, + Shortcut::empty(), MenuFlag::Normal, sender, GUIMessage::Test, -- cgit v1.3.1