Get the selected text from GTK3 ComboBox in C
<p>I'm only starting to learn GTK3, but I'm having a real struggle. All of the documentation that i could find is for GTK2 and the gnome dev web site is simply not good enough. 
Now I am trying to get the selected text/item from a GtkComboBox, here is some of the code which I have tried.</p>

<pre><code>  gint array =gtk_combo_box_get_active(cbox_quaity);
  //or 
  gchar *array =gtk_combo_box_get_active(cbox_quaity);
</code></pre>

<p>If i use the gint, the printout will be "0" (zero) no matter what itom of the list I select. If I use gchar, I get back "(null)". In addition, I get these warnings while compiling.</p>

<pre><code>gcc -c -g -O0 -Wall -pthread -pipe src/main.c `pkg-config --cflags --libs gtk+-3.0` -o main.o
src/main.c: In function ‘btn_start_click’:
src/main.c:41:17: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   gchar *array =gtk_combo_box_get_active(cbox_quaity);
                 ^~~~~~~~~~~~~~~~~~~~~~~~
gcc -o tstreamer-gtk main.o -pthread `pkg-config --cflags --libs gtk+-3.0` -export-dynamic
</code></pre>

<p>The user interface was created in glade and the combo box used a GtkListStore. Also, here is the source code of the C code:</p>

<pre><code>#include &lt;gtk/gtk.h&gt;
#include &lt;stdio.h&gt;

GtkWidget *btn_start;
GtkComboBox *cbox_quaity;
#define MAX_WORD_SIZE 32

void btn_start_click(){

  gint active_item = gtk_combo_box_get_active(cbox_quaity);
  printf("%d\n",active_item);
}

int main(int argc, char *argv[]){

  GtkBuilder *builder;
  GtkWidget *window;

  gtk_init(&amp;argc, &amp;argv);

  builder = gtk_builder_new();
  gtk_builder_add_from_file (builder, "glade/window_main.glade", NULL);

  window = GTK_WIDGET(gtk_builder_get_object(builder, "window_main"));
  gtk_builder_connect_signals(builder, NULL);

  btn_start = GTK_WIDGET(gtk_builder_get_object(builder, "btn_start"));

  g_object_unref(builder);
  gtk_widget_show(window);
  gtk_main();
  return 0;
}

// called when window is closed
void on_window_main_destroy(){
  gtk_main_quit();
}
</code></pre>