ComboBox on Windows application

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ComboBox on Windows application

straygrey
I have a screen already built using Glade and a whole bunch of code that
now needs maintaining.
Is it recommended that I carry on using Glade?
Glade has built an interface.c that I now need to alter to get a
combobox to display a number of entries I will retrieve from a SQL
database, however a comment at the top of interface.c says  "DO NOT EDIT
THIS FILE - it is generated by Glade".
Recommendations please.

--
---

Regards,
Alf Stockton www.stockton.co.za

Let us live!!!
Let us love!!!
Let us share the deepest secrets of our souls!!!

You first.


_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: ComboBox on Windows application

Hubert Sokolowski
On Tue, 07 Jun 2005 15:09:36 +0200
Alf Stockton <[hidden email]> wrote:

> I have a screen already built using Glade and a whole bunch of code
> that
> now needs maintaining.
> Is it recommended that I carry on using Glade?
> Glade has built an interface.c that I now need to alter to get a
> combobox to display a number of entries I will retrieve from a SQL
> database, however a comment at the top of interface.c says  "DO NOT
> EDIT
> THIS FILE - it is generated by Glade".
you don't edit interface.c. create window with function generated by
glade, get pointer to combobox widget with lookup_widget and then add
entries.
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: ComboBox on Windows application

Maciej Katafiasz
In reply to this post by straygrey
Dnia 07-06-2005, wto o godzinie 15:09 +0200, Alf Stockton napisaƂ:
> I have a screen already built using Glade and a whole bunch of code that
> now needs maintaining.
> Is it recommended that I carry on using Glade?
> Glade has built an interface.c that I now need to alter to get a
> combobox to display a number of entries I will retrieve from a SQL
> database, however a comment at the top of interface.c says  "DO NOT EDIT
> THIS FILE - it is generated by Glade".
> Recommendations please.

As usual, for future mainteinance ease, it's strongly recommended you
convert your app to libglade -- this ensures you will never again have
such a dillemma.

Cheers,
Maciej

--
Maciej Katafiasz <[hidden email]>

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: ComboBox on Windows application

Gus Koppel
In reply to this post by straygrey
Alf Stockton wrote:

> I have a screen already built using Glade and a whole bunch of code
> that now needs maintaining.
> Is it recommended that I carry on using Glade?

There are no alternatives for GTK+, except if you're willing to code
either C source or XML by hand to design your GUI.

> Glade has built an interface.c that I now need to alter to get a
> combobox to display a number of entries I will retrieve from a SQL
> database, however a comment at the top of interface.c says  "DO NOT
> EDIT THIS FILE - it is generated by Glade".
> Recommendations please.

You don't need to alter interface.c. You NEVER need to! interface.c is
just a read-only blueprint of your GUI. It mainly describes what widgets
and windows there are and how they are layouted. As a convenience
option, Glade allows to populate combo boxes and option menus with some
predefined list items. This feature should be used for simple and
constant lists of items only, though. Don't use it for combo boxes which
are to receive changed content frequently.

If you use old compatible GtkCombo, gtk_combo_set_popdown_strings () is
what you're looking for. For newer GtkComboBox (since GTK+ 2.4) a bunch
of functions starting with gtk_combo_box_append_text () is what you can
use. Have a look at the respective class descriptions in the GTK+ API
docs. There you'll also find methods to delete contents from combo boxes
prior to refilling them again with new database result items.

manipulate your GtkCombo(Boxe)s either in any of your callback functions
in callback.c or, even better, in any of your own source files. But
never edit interface.c, indeed! You never need to.
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list