[Glade-users] Adding entries to agtkcomboboxentry



I hope I do this right, first time mailing list user :)

I'm designing an app with glade and is going to use a gtkcomboboxentry as a
command input+command history part = The user edits the command in the
"entry" part and when he/she presses enter the command gets executed and
gets prepended in the history (popup menu part of the comboboxentry)

How would I go on about prepending the neew command as a new row in the
menu?
I searched the gtk reference manual and found the function
"gtk_combo_box_append_text"
But when running the program with that command I get the errors

(<unknown>:21581): Gtk-CRITICAL **: gtk_combo_box_append_text: assertion
`GTK_IS_LIST_STORE (combo_box->priv->model)' failed

There is a note attached to the gtk reference saying

"Note that you can only use this function with combo boxes constructed with
gtk_combo_box_new_text()."

Could that be the problem?, that glade doesn't create the widget with that
function?
If I choose export and look in the c source there is the following part in
the interface.c file:

  combo_result = gtk_combo_box_new_text ();

So that shouldn't be the case should it?

However, I am using glade through the glade-xml library and using the xml
file and not the c source, could it be
that the library generates/inits widgets differently?

My crack at it:
The widget data seems to be stored in a gtktreemodel, a widget I know
nothing
about, but which seems to have some append/prepend functions, only that
they Invoke a third widget adding to the confusion.

I would need help on understanding how to accomplish the above.

Another person had a similar question:
http://lists.ximian.com/pipermail/glade-users/2004-October/002215.html
and got this answer:

Look at the code for gtk_combo_box_new_text(). You just have to set upthe
combo in a similar way and append_text() will work fine.
That would be in the gtk source wouldn't it? If so how would I obtain it,
find the special part, etc?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20060205/fd3b0a88/attachment.html



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