[Gambas-user] Showing the Form's Gui

Doriano Blengino doriano.blengino at ...1909...
Tue Apr 13 12:50:26 CEST 2010


richard terry ha scritto:
> Often with forms one wants to start some processing after the form has loaded 
> - in my case, as my app is quite database intensive, it could involve loading 
> sometimes quite large amounts of data.
>
> I'd ideally like to have the form load visually, and then the data loading to 
> take place once the form is visible to the user, but if one includes this 
> loading in the usual events of _new, show() , then the gui-dosn't appear until 
> after the database loading and putting a Wait command before the processing 
> starts dosn't seem to help.
>
> Any idea's how to put this sort of activity into the background so the gui 
> appears instantly to the user.
>   
I found that a good solution is to use a timer: any short delay is good 
(50 ms?). You activate the timer in the show() event and, in the timer 
event, you disable it and proceed with the lenghty operations.

Regards,
Doriano





More information about the User mailing list