🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #144327

Re: [Dialog] help needed with scripts

#144327
From: MLC
Date: Sun, 29 Feb 2004 23:08
75 lines
4165 bytes
sabato 28/feb/2004 _matija_ ha scritto:

>  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

Hi matija,

I've done it, and Dialog dispite the atom (and the progress bar) keeps
triggering the code immediately.  :(
I have:

procedure OnTimer1;  (every 2 minutes)
begin
  atomName := 'newArrivals';
  myAtom := globalFindAtom(atomName);
  if (myAtom <> 0) then
  begin
   //MessageBox (0, 'esiste (T1)', 'Info', $40); debugging
   globalDeleteAtom(myAtom);
  end;
  ADo('GetNewHeadersInSubscribedGroups');
  ADo('GetNewEmailsForAllIdentities');  
  myAtom := globalAddAtom(atomName);
end;

procedure OnTimer2;  (every 20 seconds)
begin
  dialogHWND := findDialogHWND;
  statusBarHWND := findStatusBarHWND(dialogHWND);
  progressBarHWND := findProgressBarHWND(statusBarHWND);
  progressBarPosition := getProgressBarPosition(progressBarHWND);
  atomName := 'newArrivals';
  myAtom := globalFindAtom(atomName);
  if((progressBarPosition)=0) and (myAtom <> 0) then 
  begin 
    //MessageBox (0, 'esiste (T2)', 'Info', $40); debugging   
    ADo('Script_PostShow');
    ADo('Script_MailShow');
  end;
end;

Then, at the end of my PostShow I have:

atomName := 'newArrivals';
myAtom := globalFindAtom(atomName);
if (myAtom <> 0) then globalDeleteAtom(myAtom);


I've also set Timer2 every 20 seconds instead of 5, hoping it could help,
but it doesn't.

There is also the problem that ADo('Script_MailShow') doesn't execute if it
is after ADo('Script_PostShow'). In my original version I had them
separated, one in Timer1, the other in Timer2. I can't imagine why they
cannot come one after the other, here. I tried them in a test script and
they come out well one after the other...

I think I'll give up. Maybe tomorrow I'll try to stop the flow with a
MessageBox. If you have other ideas, let me know! :)

-- 
Maria Luisa C - 29/02/04 23.57.07, here.
Le FAQ italiane del newsreader 40tude Dialog
http://fido.altervista.org/Dialog/faq.html
http://www.lillathedog.net/dialog/faq.html
Technical Details
Message-ID: <1axst0409hf5o.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!uni-berlin.de!ppp-148-197.26-151.libero.IT!not-for-mail
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> <s9iree27lg1t$.dlg@shpongle.604>

Show Full Headers
Complete Article Headers
Message-ID: <1axst0409hf5o.dlg@ID-187316.user.uni-berlin.de>
Subject: Re: [Dialog] help needed with scripts
Date: Mon, 1 Mar 2004 00:08:57 +0100
From: MLC <maluc52@yahoo.it>
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> <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!uni-berlin.de!ppp-148-197.26-151.libero.IT!not-for-mail
Newsgroups: news.software.readers
Organization: none
Lines: 75
Reply-To: mlcald@msn.com
NNTP-Posting-Host: ppp-148-197.26-151.libero.it (151.26.197.148)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 1078096143 58209258 I 151.26.197.148 ([187316])
User-Agent: 40tude_Dialog/2.0.10.1it (c6c4b124.279.301)
X-face: `5,A#.XIJ<lGz^'N6ILn}b6?|<WR+%0,;
 L~ch:[wBzD5P~6.6LZ\&C%X|&^U:8)q#x$J/]*
 /FKnt["<J>h3NH$m%jn<c#S$nm~r~F>bxcu!//y;
 ?$FHoBmv36*dBH[/KRN:vsg[<O4E?YF+P?974n sVPO!?-y_M^WJm*5itt!hpd2VEKNy=Vin$wW