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

Proposal: could a .rb example file be added, to showcase event signal changes handling in ruby-gtk4? Just to show the new API that gtk4 uses here. #1502

Open
rubyFeedback opened this issue Sep 13, 2022 · 1 comment

Comments

@rubyFeedback
Copy link

Heya kou,

I am currently experimenting with ruby-gtk4 now that it works (for me at the least).

The guide here mentions what has changed:

https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/migrating-3to4.md

::button-press-event            # -> [class@Gtk.GestureClick]
::key-press-event               # -> [class@Gtk.EventControllerKey]

Would it be possible to add examples that show the changed API?

The old events I used in ruby-gtk2 and ruby-gtk3 do not seem to work. I assume I have
to change it to Gtk::GestureClick and Gtk::EventControllerKey but I have not yet tried.

I may figure it out in the coming days. But I think it may be nice to add a widget that
could work in ruby-gtk3, and then in ruby-gtk4, to show what has changed in regards
to events.

Not all events have to be tested, but I believe the mouse-key-press event and the
keyboard-key-press event is very commonly used in application code, so it may
be nice to have just a small (really small) example, like the hello world example,
but just showcasing the event keys.

I'll try to figure it out on my own and then perhaps I will have an example that I can
add. Or perhaps someone else is faster. But I think for new users for ruby-gtk4
in particular it may be helpful to have a single .rb file that showcases a working
example of events. People can then adapt it in their own projects.

@kou
Copy link
Member

kou commented Sep 13, 2022

I agree with this.

I'm waiting for volunteers who want to working on this: #1489 (comment)

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