Display GVariant in GtkTreeViewGtkTreeView with CSS in Gtk3Use entry combobox when migrating to pygobject, glade and gtk3Gtk3 smooth GtkTreeView on windowsDoes &((struct name *)NULL -> b) cause undefined behaviour in C11?GtkTreeView does not show all rows when in a GtkBoxHow to display GtkTreeView with dummy data in ValaOutput of Struct passed to functionHow to alternate light/dark rows in GtkTreeView?Changing Color of A Single Row in GtkTreeViewHow to add a hover effect to a GtkTreeView cell

What happened to Captain America in Endgame?

What is the philosophical significance of speech acts/implicature?

Can SQL Server create collisions in system generated constraint names?

Was there a shared-world project before "Thieves World"?

What happens to Mjolnir (Thor's hammer) at the end of Endgame?

Elements other than carbon that can form many different compounds by bonding to themselves?

Re-entry to Germany after vacation using blue card

As an international instructor, should I openly talk about my accent?

How much cash can I safely carry into the USA and avoid civil forfeiture?

Two field separators (colon and space) in awk

How to display Aura JS Errors Lightning Out

Could the terminal length of components like resistors be reduced?

Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?

A ​Note ​on ​N!

What does ゆーか mean?

Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?

Function pointer with named arguments?

Dynamic SOQL query relationship with field visibility for Users

Aligning equation numbers vertically

Pulling the rope with one hand is as heavy as with two hands?

How do I reattach a shelf to the wall when it ripped out of the wall?

"You've called the wrong number" or "You called the wrong number"

How can I practically buy stocks?

Is the claim "Employers won't employ people with no 'social media presence'" realistic?



Display GVariant in GtkTreeView


GtkTreeView with CSS in Gtk3Use entry combobox when migrating to pygobject, glade and gtk3Gtk3 smooth GtkTreeView on windowsDoes &((struct name *)NULL -> b) cause undefined behaviour in C11?GtkTreeView does not show all rows when in a GtkBoxHow to display GtkTreeView with dummy data in ValaOutput of Struct passed to functionHow to alternate light/dark rows in GtkTreeView?Changing Color of A Single Row in GtkTreeViewHow to add a hover effect to a GtkTreeView cell






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have the challenge to store and later read values from type uint16 in a GtkListStore. This GtkListStore is also used as a model for a GtkTreeView and the uint16 value shall also be displayed as a column.



I've troubleshooted weird behaviour until I found out, the issue is due to passing a guint16 variable to gtk_tree_model_get() which can only be defined as G_TYPE_UINT in the ListStore which is a 32-bit unsigned integer effectively.



However, since I have to rely on the uint16 variable type, I tried to circumvent the issue by wrapping it in a GVariant.



Works so far. The weird behaviour is fixed this way. However, now I have issues to display these values in a TreeView. When starting the application I get the following error message:




GLib-GObject-WARNING **: unable to set property 'text' of type 'gchararray' from value of type 'GVariant'




Here the code how the GtkListStore is defined and filled with the GVariant:



static void set_initial_value(void)

GtkTreeIter iter;
GVariant *gv_uint16;

if (store == NULL)
store = gtk_list_store_new(1, G_TYPE_VARIANT);


gv_uint16 = g_variant_new_uint16((guint16)42);

gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0, gv_uint16, -1);




And here is how the column in the TreeView is defined:



 renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes("Number", renderer,
"text", 0, NULL);

gtk_tree_view_column_set_sort_column_id(column, 0);
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);


Does someone have an idea how to display this GVariant value in the TreeView?
Thanks.










share|improve this question




























    0















    I have the challenge to store and later read values from type uint16 in a GtkListStore. This GtkListStore is also used as a model for a GtkTreeView and the uint16 value shall also be displayed as a column.



    I've troubleshooted weird behaviour until I found out, the issue is due to passing a guint16 variable to gtk_tree_model_get() which can only be defined as G_TYPE_UINT in the ListStore which is a 32-bit unsigned integer effectively.



    However, since I have to rely on the uint16 variable type, I tried to circumvent the issue by wrapping it in a GVariant.



    Works so far. The weird behaviour is fixed this way. However, now I have issues to display these values in a TreeView. When starting the application I get the following error message:




    GLib-GObject-WARNING **: unable to set property 'text' of type 'gchararray' from value of type 'GVariant'




    Here the code how the GtkListStore is defined and filled with the GVariant:



    static void set_initial_value(void)

    GtkTreeIter iter;
    GVariant *gv_uint16;

    if (store == NULL)
    store = gtk_list_store_new(1, G_TYPE_VARIANT);


    gv_uint16 = g_variant_new_uint16((guint16)42);

    gtk_list_store_append(store, &iter);
    gtk_list_store_set(store, &iter, 0, gv_uint16, -1);




    And here is how the column in the TreeView is defined:



     renderer = gtk_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes("Number", renderer,
    "text", 0, NULL);

    gtk_tree_view_column_set_sort_column_id(column, 0);
    gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);


    Does someone have an idea how to display this GVariant value in the TreeView?
    Thanks.










    share|improve this question
























      0












      0








      0








      I have the challenge to store and later read values from type uint16 in a GtkListStore. This GtkListStore is also used as a model for a GtkTreeView and the uint16 value shall also be displayed as a column.



      I've troubleshooted weird behaviour until I found out, the issue is due to passing a guint16 variable to gtk_tree_model_get() which can only be defined as G_TYPE_UINT in the ListStore which is a 32-bit unsigned integer effectively.



      However, since I have to rely on the uint16 variable type, I tried to circumvent the issue by wrapping it in a GVariant.



      Works so far. The weird behaviour is fixed this way. However, now I have issues to display these values in a TreeView. When starting the application I get the following error message:




      GLib-GObject-WARNING **: unable to set property 'text' of type 'gchararray' from value of type 'GVariant'




      Here the code how the GtkListStore is defined and filled with the GVariant:



      static void set_initial_value(void)

      GtkTreeIter iter;
      GVariant *gv_uint16;

      if (store == NULL)
      store = gtk_list_store_new(1, G_TYPE_VARIANT);


      gv_uint16 = g_variant_new_uint16((guint16)42);

      gtk_list_store_append(store, &iter);
      gtk_list_store_set(store, &iter, 0, gv_uint16, -1);




      And here is how the column in the TreeView is defined:



       renderer = gtk_cell_renderer_text_new();
      column = gtk_tree_view_column_new_with_attributes("Number", renderer,
      "text", 0, NULL);

      gtk_tree_view_column_set_sort_column_id(column, 0);
      gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);


      Does someone have an idea how to display this GVariant value in the TreeView?
      Thanks.










      share|improve this question














      I have the challenge to store and later read values from type uint16 in a GtkListStore. This GtkListStore is also used as a model for a GtkTreeView and the uint16 value shall also be displayed as a column.



      I've troubleshooted weird behaviour until I found out, the issue is due to passing a guint16 variable to gtk_tree_model_get() which can only be defined as G_TYPE_UINT in the ListStore which is a 32-bit unsigned integer effectively.



      However, since I have to rely on the uint16 variable type, I tried to circumvent the issue by wrapping it in a GVariant.



      Works so far. The weird behaviour is fixed this way. However, now I have issues to display these values in a TreeView. When starting the application I get the following error message:




      GLib-GObject-WARNING **: unable to set property 'text' of type 'gchararray' from value of type 'GVariant'




      Here the code how the GtkListStore is defined and filled with the GVariant:



      static void set_initial_value(void)

      GtkTreeIter iter;
      GVariant *gv_uint16;

      if (store == NULL)
      store = gtk_list_store_new(1, G_TYPE_VARIANT);


      gv_uint16 = g_variant_new_uint16((guint16)42);

      gtk_list_store_append(store, &iter);
      gtk_list_store_set(store, &iter, 0, gv_uint16, -1);




      And here is how the column in the TreeView is defined:



       renderer = gtk_cell_renderer_text_new();
      column = gtk_tree_view_column_new_with_attributes("Number", renderer,
      "text", 0, NULL);

      gtk_tree_view_column_set_sort_column_id(column, 0);
      gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);


      Does someone have an idea how to display this GVariant value in the TreeView?
      Thanks.







      c gtk3






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 9 at 9:18









      AlexAlex

      183




      183






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075795%2fdisplay-gvariant-in-gtktreeview%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075795%2fdisplay-gvariant-in-gtktreeview%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко