{"id":13535367,"url":"https://github.com/JeremyLetang/rgtk","last_synced_at":"2025-04-02T01:30:39.849Z","repository":{"id":12220206,"uuid":"14828291","full_name":"jeremyletang/rgtk","owner":"jeremyletang","description":"GTK+ bindings and wrappers for Rust (DEPRECATED SEE https://github.com/rust-gnome )","archived":false,"fork":false,"pushed_at":"2017-02-22T01:44:47.000Z","size":5283,"stargazers_count":120,"open_issues_count":18,"forks_count":22,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-31T19:41:50.254Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeremyletang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-30T20:59:55.000Z","updated_at":"2024-09-29T17:33:11.000Z","dependencies_parsed_at":"2022-09-24T13:10:15.698Z","dependency_job_id":null,"html_url":"https://github.com/jeremyletang/rgtk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Frgtk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Frgtk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Frgtk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Frgtk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremyletang","download_url":"https://codeload.github.com/jeremyletang/rgtk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222788514,"owners_count":17037777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T08:00:54.978Z","updated_at":"2024-11-02T23:31:21.270Z","avatar_url":"https://github.com/jeremyletang.png","language":"Rust","readme":"THIS REPOSITORY IS DEPRECATED SEE: https://github.com/rust-gnome\nrgtk [![Build Status](https://travis-ci.org/jeremyletang/rgtk.svg?branch=master)](https://travis-ci.org/jeremyletang/rgtk) [![Gitter chat](https://badges.gitter.im/jeremyletang/rgtk.png)](https://gitter.im/jeremyletang/rgtk)\n====\n\n__Rust__ bindings and wrappers for __GLib__, __GDK 3__, __GTK+ 3__  and __Cairo__.\n\n## Building\n\n__rgtk__ expects __GTK+__, __GLib__ and __Cairo__ development files to be installed on your system. Optionally, it is recommended to install the debug packages containing helpful debug symbols.\n\n### Debian and Ubuntu\n\n```Shell\n\u003e sudo apt-get install libgtk-3-dev\n\u003e sudo apt-get install libgtk-3-0-dbg libglib2.0-0-dbg libcairo2-dbg\n```\n\n### Fedora\n\n```Shell\n\u003e sudo yum install gtk3-devel glib2-devel\n```\n\n### OS X\n\nInstall [XQuartz](http://xquartz.macosforge.org/landing/), then:\n```Shell\n\u003e brew install gtk+3 --without-x11\n\u003e export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig\n```\n\n### Windows\n\nInstall [mingw-w64](http://mingw-w64.yaxm.org/) (select the win32 threading model) and download a __GTK+__ SDK:\n * The GNOME project has an official distribution of GTK+ 3.6: [x86](http://www.gtk.org/download/win32.php), [x64](http://www.gtk.org/download/win64.php).\n * [GTK+ for Windows Runtime Environment Installer: 64-bit](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer) supports GTK+ 3.14, its SDK downloads can currently be found [here](http://lvserver.ugent.be/gtk-win64/sdk/).\n\nMake sure both mingw's and the sdk's `bin` directories are in your `PATH` e.g. (assuming mingw is installed in `C:\\mingw-w64` and the SDK unpacked into `C:\\gtk`)\n```\nC:\\\u003e set PATH=\"C:\\mingw-w64\\bin;C:\\gtk\\bin;%PATH%\"\n```\nIt's crucial that GCC from mingw is used by Rust so either make sure that mingw is earlier in the `PATH` or delete `gcc.exe` and `ld.exe` from the Rust installation.\n\n## Versions and features\n\n__rgtk__ targets __GTK+__ 3.6 and __Cairo__ 1.10 by default, other versions support is enabled by requesting a corresponding feature e.g.\n```Shell\n\u003e cargo build --features \"GTK_3_10 CAIRO_1_12\"\n```\nCurrently supported versions are __GTK+__ 3.4 to 3.14 and __Cairo__ 1.10 to 1.12.\n\nWe are currently targetting rust master compiler to build __rgtk__, make sure you have the latest version before submitting any bugs.\n\nIn `examples` you can find some tests showing off the functionality, these can be built and run as follows:\n\n```Shell\n\u003e cd examples\n\u003e cargo build --release\n# Or, if your system has GTK 3.10 or later\n\u003e cargo build --features GTK_3_10 --release\n\u003e ./target/release/gtktest\n\u003e ./target/release/cairotest\n```\n\nWhen building documentation don't forget to specify the feature set you're using:\n\n```Shell\n\u003e cargo doc --feature GTK_3_12\n```\n\nYour local copy can be accessed using your browser at\n\n`file:///{rgtk_location}/target/doc/rgtk/index.html`\n\nYou can also access a daily build of the docs via the internet:\n\nhttp://rust-ci.org/jeremyletang/rgtk/doc/rgtk/\n\n## Including rgtk as a cargo dependency\n\nTo include rgtk as a cargo dependency you have to add it to your Cargo.toml and specify the GTK version you want using Cargo features\n```Toml\n[dependencies.rgtk]\ngit = \"https://github.com/jeremyletang/rgtk.git\"\nfeatures = [\"GTK_3_12\"]\n```\n\n## Use __rgtk__\n\nTo implement __GTK+__ inheritance in rust, we implemented gtk superclasses as traits located in `rgtk::gtk::traits::*`. The various widgets implement these traits and live in `rgtk::gtk::*`.\n\nFor your convenience the various traits are reexported in the `rgtk::*` namespace as `Gtk{trait_name}Trait` so you can just use...\n\n```Rust\nextern mod rgtk;\nuse rgtk::*;\n```\n\n...to easily access all the gtk widgets and all traits methods:\n\n```Rust\nlet button = gtk::Button:new(); // You have access to the struct methods of gtk::Button aswell\n                                // as the trait methods from gtk::traits::Button as GtkButtonTrait.\n```\n\n## Projects using rgtk\n* [SolidOak](https://github.com/oakes/SolidOak)\n* [rrun](https://github.com/buster/rrun)\n\nIf you want yours to be added to this list, please create a Pull Request for it!\n\n## Contribute\n\nContributor you're welcome!\n\nYou probably know but __Gtk+__ uses its own GObject system: inherited class and interface.\n\nTo respect this design, I follow a special design on __rgtk__:\n\n* Interface -\u003e Implement them on a trait with only default methods.\n* Class -\u003e Implement the construct on the class impl and other methods on a traits.\n* Sub-class -\u003e Implement all the methods on the class.\n\nExample for GtkOrientable, GtkBox, GtkButtonBox:\n\nGtkOrientable is an interface with all methods implemented as default method of the trait gtk::traits::Orientable.\n\nGtkBox is a class with constructors implemented on the struct `gtk::Box`, and the other method as default methods of the trait `gtk::traits::Box`. So `gtk::Box` implements `gtk::traits::Orientable` and `gtk::traits::Box`.\n\nGtkButtonBox is a sub-class of GtkBox, the struct `gtk::ButtonBox` implements all the methods of GtkButtonBox and the traits `gtk::traits::Orientable` and `gtk::traits::Box`.\n\nFinally, all the gtk widgets implement the trait gtk::traits::Widget.\n\n## License\n\n__rgtk__ is available under the same license term as GTK+: the LGPL (Lesser General Public license).\n","funding_links":[],"categories":["代码"],"sub_categories":["GUI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJeremyLetang%2Frgtk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJeremyLetang%2Frgtk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJeremyLetang%2Frgtk/lists"}