gotk3 | gotk3 project provides Go bindings for GTK3
kandi X-RAY | gotk3 Summary
kandi X-RAY | gotk3 Summary
The gotk3 project provides Go bindings for GTK+3 and dependent projects. Each component is given its own subdirectory, which is used as the import path for the package. Partial binding support for the following libraries is currently implemented:. Care has been taken for memory management to work seamlessly with Go’s garbage collector without the need to use or understand GObject’s floating references.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gotk3
gotk3 Key Features
gotk3 Examples and Code Snippets
Community Discussions
Trending Discussions on gotk3
QUESTION
I'm a bit out of ideas here. I want a very simple thing: to be able to select a given GtkListBox
row programmatically and then scroll the list box (which is wrapped in a ScrolledWindow
and a Viewport
).
Selecting a row is trivial (my code is Go & gotk3, but that's not so important):
...ANSWER
Answered 2020-Jul-22 at 19:11So, I had the same issue but managed to make it work in my case. I think there are good chances my solution will work for you too.
Since the grab_focus
method didn't work, I started implementing a workaround solution using listbox_get_row_at_y
. Highly unsatisfying, but hopefully it was going to work. And.. it didn't work, because get_row_at_y
would always return null
, for all the y values I'd feed it. And I knew the listbox wasn't empty. So that made me realize I was trying to focus a row that I had just been adding to the listbox.. The row wasn't realized yet, it couldn't be focused because it wasn't ready for that yet.
So I changed my code to fill the listbox, wait a 100ms timeout, and only then call grab_focus
. And that worked!
I'm actually using a library which is wrapping the timeout call for me, but I think you could use g_timeout_add in 'raw' gtk for that purpose.
Note that this means that calling grab_focus
on a listbox that was already filled beforehand and the items realized on screen should work directly. If that's your situation then this won't help you.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gotk3
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page