kojix2 / LibUI

A portable GUI library for Ruby
MIT License
208 stars 10 forks source link

Main README.md - I think the first example on that file can be simplified a bit #12

Closed rubyFeedback closed 3 years ago

rubyFeedback commented 3 years ago

Hello kojix2.

I read in the news that we do no longer have to return 0.

I tried it - and it works! So I assume 0 can now be omitted?

Anyway - the main README has this example right now:

UI.window_on_closing(main_window) do
  puts 'Bye Bye'
  UI.control_destroy(main_window)
  UI.quit
  0
end

The 0 can probably be removed.

Sorry for reporting so many tiny issues but tiny issues are simpler to fix. I am aware of how much work it can be to look at the libui code and make it pleasant to use from the ruby side. Omitting 0 is already an improvement! :)

kojix2 commented 3 years ago

Thanks.

You are right. This was originally a mistake on my part. Actually, there was no need to add a zero from the beginning. Some functions, such as window_on_closing, must return 0, so I misunderstood, as if all callbacks needed to have 0.

I will fix the README.

Also, you can send me a pull request. (I think you can fix the README and send a pull request just by clicking your browser) I respect your way of engaging with Github, but you are welcome to send me a pull request if you'd like.

kojix2 commented 3 years ago

We still need the 0 in README. I'll put it back. Sorry.