[Gambas-user] Components and libraries and forms. Weird Sunday

Bruce bbruen at ...2308...
Mon Jun 18 12:41:14 CEST 2012


On Mon, 2012-06-18 at 12:19 +0200, Benoît Minisini wrote:
> Le 17/06/2012 12:59, Bruce a écrit :
> > No bugs or questions this time.  Just some observations.
> >
> > 1) Using a library that contains an exposed form.
> >
> > If a library exposes a form then when using that library in the IDE in
> > another project, I see a "magical" method called $Load is exposed.  I'm
> > not sure what this method is for, nor can I find it anywhere in the IDE
> > code.  But it does have a strange effect...
> >
> > In the client project
> >
> >    Dim myform as New LibraryForm1
> >    myform.$Load()
> >    myform.ShowDialog
> >
> > (where LibraryForm1 is the form exposed in the library)
> > results in a form with twice its' contents.  Strange.
> 
> '$load' is the method that creates the controls in a form. It is called 
> automatically from the constructor. So if you call it yourself, you have 
> twice the controls.
> 
Sounds fair enough.  I didn't explain properly, perhaps the attached
screenshot will help.  My question was aimed at its' appearance in the
autocomplete popup in the IDE.  (FAbout is a form in a library.)

> The name of this method may change at my will unexpectedly, so don't 
> rely on it. This is why it is not documented.

> >
> >
> > 2) Using a component that depends on a library
> >
> > I accidentally installed a project that was suppose to be a library as a
> > component today.  That all went well, but as you would expect the client
> > project falls over, "Can't find class blahblah etc."  The point being,
> > shouldn't there be some sort of rule somewhere that stops a project
> > being compiled (and therefore installed) as a component when it depends
> > on libraries?
> 
> I don't understand. Is it a component or not? And why shouldn't a 
> component depend on a library?
> 
We try not to elevate our libraries to component status until they are
well and truly "concrete stable", then they can go and live
in /usr/local/lib/gambas3 (and etc) quite legally. Until then they are
in a constant state of flux and live in /user/local/bin/phapps/ (which
is where our apps live, so there all the library dependencies are
resolved and we comply with the "libraries must be in the same directory
as the executable" rule.  That's all.  So when I accidentally made it a
component, it cannot find the dependant libraries, because they are
elsewhere.
No big problem.  I was just thinking.

Bruce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shot1.png
Type: image/png
Size: 43821 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20120618/a90e8517/attachment.png>


More information about the User mailing list