@angristan why are you using GTK on macOS in the first place? πŸ™‚

@angristan ah.

No idea why you're getting the error, your example works for me. You could try debugging gtk_tree_model_foreach() to see what it really gets and why GTK_IS_TREE_MODEL() check fails.

@angristan well here you're clearly not initializing it, and of course NULL isn't a GtkTreeModel

@angristan that explains it, but in the piece of code that you've posted on Stack Overflow you are initializing it properly and not resetting it afterwards


@angristan you can debug that with a watchpoint to see when your variable gets set to NULL

Β· Web Β· 1 Β· 0 Β· 0

@bugaevc actually I store my GtkListStore in a struct along with other things.

For some reason, when I click on a button that calls a specific function, some of the struct's DATA becomes NULL. But when I click on other buttons, the data is back. And they're called from the same place with the same params


(sorry the code is not very clean)

@angristan notice how the address of global_struct that send_cart() receives differs from the address the two other callbacks receive; that explains why it seems to contain bogus data. Perhaps you're not connecting it to the signal properly? (it's not visible in your screenshots)

@angristan actually it might be that send_card() is missing a first argument of type GtkWidget or something, and the pointer you're getting as global_struct is actually a pointer to the widget

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and follow the Toot CafΓ© list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!