On 7/2/07, Stefan de Konink <[EMAIL PROTECTED]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Hi,
>
>
> I wrote my own 'chart' implementation for date's so it can be used as
> planboard.
>
> http://uva.hobby-site.com/~skinkie/chart.jpg
>
>
> Now this is all very great (Cairo), but it uses libxml2 to store the
> data, and reads it in as a GList, so as you might understand *this is
> not very flexible*.
>
> I would like to extend the widget to use a database with a specific
> representation. For example an id,julian,julian thing. Now I wonder what
> is the best way to implement this. When I look at some basic widgets
> like combo's they are in essence gtk+gda, so it should be relatively simple.

Right. Using a libgda data model with 3 columns as id, date_start,
date_end would probably be a good representation. However, it would
add another dependency...

>
> The same data should be made available in a 'grid' so people can look at
> the data in two different representations. So I would just perform read
> operations to render the widget and write operations on 'drops' and new
> 'instances'.

Yes, your widget can alter the data model (insert new rows, update
some rows, and delete some) and then that modified data model can be
saved to an XML file for example, or if it maps to a SELECT statement
(and it's modifyable), then the modifications can be stored directly
in the database.

>
>
>
> ...but I wonder, is anything in the gnome-db widgets 'cached' and is
> there any way to receive a signal from the database to 'update' a view?
> (Maybe this is sample_changed?)

Any data set in Libgda is represented as a GdaDataModel object (the
real implementation varies depending on its real/extra features). For
example there is a data model to read data from a CSV or XML file, and
data models which are generated when a SELECT statement is executed.

Anyway, there is a data model called GdaDataProxy which allows one to
"group" modifications to be done on a data model and apply them all at
once.

>
> I want my final application to be used across different computers and I
> I currently tested with the demo application if something change if I
> added stuff between instances there was no update in the other. Is this
> a feature that is available in the bigger databases such as PostgreSQL
> or isn't any widget implemented so it can receive live updates? (Or poll
> for updates?)

There is no API to be notified of data modification within a database,
you have to do some polling for that purpose (I'm not aware of any
DBMS's API which offers such a feature.)

Regards,

Vivien
_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list

Reply via email to