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

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved