Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded Pomodoro sample #161
Conversation
zzeroo
and others
added some commits
Apr 10, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks for PR. Please follow https://github.com/gtk-rs/examples/blob/master/CONTRIBUTING.md. You can "Edit" this PR in Github page to change target branch (better do this after you do rebase locally and push new version). If your sample need minimal version instead Also |
This comment has been minimized.
This comment has been minimized.
|
At last: renaming |
| const TOMA_MINUTES: i64 = 3; | ||
| const BREAK_MINUTES: i64 = 5; | ||
|
|
||
| const TOMA_MSG: &'static str = r###" |
This comment has been minimized.
This comment has been minimized.
| new_label.set_margin_top(0); | ||
| new_label.set_margin_bottom(0); | ||
| new_label.set_justify(gtk::Justification::Center); | ||
| return new_label |
This comment has been minimized.
This comment has been minimized.
|
|
||
| fn connect_click_start(tomaty: Rc<RefCell<Tomaty>>) { | ||
| let outer_tomato_heaven = tomaty.clone(); | ||
| let ref button = outer_tomato_heaven.borrow().tomaty_button; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Clippy reports many other warnings |
bitemyapp
added some commits
Apr 1, 2018
This comment has been minimized.
This comment has been minimized.
bitemyapp
commented
Apr 2, 2018
|
@EPashkin I think I've made progress on cleaning this up. Some of the other examples have
|
This comment has been minimized.
This comment has been minimized.
|
Thanks. Under Windows 10 closing window will cause panic And, please, remove |
This comment has been minimized.
This comment has been minimized.
|
And main problem that PR still against |
| window.set_default_size(350, 70); | ||
|
|
||
| window.connect_delete_event(|_, _| { | ||
| gtk::main_quit(); |
This comment has been minimized.
This comment has been minimized.
| if gtk::init().is_err() { | ||
| println!("Failed to initialize GTK."); | ||
| return; | ||
| } |
This comment has been minimized.
This comment has been minimized.
bitemyapp
changed the base branch from
master
to
pending
Apr 12, 2018
This comment has been minimized.
This comment has been minimized.
bitemyapp
commented
Apr 12, 2018
•
@EPashkin I lost time figuring out the correct syntax and features to build the apps and make it work. I will probably not be the last person to do so. Is there some other means of preventing other people wasting time on the same problem that would be acceptable to you? I've solved the panic, removed the Makefile, and changed the PR target to pending. |
This comment has been minimized.
This comment has been minimized.
|
Sorry, I don't understand what you means about "other means": we clearly stated in Can you make new branch from @GuillaumeGomez it almost time for you to look to this PR too. |
| fn build_ui(application: >k::Application) { | ||
| // let window = gtk::Window::new(gtk::WindowType::Toplevel); | ||
| let window = gtk::ApplicationWindow::new(application); | ||
| window.set_application(application); |
This comment has been minimized.
This comment has been minimized.
| window.set_default_size(350, 70); | ||
|
|
||
| window.connect_delete_event(clone!(window => move|_, _| { | ||
| window.destroy(); |
This comment has been minimized.
This comment has been minimized.
EPashkin
Apr 12, 2018
Member
Minor problem with clone macro: now it produce warning if build without features.
Please or move macro_rules! inside mod pomodoro
or remove it and change this to
let window_clone = window.clone();
window.connect_delete_event(move |_, _| {
window_clone.destroy();
as it single macro usage

bitemyapp commentedApr 1, 2018
•
edited
I had a little bit of trouble figuring out some of the details of sharing and updating application state, so I think this could be a worthy augmentation of the
clock.rsexample.I also added a Makefile because I got a bit confused by it defaulting to an old gtk feature flag and the
build.shseems to be purely for CI purposes, not for local builds. Accordingly, I also renamedbuild.shtobuild-ci.shfor clearer intent.