Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-04

TEdit, TProgress

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

UAB Diprintas

Hi, all!

See, I have a BIG trouble with TProgress: when my program is COPYING some file, and I
wanna to show for user how many bytes (percent) is away ;) -- progress is like died and window (widget, form...) is completely FROZED, while process. :-(

Here is example (for understanding only):

...
someform_with_progress.show;
...
while not eof(somefile) do
    begin
       read(somefile,someblock);
//       inc(myprogress.position);  -- here error :-(
         myprogress.position:=myprogress.position+1;  // ughhh... Pascal...
Why not '+=' ?
// So here POSITION must RUN,
// buddy... window is completely
// FROZED, until EOF :-(
// On Delphi4 this code-example is working OK.
      write(some_another_file,someblock);
    end;
// someform_with_progress.hide; -- error, coz` I can't to hide a widget :-(
someform_with_progress.close;

So.... What I can to do?
Another trouble: TEdit.OnChange -- is compilling without errors, but... it's NOT REAL
event. It's just... nothing happend... :-(

Reply by email

codepunk
to UAB Diprintas

Don't have time to track this one just yet but will have a look tonight. The problem is that you will hang if not forcing a refresh on the component. TComponent.refresh should probably be calling the main event loop force. This would eliminate his problem.

myprogress.refresh; -> call tcomponent refresh which forces the event loop.

He is hanging because the GTK event loop is not getting called while he is executing.

Cliff

UAB Diprintas wrote 48 lines
Hi, all! See, I have a BIG trouble with TProgress: when my program is COPYING some file, and I wanna to show for user how many bytes (percent) is away ;) -- progress is like died and window (widget, form...) is completely FROZED, while process. :-( Here is example (for understanding only): ... ssomeform_with_progress.show; ... wwhile not eof(somefile) do begin read(somefile,someblock); // inc(myprogress.position); -- here error :-( myprogress.position:=myprogress.position+1; // ughhh... Pascal... Why not '+=' ? // So here POSITION must RUN, // buddy... window is completely // FROZED, until EOF :-( // On Delphi4 this code-example is working OK. write(some_another_file,someblock); end; // someform_with_progress.hide; -- error, coz` I can't to hide a widget :-( someform_with_progress.close; So.... What I can to do? Another trouble: TEdit.OnChange -- is compilling without errors, but... it's NOT REAL event. It's just... nothing happend... :-( _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

HAve you tried putting an
Appication.ProcessMessages;
within your loop? Currently this will slow you down a bit but it should (may) work. Shane

>> 04/18/00 02:34AM >>>

Hi, all!

See, I have a BIG trouble with TProgress: when my program is COPYING some file, and I
wanna to show for user how many bytes (percent) is away ;) -- progress is like died and window (widget, form...) is completely FROZED, while process. :-(

Here is example (for understanding only):

...
someform_with_progress.show;
...
while not eof(somefile) do
    begin
       read(somefile,someblock);
//       inc(myprogress.position);  -- here error :-(
         myprogress.position:=myprogress.position+1;  // ughhh... Pascal...
Why not '+=' ?
// So here POSITION must RUN,
// buddy... window is completely
// FROZED, until EOF :-(
// On Delphi4 this code-example is working OK.
      write(some_another_file,someblock);
    end;
// someform_with_progress.hide; -- error, coz` I can't to hide a widget :-(
someform_with_progress.close;

So.... What I can to do?
Another trouble: TEdit.OnChange -- is compilling without errors, but... it's NOT REAL
event. It's just... nothing happend... :-(

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

Thinking about this on the way to work. It should be a easy fix by placing a processing in the interface unit. If the application terminate gets called turn
the processing flag to false. Place a line int intsendmessage that exits if the flag
is false that should make things on shutdown a little safer.

Cliff Baeseman

Earlier message 79 lines
-----Original Message----- From: codepunk Sent: Tuesday, April 18, 2000 1:08 PM To: Subject: Re: [lazarus] TEdit, TProgress Don't have time to track this one just yet but will have a look tonight. The problem is that you will hang if not forcing a refresh on the component. TComponent.refresh should probably be calling the main event loop force. This would eliminate his problem. myprogress.refresh; -> call tcomponent refresh which forces the event loop. He is hanging because the GTK event loop is not getting called while he is executing. Cliff On Tue, 18 Apr 2000, UAB Diprintas wrote: > Hi, all! > > See, I have a BIG trouble with TProgress: when my program is COPYING some > file, and I > wanna to show for user how many bytes (percent) is away ;) -- progress is > like died and window (widget, form...) is completely FROZED, while process. > :-( > > Here is example (for understanding only): > > ... > ssomeform_with_progress.show; > ... > wwhile not eof(somefile) do > begin > read(somefile,someblock); > // inc(myprogress.position); -- here error :-( > myprogress.position:=myprogress.position+1; // ughhh... Pascal... > Why not '+=' ? > > // So here POSITION must RUN, > > // buddy... window is completely > > // FROZED, until EOF :-( > > // On Delphi4 this code-example is working OK. > write(some_another_file,someblock); > end; > > // someform_with_progress.hide; -- error, coz` I can't to hide a widget :-( > someform_with_progress.close; > > > So.... What I can to do? > Another trouble: TEdit.OnChange -- is compilling without errors, but... it's > NOT REAL > event. It's just... nothing happend... :-( > > > > > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

codepunk
to Shane Miller: HAve you tried putting an Appication.ProcessMessages; within your loop? Currently this…

Oh It is already there disreguard my last.

Cliff

Shane Miller wrote 60 lines
HAve you tried putting an Appication.ProcessMessages; within your loop? Currently this will slow you down a bit but it should (may) work. Shane >>> 04/18/00 02:34AM >>> Hi, all! See, I have a BIG trouble with TProgress: when my program is COPYING some file, and I wanna to show for user how many bytes (percent) is away ;) -- progress is like died and window (widget, form...) is completely FROZED, while process. :-( Here is example (for understanding only): ... ssomeform_with_progress.show; ... wwhile not eof(somefile) do begin read(somefile,someblock); // inc(myprogress.position); -- here error :-( myprogress.position:=myprogress.position+1; // ughhh... Pascal... Why not '+=' ? // So here POSITION must RUN, // buddy... window is completely // FROZED, until EOF :-( // On Delphi4 this code-example is working OK. write(some_another_file,someblock); end; // someform_with_progress.hide; -- error, coz` I can't to hide a widget :-( someform_with_progress.close; So.... What I can to do? Another trouble: TEdit.OnChange -- is compilling without errors, but... it's NOT REAL event. It's just... nothing happend... :-( _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email