🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #252129

Re: Dialog: Assign button to "Sample [200] Headers" command

#252129
From: Sqwertz
Date: Thu, 29 Nov 2012 01:47
89 lines
4869 bytes
On Tue, 20 Nov 2012 20:41:29 +0100, Bernd Rose wrote:

> On Sun, 18 Nov 2012 22:46:34 -0600,, Sqwertz wrote:
> 
>> Is there any way to assign to a button a command that calls "Sample
>> Headers" and bypass the dialog window that pops up to confirm how many
>> headers I'd like to retrieve? 
> 
> Create a custom Script named MySampling (or whatever you like) containing:
> 
> Program MySampling;
> Begin
>   PostKey( 13, false,false,false,false,false,false,false,false);
>   ADo('SampleHeadersFromSelectedGroups');
> End.

OK, thanks.  I didn't know how to stuff the keyboard, but I figured
there was a function. 

Also, where are the internal procedure names documented (the arguments
for ADo())?


> 
> Save and compile the script. If you wish to have an icon instead of the
> script name appearing on the button bar, select an icon in the lower
> left part of the Scripting dialog. If you wish to use a customized
> icon, put a *.bmp file with 20x20 pixel into the Scripts\Icons subfolder
> of Dialog. (You need to restart Dialog to re-read icons from this
> folder.) Please note, that custom icons will be last inside the icons
> drop-down list; just following a couple of empty[!] icons.
> 
> After closing the Scripting Dialog click right on the button bar and 
> select <Customize Toolbars>. Select "Scripts" from [Categories] and 
> drag "MySampling" from [Commands] to the button bar. You can also adjust 
> a shortcut and/or a mouse gesture to the script inside this dialog (if 
> you wish).

Actually, you can do this right inside the scripting dialog.  I just
compiled it, assigned it obscure icon and dragged it right up to the
toolbar using [show button config] and was able to run it all without
even closing the scripting window.  Worked like a charm and only took
30 seconds in all.

> [Number of headers to retrieve]
>> (my default is set to 200).
> 
> Just to make sure: The number inside the "Sample Headers" dialog depends
> on <General Settings>-<Connections>-<Number of headers to confirm on 1st 
> load for a group>. Whichever value is set there will be default for
> Sampling.
> 
>> Maybe even attach that to a event trigger.
> 
> You can try by yourself. A timer /may/ work. But I don't think this is
> worth the potential problems. In above MySampling script, PostKey of 
> the <Enter> key is inserted into the keyboard buffer in the "hope", 
> that nothing will get in the way until the "Sampling" dialog pops up. 
> If things go wrong, the <Enter> may wind up /anywhere/. Combining above
> code with events will increase the probability of some misfortunate 
> accidents...

I see what you're saying.  I wouldn't ever attach anything to a timer
(that I can think of).

>> (What is the definition of the "OnXover" event, BTW?)
> 
> I would be surprised if combining OnXOver with Sampling would /not/
> lead into severe problems. (If it would work one way or another, at
> all...) Since you are inside an *active* header retrieving process
> while OnXOver is executed, you'd create an invalid re-entry loop
> when starting a sampling process from over there.

I could potentially start several threads retrieving headers at the
same time.

Does OnXOVER fire one time for each group, or only on "Get new Headers
for Subscribed groups"?

Thanks again for your help.  Isn't Dialog great?  I just wish
scripting was documented better (such  as the internal procedure
names)

Isn't Dialog great?  I think it's the most configurable newsreader on
the planet (without having the source code).  

Thanks again!

-sw
Technical Details
Message-ID: <usmctyu6ajyh.dlg@sqwertz.com>
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!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!hitnews.eu!s09-11.readnews.com!unm2.readnews.com.POSTED!not-for-mail
References: <ildw42nd76wj.dlg@sqwertz.com> <ovsay7uoj9g$.dlg@b.rose.tmpbox.news.arcor.de>

Show Full Headers
Complete Article Headers
Message-ID: <usmctyu6ajyh.dlg@sqwertz.com>
Subject: Re: Dialog: Assign button to "Sample [200] Headers" command
Date: Wed, 28 Nov 2012 19:47:54 -0600
From: Sqwertz <swertz@cluemail.compost>
References: <ildw42nd76wj.dlg@sqwertz.com> <ovsay7uoj9g$.dlg@b.rose.tmpbox.news.arcor.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!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!hitnews.eu!s09-11.readnews.com!unm2.readnews.com.POSTED!not-for-mail
X-Trace: DXC=PDWK0eMm1JKXJQ?b<;
 HZEEG^cGF?V7mID]G0e@Sk_WTB\KSWKcAGbbDRPeLgEYG\<CXRWQ0ZPFORBnG6QH>mPB[HbmLC7E]l;
 8AW2CD>ST[aHD
X-Complaints-To: abuse@blocknews.net
Newsgroups: news.software.readers
User-Agent: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Organization: Me, Myself, and Inc.
X-no-archive: yes
Lines: 89
NNTP-Posting-Host: e7a32e39.newsreader.readnews.com
X-Original-Bytes: 4644