Advertisement Β· 728 Γ— 90
#
Hashtag
#puregotk
Advertisement Β· 728 Γ— 90
Two puregotk-based apps on the left, the GTK inspector on the right. All of this is running on macOS Tahoe.

Two puregotk-based apps on the left, the GTK inspector on the right. All of this is running on macOS Tahoe.

In some more fun #puregotk #GNOME news - I managed to get Meson to work on macOS. You can even write a GObject library in Go now, compile it to a dylib and typelib, and then another puregotk-based app (or GJS, Python etc.) can load the custom widget and display it with no issues!

6 1 1 0
Two puregotk-based apps on the left, the GTK inspector on the right. All of this is running on macOS Tahoe.

Two puregotk-based apps on the left, the GTK inspector on the right. All of this is running on macOS Tahoe.

In some more fun #puregotk #GNOME news - I managed to get Meson to work on macOS. You can even write a GObject library in Go now, compile it to a dylib and typelib, and then another puregotk-based app (or GJS, Python etc.) can load the custom widget and […]

[Original post on mastodon.social]

1 2 1 0

#puregotk now supports #GNOME 50! Sessions is already updated to use it too :) Having a speedy bindings generator and simple pipeline really makes all the difference here, took just under an hour for updating, verification, using it in a different app, tagging a release, using it in Flatpak,

1 0 1 0
Original post on mastodon.social

#puregotk now supports #GNOME 50! Sessions is already updated to use it too :) Having a speedy bindings generator and simple pipeline really makes all the difference here, took just under an hour for updating, verification, using it in a different app, tagging a release, using it in Flatpak […]

0 0 0 0
Sessions, my pomodoro timer app, running on macOS Tahoe

Sessions, my pomodoro timer app, running on macOS Tahoe

Kind of neat how well #GNOME apps fit in on macOS :)Since @nila added support for macOS to #puregotk in https://codeberg.org/puregotk/puregotk/pulls/43 this week I thought I’d give it a shot on my new MacBook Neo - and it works really well. Cross-compilation […]

[Original post on mastodon.social]

1 0 0 0
Preview
Fix examples after move to Codeberg While testing the Flatpak builds after the Codeberg move, I noticed that `flatpak-builder` was failing with "File exists" errors for all examples that use `go replace` to build against the locally checked out puregotk code. During the move to Codeberg, this: ```go module github.com/jwijenb...

#puregotk has moved to #Codeberg ! I've just opened the first PR to it: https://codeberg.org/puregotk/puregotk/pulls/42

Gosh it is nice to have a usable signal/noise ratio on a forge again ...

0 0 1 0
Preview
Fix examples after move to Codeberg While testing the Flatpak builds after the Codeberg move, I noticed that `flatpak-builder` was failing with "File exists" errors for all examples that use `go replace` to build against the locally checked out puregotk code. During the move to Codeberg, this: ```go module github.com/jwijenb...

#puregotk has moved to Codeberg! I've just opened the first PR to it: https://codeberg.org/puregotk/puregotk/pulls/42

Gosh it is nice to have a usable signal/noise ratio on a forge again ...

0 0 0 0
Preview
Fix string conversion when calling Go callbacks from C by pojntfx Β· Pull Request #3 Β· jwijenbergh/purego This is a follow-up PR to jwijenbergh/puregotk#36 - I didn't check if this could be fixed directly in purego, but turns out it can. It looks like there simply was a missing continue in the swit...

#puregotk (or, as it turns out, purego actually) now supports passing C strings to Go, which makes the #GTK dialog responses work!

github.com/jwijenbergh/purego/pull/...

2 0 0 0

#puregotk (or, as it turns out, purego actually) now supports passing C strings to Go, which makes the #GTK dialog responses work!

github.com/jwijenbergh/purego/pull/...

0 0 0 0
Preview
GitHub - pojntfx/puregotk at fix-c-to-go-calls Autogenerated GTK4+Adwaita bindings for Go leveraging ebitengine/purego - GitHub - pojntfx/puregotk at fix-c-to-go-calls

Another #puregotk #Go #GTK bindings fix: Callbacks that contain strings (think `Settings.ConnectChanged`, `AdwDialog.ConnectResponse`) now correctly convert them from C strings to Go strings: github.com/pojntfx/puregotk/tree/fi...

Will cherry-pick & PR tomorrow.

0 0 0 0
A WebView rendering Markdown in a GTK app, with the inspector to the right

A WebView rendering Markdown in a GTK app, with the inspector to the right

Managed to get #WebKitGTK to work with #puregotk . Just needed to add a small tweak since it was mixing up `gio.Byte` with `[]byte`. I think that makes it one of the first full-featured, CGo-free WebView libraries for Go?

2 0 2 0

Another #puregotk #Go #GTK bindings fix: Callbacks that contain strings (think `Settings.ConnectChanged`, `AdwDialog.ConnectResponse`) now correctly convert them from C strings to Go strings: github.com/pojntfx/puregotk/tree/fi...

Will cherry-pick & PR tomorrow.

0 0 0 0
A WebView rendering Markdown in a GTK app, with the inspector to the right

A WebView rendering Markdown in a GTK app, with the inspector to the right

Managed to get #WebKitGTK to work with #puregotk. Just needed to add a small tweak since it was mixing up `gio.Byte` with `[]byte`. I think that makes it one of the first full-featured, CGo-free WebView libraries for Go?

0 1 0 0
Preview
GIR: Manually register types for WebKit since they aren't being regis… Β· pojntfx/ledger@5a1608f …tered automatically at library load time

Ha, ran into a #WebKitGTK quirk today while extending the #puregotk generator to work with it: https://bugs.webkit.org/show_bug.cgi?id=175937

Workaround for now: github.com/pojntfx/ledger/commit/5a...

0 0 1 0
Original post on mastodon.social

Ha, ran into a #WebKitGTK quirk today while extending the #puregotk generator to work with it: https://bugs.webkit.org/show_bug.cgi?id=175937

Workaround for now: github.com/pojntfx/ledger/commit/5a...

Funnily enough I ran into this exact problem with […]

0 0 0 0
Preview
Add examples for subclassing, GObject libraries, and Flatpak/Meson by pojntfx Β· Pull Request #34 Β· jwijenbergh/puregotk This adds more examples for the more complex features and use cases (subclasses, building GObject libraries) for puregotk and common patterns (usage with Meson vs regular Go, Flatpak, i18n, Bluepri...

https://github.com/jwijenbergh/puregotk/pull/34

Aaaand here we go! #puregotk #Go #GNOME binding examples, including subclassing and how to create a GObject library with Go (so you can distribute custom GTK widgets written in Go to C, JS, Vala, Python etc. apps)!

0 0 1 0
Preview
Add examples for subclassing, GObject libraries, and Flatpak/Meson by pojntfx Β· Pull Request #34 Β· jwijenbergh/puregotk This adds more examples for the more complex features and use cases (subclasses, building GObject libraries) for puregotk and common patterns (usage with Meson vs regular Go, Flatpak, i18n, Bluepri...

https://github.com/jwijenbergh/puregotk/pull/34

Aaaand here we go! #puregotk #Go #GNOME binding examples, including subclassing and how to create a GObject library with Go (so you can distribute custom GTK widgets written in Go to C, JS, Vala, Python etc. apps)!

1 0 2 0
Screenshot of https://github.com/pojntfx/puregotk/tree/add-examples/examples/mylib-gtk-meson; there is a lot of text, the URL contains a alt text for the embedded images etc.

Screenshot of https://github.com/pojntfx/puregotk/tree/add-examples/examples/mylib-gtk-meson; there is a lot of text, the URL contains a alt text for the embedded images etc.

One or two days left until the next #puregotk #Go #GNOME upstreaming PR. I've imported my examples for how to do subclassing with Golang, creating a custom GObject introspection-compatible library and so on into the upstream repo, and I've started writing documentation.

0 0 1 0
Screenshot of https://github.com/pojntfx/puregotk/tree/add-examples/examples/mylib-gtk-meson; there is a lot of text, the URL contains a alt text for the embedded images etc.

Screenshot of https://github.com/pojntfx/puregotk/tree/add-examples/examples/mylib-gtk-meson; there is a lot of text, the URL contains a alt text for the embedded images etc.

One or two days left until the next #puregotk #Go #GNOME upstreaming PR. I've imported my examples for how to do subclassing, creating a custom GObject introspection-compatible library and so on into the upstream repo, and I've started writing documentation […]

[Original post on mastodon.social]

0 0 0 0

New, soon-to-be upstreamed #puregotk #GNOME work today: A Meson-free/pure Go & Flatpak environment for building GNOME apps in Go as an alternative to the Meson one! Now I just have to rename them, git-subtree-split them out of the repo,

0 0 1 0
Original post on mastodon.social

New, soon-to-be upstreamed #puregotk #GNOME work today: A Meson-free/pure Go & Flatpak environment for building GNOME apps in Go as an alternative to the Meson one! Now I just have to rename them, git-subtree-split them out of the repo, and upstream it to the bindings and then these can become […]

1 1 0 0

New #gogettext (my #puregotk -based gettext bindings for Go) release! v0.2.0 now supports `BindI18n` and `dgettext` to allow scoping gettext translation domains in a more fine-grained way.

1 0 1 0
Original post on mastodon.social

New #gogettext (my #puregotk -based gettext bindings for Go) release! v0.2.0 now supports `BindI18n` and `dgettext` to allow scoping gettext translation domains in a more fine-grained way. This allows using two different translation domains in more complex scenarios, such as a Go GObject library […]

0 1 0 0
Preview
Add Flatpak application library path to defaults by pojntfx Β· Pull Request #33 Β· jwijenbergh/puregotk When you're trying to use a puregotk-based GObject library in a Flatpak as a dependency based on the current main branch like so: { "id": "com.pojtinger.felicitas.SenbaraGnomeN...

New #puregotk #Go #GNOME PR for today: Support for importing GTK GObject libraries built in Go via Meson from Go GTK applications, out of the box!

https://github.com/jwijenbergh/puregotk/pull/33

1 0 0 0
Preview
Add Flatpak application library path to defaults by pojntfx Β· Pull Request #33 Β· jwijenbergh/puregotk When you're trying to use a puregotk-based GObject library in a Flatpak as a dependency based on the current main branch like so: { "id": "com.pojtinger.felicitas.SenbaraGnomeN...

New #puregotk #GNOME PR for today: Support for importing GTK GObject libraries built in Go via Meson from Go GTK applications, out of the box!

https://github.com/jwijenbergh/puregotk/pull/33

0 0 0 0
This code:

{
  "id": "com.pojtinger.felicitas.SenbaraGtkExample",
  "runtime": "org.gnome.Platform",
  "runtime-version": "49",
  "sdk": "org.gnome.Sdk",
  "sdk-extensions": ["org.freedesktop.Sdk.Extension.golang"],
  "command": "example.js",
  "build-options": {
    "append-path": "/usr/lib/sdk/golang/bin"
  },
  "finish-args": [
    "--socket=wayland",
    "--socket=fallback-x11",
    "--share=ipc",
    "--device=dri"
  ],
  "modules": [
    {
      "name": "senbaragtk",
      "buildsystem": "meson",
      "sources": [{ "type": "dir", "path": "." }, "go.mod.json"]
    },
    {
      "name": "senbaragtkexample",
      "buildsystem": "simple",
      "build-commands": ["install -Dm755 example.js /app/bin/example.js"],
      "sources": [{ "type": "file", "path": "example.js" }]
    }
  ]
}

The app is running to the right as an overlay. The text is in German.

This code: { "id": "com.pojtinger.felicitas.SenbaraGtkExample", "runtime": "org.gnome.Platform", "runtime-version": "49", "sdk": "org.gnome.Sdk", "sdk-extensions": ["org.freedesktop.Sdk.Extension.golang"], "command": "example.js", "build-options": { "append-path": "/usr/lib/sdk/golang/bin" }, "finish-args": [ "--socket=wayland", "--socket=fallback-x11", "--share=ipc", "--device=dri" ], "modules": [ { "name": "senbaragtk", "buildsystem": "meson", "sources": [{ "type": "dir", "path": "." }, "go.mod.json"] }, { "name": "senbaragtkexample", "buildsystem": "simple", "build-commands": ["install -Dm755 example.js /app/bin/example.js"], "sources": [{ "type": "file", "path": "example.js" }] } ] } The app is running to the right as an overlay. The text is in German.

New #puregotk #GNOME hacking milestone: A GObject library built with Go can now be installed as a simple Meson module in Flatpak (fully offline/with tracked dependencies, so this should work for Flatpak too), and then be used by any GIR-compatible language (Go, JS, Python etc.).

1 0 1 0
This code:

{
  "id": "com.pojtinger.felicitas.SenbaraGtkExample",
  "runtime": "org.gnome.Platform",
  "runtime-version": "49",
  "sdk": "org.gnome.Sdk",
  "sdk-extensions": ["org.freedesktop.Sdk.Extension.golang"],
  "command": "example.js",
  "build-options": {
    "append-path": "/usr/lib/sdk/golang/bin"
  },
  "finish-args": [
    "--socket=wayland",
    "--socket=fallback-x11",
    "--share=ipc",
    "--device=dri"
  ],
  "modules": [
    {
      "name": "senbaragtk",
      "buildsystem": "meson",
      "sources": [{ "type": "dir", "path": "." }, "go.mod.json"]
    },
    {
      "name": "senbaragtkexample",
      "buildsystem": "simple",
      "build-commands": ["install -Dm755 example.js /app/bin/example.js"],
      "sources": [{ "type": "file", "path": "example.js" }]
    }
  ]
}

The app is running to the right as an overlay. The text is in German.

