Re: Problems with GtkComboBoxEntry





Martyn Russell ha scritto lo scorso 05/10/2004 17:45:

If you use the following code:

        gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo_box));

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

        renderer = gtk_cell_renderer_text_new ();
        gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
        gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
                                        "text", 0,
                                        NULL);
gtk_cell_layout_reorder (GTK_CELL_LAYOUT (combo_box), renderer, 0); does it make any difference?

With this code added after the call to gtk_combo_box_entry_set_model the combo box (created with gtk_combo_box_entry_new) displays correctly all entries described by the model (both with and without a gtk_cell_layout_reorder call). Is the use of the cell renderer mandatory for this kind of combo box manipulation?



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