This is a fork of hugopl/gtk4.cr, but for AtSpi. Please see that other repo for details or read on below.
In fact, this very repository only consists out of four lines of code because most of the development happens in the binding generator repository, not here.
There's also the more popular and more battle-tested jhass/crystal-gobject for GTK3. Both bindings are not compatible, but migrating is not hard. I made this very alternative because when I used the other one, there were rare different rare crashes which I couldn't resolve.
If you need GTK3, you can use https://github.com/phil294/gtk3.cr.
Current documentation is far from being good, but is better (not much) than nothing.
To generate the documentation clone this repository then do:
$ make doc
The documentation will be found at docs/index.html
. (NOT TESTED)
You need the GTK libraries and their GObjectIntrospection files.
- Archlinux:
pacman -S gtk4 gobject-introspection
- Ubuntu:
apt-get install libgtk-4-1 libgirepository1.0-dev gobject-introspection gir1.2-gtk-4.0
- macOS:
brew install gobject-introspection gtk4
Be welcome to create a PR updating this readme once you know what packages are needed by your distro to run the examples.
Just the AtSpi libraries are needed at runtime, i.e. not the gobject-introspection
library and files.
-
Add the dependency to your
shard.yml
:dependencies: atspi: github: phil294/atspi.cr
-
Run
shards install
-
Run
bin/gi-crystal
Example usage:
require "atspi"
atspi_status = Atspi.init
desktop = Atspi.desktop(0)
desktop.child_count.times do |i|
app = desktop.child_at_index(i)
puts app.name
end
For more details, check the generated source after install in ./lib/gi-crystal/src/auto/atspi
or this real world example.
- Fork it (https://github.com/phil294/atspi.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Philip Waritschlager - creator and maintainer