Re: libglade+gnome-db example (was Re: Connecting by data source?)



Hi!

>  > I'll answer to the questions in the code shortly.
> >
> > And all the work you get done with gnome-db+libglade will be very useful for
> > the gda-builder app, which will use libglade. So please keep us informed on
> > this.
>
> Sure thing - I have a snapshot of a program up at:
>
>    www.as220.org/~bjepson/gnome-db/db_login.tar.gz
>
> It does the following:
>
>    1) pops up a login dialog
>    2) makes a connection
>    3) loads a simple user interface from a .glade file, which includes a
>       custom widget that is a gnome-db-combo object (whoohoo!)
>
> I'm currently struggling with the gnome-db-combo object - I was expecting
> the underlying recordset to be positioned on the selected list item, but
> it doesn't seem to do this (if the program runs for you, try selecting a
> few different items and clicking OK).
>

I didn't think of this, but it's a great idea, only, I don't know right now how
difficult it will be. I'll have a look.

>
> You'll see that there are files called table_combo.[ch] - this is a first
> step towards a reusable combo object that takes a table, label column, and
> id column as an argument - My goal is to create a recordset with a name
> and id field, have the combo display the name, and then be able to figure
> out the id without having to "SELECT id FROM table WHERE name =
> selected_name_in_combo_box".
>
> I'm going to read up on GtkCombo and GtkList, and see if I can figure out
> how to find the selected index (which I can then use to reposition the
> recordset). But, if anyone has any insight into this problem, I'd
> appreciate any suggestions.
>

I'm not very sure of this (so check it), but I think you can retrieve the
GtkCombo's list selection, which is done like this:

GList* selected = GTK_LIST(GTK_COMBO(combo)->list)->selection;
guint index = GPOINTER_TO_UINT(selected->data);

>
> Also, feel free to add this example to the CVS archive, if you think it is
> helpful.
>

Ok

>
> One last note - I have tested this with a build of gnome-db that was fresh
> as of Jan 31, so I may be out of sync with the rest of you (I'm planning
> to do a fresh build out of CVS this weekend).

There were no very important changes from this date, the only thing, which is
committed today, is the username stuff we talked about yesterday.

Cheers



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