Article View: news.software.readers
Article #144278Re: [Dialog] help needed with scripts
From: matija
Date: Sat, 28 Feb 2004 21:56
Date: Sat, 28 Feb 2004 21:56
76 lines
4435 bytes
4435 bytes
MLC, completely geschtonkenflapped, wrote:
>> Program progressbar;
>
> This sounds a great idea!
> Nevertheless it seems odd to me that, wanting to test it inside timer2, the
> messagebox always gives 0 as progress bar position, even if it's started:
here's the problem:
> ADo('GetNewHeadersInSubscribedGroups');
> progressBarPosition := getProgressBarPosition(progressBarHWND);
> sleep (5000);
it takes some time until dialog starts downloading the headers.
move the sleep() function above getProgressBarPosition() and
you won't get 0 as the result (if dialog doesn't finish sooner
than those five seconds :))
> My last chance now is to try to check the progress bar position inside a
> loop in PostShow, as you suggested.
bleh, loops are bad. i think this is what you need:
- execute getNewHeadersInSubscribedGroups
- set "newHeaders" atom
- set a timer that runs every x seconds and checks the progressbar
- in this timer:
- if (PB position = 0) and (atom "newHeaders" exists)
- execute postShow
- delete "newHeaders" atom
hey, it seems that atoms will be useful after all! ;) here you use
one to indicate that there was an attempt to download new headers;
that is, to prevent the postShow form popping up every time the timer
fires. also, since you'll be checking the progressbar status in the
timer procedure, you won't get the postShow form if dialog still
isn't finished downloading new headers.
to recap:
timer1 (say, five minutes):
- get new headers
- set an atom to indicate that headers are downloaded (be sure to
check if it exists first - if it does, delete it! remember what
i said about atom dependencies, we don't want resource leaks...)
timer2 (say, five seconds):
- check progressbar position
- if it's 0 and the atom exists, it means that dialog has finished
downloading new headers, so...
- call postShow and delete the atom within it to indicate that
you have successfully shown your form
also, to be on the safe side, there should be some code in the
onShutdown event in the form of
myAtom = findAtom(myAtomName);
while (myAtom <> 0) do deleteAtom(myAtom);
maybe the same thing should be in timer1, or you can modify the
atom deletion procedure to automatically trash all of them.
i hope this works as intended...
> Thanks again for all your help and your time! :)
my pleasure :)
--
there is a cheer. the gnomes have learned a new way to say hooray. [-shpongle]
address is scrambled - remove the superfluous "x" marks to reply
Technical Details
Message-ID:
<s9iree27lg1t$.dlg@shpongle.604>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!npeer.de.kpn-eurorings.net!fu-berlin.de!CARNet.hr!not-for-mailReferences:
<1mops9bm8bjs5.dlg@ID-187316.user.uni-berlin.de> <16n122oojxuel$.dlg@shpongle.604> <nyglx8d9lyfk$.dlg@ID-187316.user.uni-berlin.de> <1140be4el222s$.dlg@shpongle.604> <h7ndcuuku3ty.dlg@ID-187316.user.uni-berlin.de> <1nhd691vntmkh$.dlg@shpongle.604> <14z3mc7uxnsf2.dlg@ID-187316.user.uni-berlin.de>Show Full Headers
Complete Article Headers
Message-ID: <s9iree27lg1t$.dlg@shpongle.604> Subject: Re: [Dialog] help needed with scripts Date: Sat, 28 Feb 2004 22:56:32 +0100 From: matija <xmkrnicx@xpublicx.xsrcex.hr> References: <1mops9bm8bjs5.dlg@ID-187316.user.uni-berlin.de> <16n122oojxuel$.dlg@shpongle.604> <nyglx8d9lyfk$.dlg@ID-187316.user.uni-berlin.de> <1140be4el222s$.dlg@shpongle.604> <h7ndcuuku3ty.dlg@ID-187316.user.uni-berlin.de> <1nhd691vntmkh$.dlg@shpongle.604> <14z3mc7uxnsf2.dlg@ID-187316.user.uni-berlin.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!npeer.de.kpn-eurorings.net!fu-berlin.de!CARNet.hr!not-for-mail Newsgroups: news.software.readers Organization: 604 Lines: 76 NNTP-Posting-Host: cmung544.cmu.carnet.hr Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: bagan.srce.hr 1078005390 9820 193.198.130.36 (28 Feb 2004 21:56:30 GMT) X-Complaints-To: abuse@carnet.hr NNTP-Posting-Date: Sat, 28 Feb 2004 21:56:30 +0000 (UTC) User-Agent: 40tude_Dialog/2.0.9.1hr (ade79f50.443.3) X-Afraid-Of: spiders X-Face: "wB!^cgWZ=; q%#:6lkzMWJ-O*>}<FSIu#HEqp5P2E#=mTGgQ-\^YM|Vt(j_|:*GI8?,7A9Z mkgCj|$f)nB@*>(B14sXotbL/"G.Z0u$]5\GcxnO4')%FUE\48H!!$rCLV.` X-Mastered: the art of pizza making X-Searching-For: GMT soundtrack (guy sigsworth)