• Re: xquit

    From Julian Bradfield@jcb@inf.ed.ac.uk to comp.windows.x on Sat Oct 21 14:27:55 2017
    From Newsgroup: comp.windows.x

    On 2017-10-21, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    1) Both the window and text text are very tiny. I would like them to be
    big and visibla. I don't see anywhere in the source code where this is
    set.

    See previous post.


    2) In the penultimate line of the source, it originally contained the text "exit(0)". In order to get it to compile, I had to comment out "(0)".
    This changed an error into a warning, but at least it does compile and run.

    To get a warning-free compile, modify the end of the program as
    follows:

    /* timer callback wrapper for exit */
    static void DoExit(XtPointer timeout,XtIntervalId *id /* unused */)
    {
    exit((long int)timeout);
    }

    /* Function Name: Destroyed
    * Description: This is a Destroy callback that when called sets a
    * timeout function that will exit the program in 5 seconds.
    * Arguments: widget - the widget that was just destroyed.
    * closure, callData - UNUSED.
    * Returns: none.
    */

    /* ARGSUSED */
    static void
    Destroyed(widget, closure, callData)
    Widget widget;
    XtPointer closure, callData;
    {
    XtAppAddTimeOut(XtWidgetToApplicationContext(widget),
    5, DoExit, (XtPointer) 0);
    }
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From gazelle@gazelle@shell.xmission.com (Kenny McCormack) to comp.windows.x on Sat Oct 21 15:25:47 2017
    From Newsgroup: comp.windows.x

    In article <slrnoummbb.i4p.jcb@home.stevens-bradfield.com>,
    Julian Bradfield <jcb@inf.ed.ac.uk> wrote:
    On 2017-10-21, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    1) Both the window and text text are very tiny. I would like them to be
    big and visibla. I don't see anywhere in the source code where this is
    set.

    See previous post.

    I don't understand. How does the discussion of xmessage (in the other
    thread) have anything to do with how to modify the C source code to produce
    a bigger window and/or bigger text?

    2) In the penultimate line of the source, it originally contained the text >> "exit(0)". In order to get it to compile, I had to comment out "(0)".
    This changed an error into a warning, but at least it does compile and run.

    To get a warning-free compile, modify the end of the program as
    follows:

    Yes; that works. Thanks.

    What's amazing is that this did work, back in 1999. How can passing
    "exit(0)" as a function parameter do anything useful?

    Maybe the original author didn't fully understand what he was doing.
    --
    Pensacola - the thinking man's drink.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lew Pitcher@lew.pitcher@digitalfreehold.ca to comp.windows.x on Sat Oct 21 12:03:01 2017
    From Newsgroup: comp.windows.x

    Kenny McCormack wrote:

    In article <slrnoummbb.i4p.jcb@home.stevens-bradfield.com>,
    Julian Bradfield <jcb@inf.ed.ac.uk> wrote:
    On 2017-10-21, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    1) Both the window and text text are very tiny. I would like them to be >>> big and visibla. I don't see anywhere in the source code where this is
    set.

    See previous post.

    I don't understand. How does the discussion of xmessage (in the other thread) have anything to do with how to modify the C source code to
    produce a bigger window and/or bigger text?

    Any X application built using the X toolkit will support the X toolkit commandline arguments, including the -fn and the -xrm arguments. Thus, your xquit program, having been built using the X toolkit, automatically has -fn, etc as commandline arguments that you can tweak as you see fit. For a list
    of X toolkit commandline options, see the "OPTIONS" section of X(7) ("man 7 X").

    2) In the penultimate line of the source, it originally contained the
    text
    "exit(0)". In order to get it to compile, I had to comment out "(0)".
    This changed an error into a warning, but at least it does compile and
    run.

    To get a warning-free compile, modify the end of the program as
    follows:

    Yes; that works. Thanks.

    What's amazing is that this did work, back in 1999. How can passing "exit(0)" as a function parameter do anything useful?

    Maybe the original author didn't fully understand what he was doing.

    Probably, the original author was taking advantage of the not-so-stringent argument type binding that K&R C offered.
    --
    Lew Pitcher
    "In Skills, We Trust"
    PGP public key available upon request

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From gazelle@gazelle@shell.xmission.com (Kenny McCormack) to comp.windows.x on Sat Oct 21 17:01:38 2017
    From Newsgroup: comp.windows.x

    In article <osfr3m$j37$1@dont-email.me>,
    Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
    ...
    Any X application built using the X toolkit will support the X toolkit >commandline arguments, including the -fn and the -xrm arguments.
    Thus, your xquit program, having been built using the X toolkit, >automatically has -fn, etc as commandline arguments that you can tweak
    as you see fit. For a list of X toolkit commandline options, see the >"OPTIONS" section of X(7) ("man 7 X").

    Aha! I didn't quite get that - until now.

    Here's my final command line - which works well enough...

    $ ./xquit -fn '-*-*-*-*-*-*-34-*-*-*-*-*-*-*' -g 800x200 -label "Click this window to continue..."

    To get a warning-free compile, modify the end of the program as
    follows:

    Yes; that works. Thanks.

    What's amazing is that this did work, back in 1999. How can passing
    "exit(0)" as a function parameter do anything useful?

    Maybe the original author didn't fully understand what he was doing.

    Well, my point is that even if you can get it past the compiler, any
    function that gets called with "exit(0)" as a passed argument, will never
    be executed. I.e., the evaluation of the function args will cause the
    program to exit - the function itself will never be called.

    So, whatever functionality the XtAppAddTimeOut() function was supposed to
    be doing, was not happening (in the original code as written).

    Probably, the original author was taking advantage of the not-so-stringent >argument type binding that K&R C offered.

    Well, this was 1999 - not 1979.
    --
    Many North Koreans believe Kim-il-Sung is an "almighty god" who "created
    the world" in seven days as a divine spirit millions of years ago, and
    came to Earth as a human in 1912 as a messianic figure.
    --- Synchronet 3.21d-Linux NewsLink 1.2