On Thu, 22 Feb 2001, Rodrigo Moya wrote:
> > > I'm not sure neither about this. We should find a way to have this automatically
> > > specified when designing in Glade. Maybe we could add properties to the widget
>(in
> > > Glade) to specify the GDA data soource to use, username and password. And then,
>have
> > > the GnomeDbBrowser-related code in Glade, open the connection when created.
> >
> > I have started to do so, but run out of ideas for creating the source.
> > It needs a Gda_Connection for creating a new gnome_db_browser widget. I
> > guess it's not a good idea to write it like this:
> >
> > source_add (data, "Gda_Connection *cnc;\n");
> > source_add (data, "cnc = cnc = gda_connection_new(bonobo_orb());\n");
> > ...
>
> please, DON'T use bonobo_orb, use gda_corba_get_orb instead.
>
thanks for the tip :)
> >
> > ...
> > source_add (data, " %s = gnome_db_browser_new (cnc);\n", data->wname);
> >
>
> yes, but before the call to gnome_db_browser_new, I'd add:
>
> source_add(data, "gda_connection_open(cnc, $dsn, $user, $password);");
>
> where $dsn, $user and $password are the properties specified by the user when
>designing
> the screen from glade.
>
> BTW, I'd also add, if that makes sense, a property to specify whether we want this
>code
> for opening the connection or not. Since there are cases when people would prefer to
>add
> that code themselves (say, in the main function, for example, before opening the
>screen
> designed by glade).
>
> On the other hand, yesterday I talked with Damon about this, and maybe it could be a
>good
> idea to do something similar to what Visual Basic does (or did in the version I used
>some
> years ago) for this: we could add an invisible widget (let's call it
>GnomeDbDataControl),
> which contains all the info needed to open the connection. And then, you create
> data-bound widgets (GnomeDbGrid, GnomeDbBrowser, etc) which have a property to
>indicate
> the name of a GnomeDbDataControl widget associated with it. Thus, the code for
>opening
> the connection is only generated for the GnomeDbDataControl widget, and the other
>widgets
> just use that.
>
> Do you like that idea?
Yeah, that's exaclty what I was looking for. With GnomeDbDataControl, it
would be much more easier to write the code and controling GnomeDb.
wagi
--
Daniel Wagner
email: [EMAIL PROTECTED]
GnuPG: 1024D/DCDE890A (public key available on any keyserver)
_______________________________________________
Glade-devel maillist - [EMAIL PROTECTED]
http://lists.helixcode.com/mailman/listinfo/glade-devel