[Gambas-user] edits not saving
Bruce Steers
bsteers4 at gmail.com
Mon Aug 22 13:55:21 CEST 2022
On Sun, 21 Aug 2022 at 17:39, Bruce Steers <bsteers4 at gmail.com> wrote:
>
>
> On Sun, 21 Aug 2022 at 11:55, Bruce Steers <bsteers4 at gmail.com> wrote:
>
>>
>>
>> On Sat, 20 Aug 2022 at 15:43, Benoit Minisini <
>> benoit.minisini at gambas-basic.org> wrote:
>>
>>> Le 20/08/2022 à 11:25, Bruce Steers a écrit :
>>> >
>>> >
>>> > On Sat, 20 Aug 2022 at 10:08, Bruce Steers <bsteers4 at gmail.com
>>> > <mailto:bsteers4 at gmail.com>> wrote:
>>> >
>>> > Anyone else getting little edits of a file are not saving?
>>> >
>>> > Ie, maybe removing a line or commenting out a line. the file does
>>> > not get its "changed" flag set so it does not save.
>>> >
>>> > So I've been pressing returns then delete to make a modification
>>> > that does make it seen as changed, then it saves as expected.
>>> >
>>> >
>>> > PS. this only seems to happen when a project first loads.
>>> > Ie...
>>> > Load up project, comment out a line with a '
>>> > The Title in the tab does not get an asterisk * and file will not save
>>> > changes.
>>> > Press delete to delete the comment char and the asterisk appears.
>>> > Save file now works...
>>> > Then comment out the line again and the asterisk DOES appear and all
>>> is
>>> > working as expected from now on.
>>> >
>>> > Respects
>>> > BruceS
>>> >
>>>
>>> It should be fixed by the last commit (some code I forgot to commit).
>>>
>>
>> Does the change event get raised on load even if the object is locked
>> because suddenly my text editor is telling me i've changes text when i
>> haven't.
>> Respects
>> BruceS
>>
>
> If i change line 1584 of CDocument.class in gb.form.editor to....
>
> If Not Object.IsLocked(hView) Then hView._RaiseChange
>
> Then my editor works okay again.
>
> I tried to make my editor not get the change event on load but could not.
> changing the CDocument.class worked though.
>
I managed to fix my editor by adding a Wait 0.1 after the file load to
clear the Changed event out of the event loop.
Seemed no matter what i did to set my own changed flag to false on load the
editors Changed event fired afterwards.
Using Wait fixed it.
I'm going back a few years but i remember VB had a DoEvents() method that
let the event loop run while in an event handler.
can Wait be considered the same?
I've sometimes found using Wait on it's own without 0.1 has caused a
program lock up but using a time fraction very much works like DoEvents()
If the Answer is "No you should not really use Wait like that" (Ben you've
often mentioned i have used Wait where i should not) then can we get a
DoEvents() function?
Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220822/ffa32056/attachment.htm>
More information about the User
mailing list