RE: fetch and display data in the form of a table

2010-07-29 Thread Jeff Hallock
Take a look at the TreeView and related widgets.

From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On Behalf 
Of love nglory
Sent: Thursday, July 29, 2010 3:05 PM
To: gtk-list@gnome.org
Subject: fetch and display data in the form of a table

Hi everyone,

Is there any way I can display data in the form of a table in gtk.

Thank you
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Doubts about creating a new widget

2010-07-12 Thread Jeff Hallock
Hmmm…. I able to find one immediately by googling “gtk expander screenshot”. 
Who’d a thought…

You can also always give it a try yourself…


From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On Behalf 
Of CaStarCo
Sent: Monday, July 12, 2010 2:46 PM
To: gtk-list@gnome.org
Subject: Re: Doubts about creating a new widget

Thanks Nicola :D ,

i haven't found any screenshot of GtkExpander widget, there is any screenshot 
in any place?

2010/7/12 Nicola Fontana mailto:n...@entidi.it>>
Il giorno Mon, 12 Jul 2010 14:19:12 +0200
CaStarCo mailto:casta...@gmail.com>> ha scritto:

> Hello, my name is Andreu and i'm new in this list.
>
> I have a doubt about if I should create a new widget or if there is a widget
> that could supply my needs.
>
> I'll describe what I need: I want to make a left column in the window with
> "flat" toggle buttons (with the 100% of the column width) that, when I press
> one of the buttons then the buttons that are below than it should go down to
> give space to a icon list with a vertical scroll bar.
>
> I need it to sort the elements in a diagram editor that i'm programming.
From what I understood, I'd use GtkExpander.

--
Nicola



--
- Per la llibertat del coneixement -
- Per la llibertat de la ment...   -
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: gtkcombobox with self internal code to the options

2010-06-24 Thread Jeff Hallock

You shall RTFM and try it out yourself.


-Original Message-
From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On Behalf 
Of John Williams
Sent: Thursday, June 24, 2010 2:08 PM
To: Tadej Borovšak
Cc: gtk-list@gnome.org
Subject: Re: gtkcombobox with self internal code to the options

Shall I beg?

2010/6/21 John Williams :
> Anyone?
>
> 2010/6/16 John Williams :
>> Other question, how can I set the active option? gtk_combo_box_set_active?
>>
>> 2010/6/16 John Williams :
>>> Yes Tadej, you understand perfectly.
>>>
>>> Thank you for the example!
>>>
>>> 2010/6/15 Tadej Borovšak :
 Hello.

 If I understand you correctly, you want to store name and ID of your
 field inside combo box and retrieve it when needed. If this is true,
 have a look at this snippet of code that demonstrates how to do this:

 ---
 #include 

 enum
 {
  COL_NAME,
  COL_ID,
  NO_COLS
 };

 static void
 cb_changed (GtkComboBox *combo)
 {
  GtkTreeIter   iter;
  GtkTreeModel *model;
  gint          id;
  gchar        *name;

  gtk_combo_box_get_active_iter (combo, &iter);
  model = gtk_combo_box_get_model (combo);
  gtk_tree_model_get (model, &iter, COL_NAME, &name, COL_ID, &id, -1);

  g_print ("Active selection: %s (id: %d)\n", name, id);
  g_free (name);
 }

 int
 main (int    argc,
      char **argv)
 {
  GtkWidget       *window,
                  *combo;
  GtkCellRenderer *cell;
  GtkListStore    *store;
  gint             i;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  g_signal_connect (window, "destroy", gtk_main_quit, NULL);

  store = gtk_list_store_new (NO_COLS, G_TYPE_STRING, G_TYPE_INT);
  for (i = 0; i < 10; i++)
    {
      GtkTreeIter iter;
      gchar       name[] = "Item  ";

      name[5] = '0' + i;
      gtk_list_store_append (store, &iter);
      gtk_list_store_set (store, &iter, COL_NAME, name,
                                        COL_ID, g_random_int (),
                                        -1);
    }

  combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
  g_signal_connect (combo, "changed", G_CALLBACK (cb_changed), NULL);
  gtk_container_add (GTK_CONTAINER (window), combo);

  cell = gtk_cell_renderer_text_new ();
  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE);
  gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), cell,
                                 "text", COL_NAME);

  gtk_widget_show_all (window);

  gtk_main();

  return 0;
 }
 --

 Tadej

 --
 Tadej Borovšak
 tadeboro.blogspot.com
 tadeb...@gmail.com
 tadej.borov...@gmail.com

>>>
>>
>
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list