{"id":19912381,"url":"https://github.com/nesterow/semgtk","last_synced_at":"2026-05-13T17:36:01.728Z","repository":{"id":97832368,"uuid":"203244859","full_name":"nesterow/semgtk","owner":"nesterow","description":"Python and GTK+ tests and samples","archived":false,"fork":false,"pushed_at":"2019-08-28T21:27:01.000Z","size":797,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T22:46:07.999Z","etag":null,"topics":["cairo","gtk3","gui","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nesterow.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-19T20:23:00.000Z","updated_at":"2019-08-28T21:27:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"afa2a370-a809-4563-b593-2ed5c52f9140","html_url":"https://github.com/nesterow/semgtk","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/nesterow%2Fsemgtk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesterow%2Fsemgtk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesterow%2Fsemgtk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesterow%2Fsemgtk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nesterow","download_url":"https://codeload.github.com/nesterow/semgtk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241341722,"owners_count":19947104,"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":["cairo","gtk3","gui","python3"],"created_at":"2024-11-12T21:29:10.932Z","updated_at":"2025-11-23T19:04:41.091Z","avatar_url":"https://github.com/nesterow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"SemanticGTK [WIP]\n-----------------\n\nPython samples for [GTK+](https://www.gtk.org/) and [gobject-introspection](https://gi.readthedocs.io/en/latest/).\n\n### Getting stated\nInstall Python3, GTK3, and gobject-introspection libraries for your operation system. \nThis work is currently tested with MacOS, Arch Linux and Alpine Linux ARM.\n\nThen clone this repository:\n```\n~# git clone https://github.com/nesterow/semgtk\n```\n\nTo verify that GTK3 works correctly in your system, run:\n```\n~# python3 samples/clock.py\n```\n\n### Features\nThis package provides several wrappers for GTK Widgets and Layouts.\n\n#### Element configurator\nSimple API for setting up GTK widgets. It provides additional convenience methods.\n\n##### Usage:\n```python\nfrom components import HorizontalSplit, create_app, load_css\nfrom components import Element as e\n\nif __name__ == \"__main__\":\n    button = e(Gtk.Button, lambda w: (\n        w.set_label('hello'),\n        w.expand(True, True),\n        w.cssId('BlackButton'),\n        w.set_size_request(200, 200)\n    ))\n    image = e(Gtk.Image, lambda w: (\n        w.expand(False, False),\n        w.cssId('image'),\n        w.set_from_file('samples/background.png'),\n        w.set_size_request(200, 200)\n    ))\n    layout = HorizontalSplit([button, image])\n    load_css(__file__, 'window.css')\n    create_app(layout, title = \"Emulator\", fullscreen = True).run()\n```\n\n##### Configurator methods:\n\nAll GTK.Widget options are available. And additionally:\n\n- w.expand(xy: Bool, yx: Bool) - element packing options inside `Gtk.Box`. For horisontal layout: `xy = height, yx = with` - for vertical vice versa\n- w.padding(padding: Number) - element padding for allocated space inside `Gtk.Box` layouts\n- w.cssId(id: String) - set CSS id selector to the element\n\n\n## Layouts\n\n- HorizontalSplit(widgets: List) - the space will be split horizontally (as rows). The amount of space should be controlled by `w.expand`\n- VerticalSplit(widgets: List) - the space will be split vertivally (as columns). `w.expand` options will be inverted\n\n\n## FrameLoop component [WIP]\nFrameLoop is basic class that inherits from `Gtk.DrawingArea`. It provides simple methods to create animated widgets.\nSee [clock example](samples/clock.py) for the reference.\n\n#### FrameLoop::timers\nConvenince methods for setting animation timers.\n- ::timers.timer(name: String, timeout: int[ms]) - sets a timer\n- ::timers.elapsed(name: String): int - returns time elapsed for a timer\n- ::timers.done(name: String): Bool - check whether the timer is stoped\n\n```python\n# samples/clock.py\n    def rotate_minutes(self, minutes, r):\n        #.....\n        self.timers.timer('minutes', 300)        \n        start = rotation - unit\n        angle = easing.inOutSine(self.timers.elapsed('minutes'), start, unit, 300)\n        matrix.rotate(angle)\n        return matrix\n```\n\n## Easing\nTweener's easing functions (Penner's Easing Equations)\n\n```\nFor all easing functions:\n  t = elapsed time\n  b = begin\n  c = change == ending - beginning\n  d = duration (total time)\n```\n\n- easing.linear(t, b, c, d)\n- easing.inQuad(t, b, c, d)\n- easing.outQuad(t, b, c, d)\n- easing.inOutQuad(t, b, c, d)\n- easing.inCubic(t, b, c, d)\n- easing.outCubic(t, b, c, d)\n- easing.inOutCubic(t, b, c, d)\n- easing.defoutInCubic(t, b, c, d)\n- easing.inQuart(t, b, c, d)\n- easing.outQuart(t, b, c, d)\n- easing.inOutQuart(t, b, c, d)\n- easing.outInQuart(t, b, c, d)\n- esinsg.inQuint(t, b, c, d)\n- easing.outQuint(t, b, c, d)\n- easing.inOutQuint(t, b, c, d)\n- easing.outInQuint(t, b, c, d)\n- easing.in[Out]Sine(t, b, c, d)\n- easing.in[Out]Expo(t, b, c, d)\n- easing.in[Out]Circ(t, b, c, d)\n- easing.in[Out]Elastic(t, b, c, d)\n- easing.in[Out]Bounce(t, b, c, d)\n\n\n## Graphics\n\n- RGB(R: Int8 ,G: Int8 ,B: Int8, [A: Float]): Tuple - returns RGB or RGBA in float values. To be used with Cairo\n- load_css(path: __file__, filename: String): load styles from file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnesterow%2Fsemgtk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnesterow%2Fsemgtk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnesterow%2Fsemgtk/lists"}