[Gambas-user] File opening dialog and one more question

Caveat Gambas at ...1950...
Thu Jan 5 13:04:08 CET 2012


Part one

I never really looked into how GTK-alike the FileChooser was, but it
didn't seem to 'fit' on my regular forms, so I just made a small Form
which handles file choosing/opening and raises the appropriate events.

To answer part two...

As I understand it, static variables exist only once for the class
regardless of how many instances of the class you have in memory.
Non-static variables exist per instance of the class.

A static variable that's not defined as a Const can be a little
dangerous (or at least confusing), as anyone changing the value on a
particular instance of the class changes it for all other instances of
that class too (as there is only one 'copy' of the variable).  Const
implies static...so the static keyword is optional when defining a
const.

As an example, you might have a CurrencyConverter class which defines
Euro to Belgian Francs as a static const set to 40.3333, UKP to US$ as
static (but not const... so changing it on one instance of
CurrencyConverter will change it for all instances), and the amount to
convert as non-static, non-const... hope that example made some sense!

Regards,
Caveat


On Thu, 2012-01-05 at 12:35 +0100, M. Cs. wrote:
> Hi,
> in G2 we had a file opening dialog which was identical as KDE's native
> one. It seems to be removed, or am I wrong? I would like to have that
> old one. It's more convenient with the system-wide bookmarks etc.
> 
> And the question: I don't understand the STATIC word's meaning. Is it
> given to define a constant inside a class? What's the practical usage
> of it? I have to redesign my Gambas project, and I need to know the
> exact usage. The documentation didn't make it clear to me. I Know what
> Public and what Private is. Thanks!
> 
> Csaba
> 
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual 
> desktops for less than the cost of PCs and save 60% on VDI infrastructure 
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user






More information about the User mailing list