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



On Thu, 3 Feb 2000, Rodrigo Moya Piernavieja wrote:

> Great! Specially since the programs in the testing directory are
> somewhat out-of-date. You should better base your examples in the fe
> application, which is the most complete (and up-to-date) sample code.
> 

Thanks - I've been bouncing back and forth between gda-ui-test2 and fe. I
started out with something that looked more like gda-ui-test2, but now it
looks more like fe :-)

 > 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).

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.

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

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).

Regards,

Brian Jepson * (bjepson@ids.net)  *  http://users.ids.net/~bjepson



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