Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small harmless warning: instance variable @callbacks not initialized #11

Closed
rubyFeedback opened this issue Jan 5, 2021 · 3 comments
Closed

Comments

@rubyFeedback
Copy link
Collaborator

Hey there kojix2!

I am checking on libui every now and then and noticed you added a new release lately.

I also saw the histogram.rb example - really great! \o/ (I would not know how to do the
same in ruby-gtk for example).

Anyway - this is just a small report.

In the last 0.0.8 gem I get this warning:

libui-0.0.8/lib/libui.rb:50: warning: instance variable @callbacks not initialized

Perhaps @callbacks can be initialized to nil or some other value. Thanks!

@kojix2
Copy link
Owner

kojix2 commented Jan 5, 2021

Hi @rubyFeedback

Thank you for your report.
I don't see this error in my environment.
So I don't know if this problem has been fixed, but I have replaced the code with one that does not seem to show the error.

Thank you

517584f

@kojix2
Copy link
Owner

kojix2 commented Jan 5, 2021

I also saw the histogram.rb example

Thanks for looking at the histogram example.
But It is not my original. This example is ported from libui-ruby.
Writing Ruby code with garbage collection in mind is not a good experience.
There are many things that need to be improved.

Since Ruby/GTK has Cairo, I think it is easier to create this kind of code than LibUI.
Also, how to display images in LibUI is still not clear to me...
With Ruby/GTK, you can create something like this

https://github.com/kojix2/Gray-Scott

If you want to display a chart in GUI, you can use GR.rb with GTK. See the following example.

https://github.com/red-data-tools/GR.rb/blob/main/examples/gtk.rb
image

@kojix2
Copy link
Owner

kojix2 commented Aug 26, 2021

Released a new version that includes this change.
Thank you for your reporting!

@kojix2 kojix2 closed this as completed Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants