Web lists-archives.com

Re: Combobox and columns




Hi Axel,

How do you want to change the list column combo in your program?

If you use a combo2 box row to change a combo1 box column from a list you might have a "changed" callback that looks something like the following.

Eric

...
GtkCellRenderer *renderer=NULL;
...
renderer=gtk_cell_renderer_text_new();
...
static void change_column(GtkComboBox *combo2, GtkComboBox *combo1)
  {
    gint row=gtk_combo_box_get_active(combo2);
    gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo1), GTK_CELL_RENDERER(renderer), "text", row, NULL);
    gtk_widget_queue_draw(GTK_WIDGET(combo1));
  }



-----Original Message-----
From: axel <axel.voges@xxxxxxxxxx>
To: gtk-list <gtk-list@xxxxxxxxx>
Sent: Sun, Apr 2, 2017 6:39 am
Subject: Combobox and columns

Have a liststore with 4 columns. And a combobox with a cellrenderer.
UI made with Glade. Programm is written in C.

How to choose one of the columns out of the liststore to use/show in the
combobox?
I can set in Glade the actual column but I need it to be done on runtime.



Cheers,
Axel

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list