hello
type
(gridgtk:17424): GLib-GObject-CRITICAL : 05:05:16.468: g_value_get_boxed: assertion 'G_VALUE_HOLDS_BOXED (value)' failed" type
tank you
linux xubuntu 18.04 gtk 3.22 nim 1.0
Do you really assume someone can guess the reason for the error from that snippet?
GValue is one of the more difficult part of GTK, luckily we don't need it often. We have some examples for using of GValue for gintro already. When you use it wrong you get messages like above. Please try harder to provide a minimal Nim example and when possible a working C code too, other languages like Python, D, Rust, Go are welcome too.
I do consider providing better interfaces for the cases where GValue is necessary currently, but that is not easy, sorry.
Hello , the example is on {table.nim complete uiTable} in github ui
excuse me I should have given you the context.
otherwise the presented APIs are really easy to use and very easy to implement. they cover a large part of the work for management (invoicing stock order .....)
tank you
You are referring to https://github.com/nim-lang/ui/blob/master/examples/table.nim
That is the only one google gave me, but it is in no way related to gintro/gtk3
OK, but I have never seen that code before. It seems to belong to libui, a different Nim GUI lib.
Mr Rouge, please try to provide a C example to show what you really desire. Or an example in a different programming language. Currently I can not guess what you intent, and I would hope that we do not need GValues with boxing types. When we really need then, then I have to investigate.
for gintro you answered well I have no problem it was another message
but i was also doing a test with ui which is different from gintro You are referring to https://github.com/nim-lang/ui/blob/master/examples/table.nim
and the message was for ui to signal that the table.nim was generating errors not due to table.nim encoding thank you
for gintro you answered well I have no problem it was another message
So I misunderstood you because you asked about gintro some hours before.
For libui I can not help you. It seems that libui is hosted under nim-lang at github, so maybe open an github issue there. Or just wait, maybe someone other will see this thread.
everything works I made the change in table.c
the example is not concrete for a beginner but once set up and with data .. everything rolls finally it's pretty simple
it lacks color in the cells the rest is more than viable
table.c
static void applyColor(GtkTreeModel *m, GtkTreeIter *iter, int modelColumn, GtkCellRenderer *r, const char *prop, const char *propSet) { GValue value = G_VALUE_INIT; GdkRGBA *rgba=NULL; gtk_tree_model_get_value(m, iter, modelColumn, &value); //rgba = (GdkRGBA *) g_value_get_boxed(&value); if (rgba != NULL) g_object_set(r, prop, rgba, NULL); else g_object_set(r, propSet, FALSE, NULL); g_value_unset(&value); }