how get child Widget in gtk table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi 
i am using gtktable for display datatype and datvalue. my data type is not
constant so i using gtktable because it resizing functionality. after adding  
Widget in table how can i get value from these Widget
my code is
table = glade_xml_get_widget (edit_xml, "table");
  gtk_table_resize (GTK_TABLE (table), en->EntriesNum + 2, 2);

  for (i = 0; i < en->EntriesNum; i++)
    {
      combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL
(entry_type));
      gtk_table_attach (GTK_TABLE (table), combo_box, 0, 1, i + 4, i + 5,
			GTK_FILL, GTK_FILL, 0, 0);

      renderer = gtk_cell_renderer_text_new ();
      gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer,
				  FALSE);
      gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
				      "text", 0, NULL);

      gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box),
				en->Entries[i].EntryType - 1);
      
      
      switch (en->Entries[i].EntryType)
	{
	case PBK_Caller_Group:
          //TODO not setting corret group number
	  entry = gtk_spin_button_new (spinner_adj, 1, en->Entries[i].Number);
	  break;
	case PBK_CallLength:
	  sprintf (buffer, "%02i:%02i:%02i",
		   en->Entries[i].CallLength / (60 * 60),
		   en->Entries[i].CallLength / 60,
		   en->Entries[i].CallLength % 60);
	  entry = gtk_entry_new ();
	  gtk_entry_set_text (GTK_ENTRY (entry), buffer);
	  break;
	case PBK_Date:
	  entry = gtk_entry_new ();
	  gtk_entry_set_text (GTK_ENTRY (entry),
			      OSDateTime (en->Entries[i].Date, false));
	  break;
	case PBK_LastModified:
	  entry = gtk_entry_new ();
	  gtk_entry_set_text (GTK_ENTRY (entry),
			      OSDateTime (en->Entries[i].Date, false));

	  break;
	case PBK_Category:
	  entry = gtk_entry_new ();
	  if (en->Entries[i].Number == -1)
	    {

	      number =
		g_convert (DecodeUnicodeConsole (en->Entries[i].Text), -1,
			   "UTF-8", "ISO-8859-2", NULL, NULL, NULL);
	      gtk_entry_set_text (GTK_ENTRY (entry), number);
	    }
	  break;
	case PBK_Private:
	  entry = gtk_combo_box_new_text ();
	  gtk_combo_box_append_text (GTK_COMBO_BOX (entry), "Yes");
	  gtk_combo_box_append_text (GTK_COMBO_BOX (entry), "No");
	  gtk_combo_box_set_active (GTK_COMBO_BOX (widget),
				    en->Entries[i].Number == 1 ? 0 : 1);
	  break;
	case PBK_PictureID:
	  entry =
	    gtk_spin_button_new (spinner_adj, 1.0, en->Entries[i].Number);
	  break;
	case PBK_RingtoneID:
	  entry = gtk_entry_new ();
	  break;
	default:
	  entry = gtk_entry_new ();

	  number =
	    g_convert (DecodeUnicodeConsole (en->Entries[i].Text), -1,
		       "UTF-8", "ISO-8859-2", NULL, NULL, NULL);
	  gtk_entry_set_text (GTK_ENTRY (entry), number);

	}
      gtk_table_attach (GTK_TABLE (table), entry, 1, 2, i + 4, i + 5,
			GTK_EXPAND, GTK_FILL, 0, 0);
      
      gtk_widget_show (combo_box);
      gtk_widget_show (entry);
      
	        
    }

sorry for my bad english
-- 
View this message in context: http://www.nabble.com/how-get-child-Widget-in-gtk-table-tf4966054.html#a14225826
Sent from the Gtk+ - General mailing list archive at Nabble.com.

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

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux