Re: Problems with GtkComboBoxEntry



On Tue, 2004-10-05 at 14:17, Carlo Agrusti wrote:
Yes, I am (at least in the beginning); but this behaviour does not
depend on Glade. Glade can use both gtk_combo_box_entry_new and
gtk_combo_box_entry_new_text, choosing the former if you don't enter a
list of selections and the latter if you do. In the first case
(gtk_combo_box_entry_new) there is no way to set a model for the
combo_box_entry; by using gtk_combo_box_entry_new_text things go fine,
and you can set a new model for the widget (of course destroying the
original set of selections) and this is the workaround I am currently using.

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? 

-- 
Regards,
Martyn



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