This code: { "id": "com.pojtinger.felicitas.SenbaraGtkExample", "runtime": "org.gnome.Platform", "runtime-version": "49", "sdk": "org.gnome.Sdk", "sdk-extensions": ["org.freedesktop.Sdk.Extension.golang"], "command": "example.js", "build-options": { "append-path": "/usr/lib/sdk/golang/bin" }, "finish-args": [ "--socket=wayland", "--socket=fallback-x11", "--share=ipc", "--device=dri" ], "modules": [ { "name": "senbaragtk", "buildsystem": "meson", "sources": [{ "type": "dir", "path": "." }, "go.mod.json"] }, { "name": "senbaragtkexample", "buildsystem": "simple", "build-commands": ["install -Dm755 example.js /app/bin/example.js"], "sources": [{ "type": "file", "path": "example.js" }] } ] } The app is running to the right as an overlay. The text is in German.

New #puregotk #GNOME hacking milestone: A GObject library built with Go can now be installed as a simple Meson module in Flatpak (fully offline/with tracked dependencies, so this should work for Flatpak too), and then be used by any GIR-compatible language […]

[Original post on mastodon.social]

0 0 1 0
Preview
feat: Port from `gotk4` to `puregotk`, embed `flatpak-go-mod` tool Β· pojntfx/multiplex@942c6c5 Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>

github.com/pojntfx/multiplex/commit...

And another Go GTK app is ported to #puregotk ! Not with subclassing yet, but it will get there eventually. Build time is down from ~25 minutes to 20s 🀯

1 0 1 0
Preview
feat: Port from `gotk4` to `puregotk`, embed `flatpak-go-mod` tool Β· pojntfx/multiplex@942c6c5 Signed-off-by: Felicitas Pojtinger

github.com/pojntfx/multiplex/commit...

And another Go GTK app is ported to #puregotk! Not with subclassing yet, but it will get there eventually. Build time is down from ~25 minutes to 20s 🀯

0 0 1 0
This code:

applicationClass.OverrideActivate(func(a *gio.Application) {
			exampleApp := (*exampleApplication)(unsafe.Pointer(a.GetData(dataKeyGoInstance)))

			var app gtk.Application
			a.Cast(&app)

			obj := gobject.NewObject(senbaragtk.MainApplicationWindowGLibType(),
				"application", app,
			)

			var window senbaragtk.MainApplicationWindow
			obj.Cast(&window)

			exampleApp.window = &window

			var cb func(senbaragtk.MainApplicationWindow) = func(w senbaragtk.MainApplicationWindow) {
				fmt.Println("Test button clicked")

				exampleApp.window.ShowToast("Button was clicked!")
				exampleApp.window.SetPropertyTestButtonSensitive(false)

				time.AfterFunc(time.Second*3, func() {
					exampleApp.window.ShowToast("Button re-enabled after 3 seconds")
					exampleApp.window.SetPropertyTestButtonSensitive(true)
				})
			}
			exampleApp.window.ConnectButtonTestClicked(&cb)

			exampleApp.window.Present()
		})

This code: applicationClass.OverrideActivate(func(a *gio.Application) { exampleApp := (*exampleApplication)(unsafe.Pointer(a.GetData(dataKeyGoInstance))) var app gtk.Application a.Cast(&app) obj := gobject.NewObject(senbaragtk.MainApplicationWindowGLibType(), "application", app, ) var window senbaragtk.MainApplicationWindow obj.Cast(&window) exampleApp.window = &window var cb func(senbaragtk.MainApplicationWindow) = func(w senbaragtk.MainApplicationWindow) { fmt.Println("Test button clicked") exampleApp.window.ShowToast("Button was clicked!") exampleApp.window.SetPropertyTestButtonSensitive(false) time.AfterFunc(time.Second*3, func() { exampleApp.window.ShowToast("Button re-enabled after 3 seconds") exampleApp.window.SetPropertyTestButtonSensitive(true) }) } exampleApp.window.ConnectButtonTestClicked(&cb) exampleApp.window.Present() })

This code:

vfunc_activate() {
      this.#window = new SenbaraGtk.MainApplicationWindow({
        application: this,
      });

      this.#window.connect("button-test-clicked", () => {
        console.log("Test button clicked");

        this.#window.show_toast("Button was clicked!");
        this.#window.test_button_sensitive = false;

        setTimeout(() => {
          this.#window.show_toast("Button re-enabled after 3 seconds");
          this.#window.test_button_sensitive = true;
        }, 3000);
      });

      this.#window.present();
    }

This code: vfunc_activate() { this.#window = new SenbaraGtk.MainApplicationWindow({ application: this, }); this.#window.connect("button-test-clicked", () => { console.log("Test button clicked"); this.#window.show_toast("Button was clicked!"); this.#window.test_button_sensitive = false; setTimeout(() => { this.#window.show_toast("Button re-enabled after 3 seconds"); this.#window.test_button_sensitive = true; }, 3000); }); this.#window.present(); }

New progress on the #puregotk #GObject introspection things I'm working on in #Go . It's super early, but I added preliminary support for generated getters/setters for properties. No more manual value setup & `SetProperty` calls required, just a simple `SetPropertyX` call.

1 0 1 0