Re: [gnome-db] Database widget
- From: "Vivien" <malerba gnome-db org>
- To: "Russell Shaw" <rjshaw iprimus com au>
- Cc: gnome-db-list gnome org
- Subject: Re: [gnome-db] Database widget
- Date: Fri, 27 Feb 2004 09:09:30 +0100 (CET)
> Hi,
> I need a widget like a gtk table that gets filled with
> data from an SQL database (postgresql), and has update/delete/add
> buttons on each row that can update the database after changing
> any data in the table cells (gtk entry or gtk label or gtk combobox).
>
> Is libmergeant suitable for this?
Yes, the MgWorkGrid widget does this. You just need to give it a MgQuery
object representing the SELECT query you use in the mg_work_grid_new() ,
and it will do all the work by itself.
The widget must the be "run" (where it will actually run the select query)
using the mg_work_widget_run() function (MgWorkGrid implements the
MgWorkWidget interface). The "mode" argument is an OR'ed list of
attributes which can be found in the mg-enums file.
There may still be some bugs, and so it's wiser if you put
MG_ACTION_ASK_CONFIRM_UPDATE | MG_ACTION_ASK_CONFIRM_INSERT |
MG_ACTION_ASK_CONFIRM_DELETE in the "mode" argument of
mg_work_widget_run(), so it will ask a confirmation of every query to be
sent to the DBMS before it is actually sent.
You can look in the extra/mg-db-browser.c file for smoe example.
Make sure you use the libmergeant sources which are included in the
mergeant CVS module, and not directly the liblergeant CVS module which is
out-dated and should be removed.
Cheer,
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]