Article View: news.software.readers
Article #35188Re: slrn macro - file save?
From: Byrial Jensen
Date: Wed, 16 Jul 1997 00:00
Date: Wed, 16 Jul 1997 00:00
54 lines
2279 bytes
2279 bytes
Bek Oberin <gossamer@glasswings.com.au> wrote:
>define startup_hook ()
>{
> % fix header window size
> if ( SCREEN_HEIGHT <= 30 )
> {
> set_article_window_size ( SCREEN_HEIGHT - 7 );
> message(Sprintf ("Screen height: %d", SCREEN_HEIGHT, 1));
> }
>}
>
>I prefer a 3-line header window when I'm in a shorter screen, to leave
>more room for the message. Only that isn't working and I can't figure
>out why. It correctly print "Screen height: 30" on the status line,
>but doesn't set the article window size :(
Some variables relating to window sizes are only initialized then the
article window is created for the first time. Therefore unfortunately
set_article_window_size have no effect when it is called from
startup_hook or even from the initial call of resize_screen_hook.
I had a little doubt about how to fix this, but try to change your
startup_hook to a resize_screen_hook, and apply the following patch.
Regards,
- Byrial
--- art.c.org Wed Jul 16 10:36:15 1997
+++ art.c Wed Jul 16 20:29:51 1997
@@ -263,7 +263,19 @@
/*{{{ SIGWINCH and window resizing functions */
static void art_winch (void) /*{{{*/
{
- static int rows;
+ static int rows = 0;
+
+#if SLRN_HAS_SLANG
+ /* Check to see if rows is still 0. If so, this is the first
+ * call here and we should run resize_screen_hook to allow it
+ * to change the initial Article_Window_Nrows.
+ */
+ if (rows == 0)
+ {
+ rows = SLtt_Screen_Rows;
+ SLang_run_hooks ("resize_screen_hook", NULL, NULL);
+ }
+#endif
if ((rows != SLtt_Screen_Rows)
|| (Article_Window_Nrows <= 0)
Technical Details
Message-ID:
<slrn5sq5mr.rt.byrial@ask.ask>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn5sgrr2.5n7.gossamer@penguin.glasswings.com.au> <slrn5si5hj.coj.davis@mygir.davis.net> <slrn5sik9k.f3r.gossamer@penguin.glasswings.com.au>Show Full Headers
Complete Article Headers
Message-ID: <slrn5sq5mr.rt.byrial@ask.ask> Subject: Re: slrn macro - file save? Date: Wed, 16 Jul 1997 00:00:00 +0000 From: byrial@post3.tele.dk (Byrial Jensen) References: <slrn5sgrr2.5n7.gossamer@penguin.glasswings.com.au> <slrn5si5hj.coj.davis@mygir.davis.net> <slrn5sik9k.f3r.gossamer@penguin.glasswings.com.au> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 257279107 Newsgroups: news.software.readers