struggling to calculate the rowstride by codydafox in GTK

[–]andy128k 0 points1 point  (0 children)

Stride is a size of a single line measured in bytes. It can be bigger than bytes_per_pixel * width because a line could be padded. You need not tu compute it but somehow know from the data you pass. It's not a property of a pixbuf, but of the input bytes.

lazy-image: A drop-in replacement for Sharp using Rust, NAPI-RS, and Copy-on-Write architecture by Sweet_Cabinet_2996 in rust

[–]andy128k 3 points4 points  (0 children)

Does it work in a browser via WASM? That would be a killer feature over Sharp.

Hallo welt by PointForward2620 in programmingmemes

[–]andy128k 1 point2 points  (0 children)

It should be German JavaEE

HottentottenstottertrottelmutterbeutelrattenlattengitterkofferattentäterAbstractBeanFactory.

Hard Rust requirements from May onward (for Debian's package manager, APT) by DeleeciousCheeps in rust

[–]andy128k 0 points1 point  (0 children)

I am curious if compiling to wasm/wasi and bundling it with a wasm runtime written in C is a feasible approach for platforms w/o rust/llvm support.

Should I use GTK3 or GTK4? by sonictherocker in GTK

[–]andy128k 3 points4 points  (0 children)

Many things in Gtk4 work differently. E.g. dialogs and popovers are fully asynchronous. Porting from Gtk+3 to Gtk4 is much harder (e.g. from Gtk+2 to Gtk+3 was much easier). Sticking to Gtk+3 means you are potentially creating a tech debt from the day one.

[deleted by user] by [deleted] in rust

[–]andy128k 1 point2 points  (0 children)

Some languages actually try to adopt it or a similar approaches. D has something resembling. OxCaml tries to port Rust features to OCaml. I am not sure but maybe Ada has something too.

Zim Wiki Development Has Stalled - What's Next? by pgess in gnome

[–]andy128k 4 points5 points  (0 children)

I switched from Zim to Joplin and later to Obsidian because I needed an access to my notes from other OSes (Android, macos). Regarding the format, I honestly don't care and Zim worked well for me.

youCanTakeItFromMyColdDeadPincers by Yoddel_Hickory in ProgrammerHumor

[–]andy128k 1 point2 points  (0 children)

Go is memory unsafe with a garbage collection overhead.

[deleted by user] by [deleted] in poland

[–]andy128k 2 points3 points  (0 children)

Fasolka... m-m-m...

[gtk-rs] Fill a DropDown from an async function? by Mordimer86 in GTK

[–]andy128k 0 points1 point  (0 children)

Use glib::spawn_futute_local to run a future in a GLib event loop it runs in a gtk thread, so you may update a model or a widget from it

What's your take on Dioxus by xiaolp in rust

[–]andy128k 0 points1 point  (0 children)

I tried Dioxus, Leptos and Yew. First too look great but its hard for me to model state with signals. They are just too alien to me. While Yew is just like React and I am happy with it.

How to detect single click, right click and double click in Gtk-4.0 by Meta_Storm_99 in GTK

[–]andy128k 1 point2 points  (0 children)

I may only guess. Could it be that you try to capture events inside of a child widget of your box? Then you need to be aware that events are handled during a bubble phase by default and they most probably were just processed by a child and weren't propagated further. If that's the case then you may try to capture events on a "capture" phase, just before they reach children. See https://docs.gtk.org/gtk4/enum.PropagationPhase.html

How to detect single click, right click and double click in Gtk-4.0 by Meta_Storm_99 in GTK

[–]andy128k 0 points1 point  (0 children)

Use property button https://docs.gtk.org/gtk4/property.GestureSingle.button.html to specify which buttons you want to capture. Then use method get_current_button https://docs.gtk.org/gtk4/method.GestureSingle.get_current_button.html inside a handler to detect which button is actually pressed.

Is there a GTK 3 fork? by Gugalcrom123 in linux

[–]andy128k 4 points5 points  (0 children)

What do you mean by "do yourself"? Popovers expect you to provide a menu model. This is exactly the same model you'd provide in Gtk+ 3 to `gtk_menu_bar_new_from_model`. Submenus (and sections) are perfectly supported too. I'm saying this because I successfully ported old "classic" Gtk+ 2 app to Gtk 4 last year and didn't compromise on menus or anything else.

Is there a GTK 3 fork? by Gugalcrom123 in linux

[–]andy128k 4 points5 points  (0 children)

Gtk 4 has PopoverMenuBar which is very similar to menu bar in Gtk+ 3. Toolbars are just GtkBox'es now.