Giter Club home page Giter Club logo

rust-ui-fltk's People

Contributors

davidedelpapa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

rust-ui-fltk's Issues

Minimal example no longer up to date

Greetings,
First of all I'd like to thank you for the work you have put out in your article on the state of GUI libraries in Rust. I was browsing it earlier to take a look at the current state of GUI libraries and play around with some of them. While testing FLTK, I noticed that the minimal snippet of code you provide no longer compiles properly. It seems there are two reasons :

  • Instantiating widgets seems to require loading fltk::prelude::* :
   error[E0599]: no function or associated item named `new` found for struct `DoubleWindow` in the current scope
 --> src/main.rs:5:28
  |
5 |     let mut wind = Window::new(100, 100, 400, 300, "Hello, FLTK!");
  |                            ^^^ function or associated item not found in `DoubleWindow`
  |
  = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
  |
1 | use fltk::prelude::WidgetBase;
  |
  • The set_callback method now takes a FnMut(&mut Self) instead of a simple FnMut() :
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
  --> src/main.rs:13:9
   |
13 |     but.set_callback(move || frame.set_label("Hello, World!"));
   |         ^^^^^^^^^^^^ ------- takes 0 arguments
   |         |
   |         expected closure that takes 1 argument
   |
help: consider changing the closure to take and ignore the expected argument
   |
13 |     but.set_callback(move |_| frame.set_label("Hello, World!"));
   |                           ^^^

the fixes are trivial of course, I just wanted to let you know that, using the latest release of fltk (1.0.1) this code changed.

Have a nice day !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.