We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Thank you for this tutorial. Until today I haven't found one for gtk4, so this is a blessing.
Currently I'm struggling with a simple question: how to detect a mouse button click in an Entry?
(I want to open a popup when left-click inside an Entry).
In GTK3, I did (in my entry class):
self.add_events(Gdk.EventMask.BUTTON_PRESS_MASK) self.connect("button-press-event", self.onClick)
but GTK4 doesn't have "button-press-event", right?
After some search, I managed to do something like this:
self.leftClick = Gtk.GestureClick() self.leftClick.set_button(1) self.leftClick.connect("pressed", self.onClick) self.add_controller(self.leftClick)
but the callback works only when I click on the entry's border, but not in the text field.
It would be nice to know how it works.
The text was updated successfully, but these errors were encountered:
PS. Nevermind, it works with Gtk.EventControllerFocus.
Gtk.EventControllerFocus
Sorry, something went wrong.
No branches or pull requests
Thank you for this tutorial. Until today I haven't found one for gtk4, so this is a blessing.
Currently I'm struggling with a simple question: how to detect a mouse button click in an Entry?
(I want to open a popup when left-click inside an Entry).
In GTK3, I did (in my entry class):
but GTK4 doesn't have "button-press-event", right?
After some search, I managed to do something like this:
but the callback works only when I click on the entry's border, but not in the text field.
It would be nice to know how it works.
The text was updated successfully, but these errors were encountered: