Professional Web Applications Themes

Is it possible to have "console+menu" using ProjectBuilder? - Mac Programming

Somewhere in the E.U., le 21/10/2003 Bonjour Using MetroWerks tools I could build an app which had a GUI (mainly a menu bar, and which allowed to chose files and such in a traditional GUI way), and a console-like window for std in/outputs. It is possible to do the same using only Apple-supplied developer tools (and if yes, how?)? Relaxing the conditions slightly, is it possiblee to do this using Apple-supplied tools and third-party tools, except MetroWerks' (and if yes, which ones and how?)? Merci Hubert Holin...

  1. #1

    Default Is it possible to have "console+menu" using ProjectBuilder?

    Somewhere in the E.U., le 21/10/2003

    Bonjour

    Using MetroWerks tools I could build an app which had a GUI
    (mainly a menu bar, and which allowed to chose files and such in a
    traditional GUI way), and a console-like window for std in/outputs.

    It is possible to do the same using only Apple-supplied developer
    tools (and if yes, how?)? Relaxing the conditions slightly, is it
    possiblee to do this using Apple-supplied tools and third-party tools,
    except MetroWerks' (and if yes, which ones and how?)?

    Merci

    Hubert Holin
    Hubert Guest

  2. #2

    Default Re: Is it possible to have "console+menu" using ProjectBuilder?

    In article <cerfacs.fr>,
    Hubert Holin <fr> wrote:
     

    Write your application as a standard GUI application, but use
    calls to a text interface engine which can handle the character-
    based input and output.


    Simon Guest

  3. #3

    Default Re: Is it possible to have "console+menu" using ProjectBuilder?

    Somewhere in the E.U., le 24/10/2003


    In article <0.1.3>,
    demon.co.uklocalhost (Simon Slavin) wrote:
     
    >
    > Write your application as a standard GUI application, but use
    > calls to a text interface engine which can handle the character-
    > based input and output.[/ref]

    Thanks

    However, that's precisely what I want to avoid.

    More precisely, the (portable) guts of the app can only make use
    of ISO-C++ calls, such as writing to ::std::cout, and I do not want to
    wrapp those with roll-your-own-this-is-text-output-as-per-your-platform
    functions.

    At this point I could go the way of a console tool. However I do
    want to chose files in a platform-dependant maner, in the wrapping of
    the guts, meaning I want a GUI (the guts only see streams, of course),
    which is not possible with cconsole tools.

    In short, I am seeking some kind of control which intercepts calls
    to ::std::cout et al..

    CodeWarrior has a tool which enabless me to do just this kind of
    mixture app (because it has just that kind of component, even if it is
    somewhat broken). The problem is that I understand less and less where
    MetroWerks is going, if anywhere, and thus seek a possible way out of
    that dependency. Additionally, testing code with more than one compiler
    usually makes it more robust (this only apply to the guts portion, but
    that of course is the most important part).

    I could perhaps write a GUI front-end for choosing files and
    spawning a console (or terminal, more appropriately) tool for the guts,
    but then the passing of parameters between them would I assume (perhaps
    erroneously) be quite constrained by the format of a command line.

    Merci

    Hubert Holin
    Hubert Guest

  4. #4

    Default Re: Is it possible to have "console+menu" using ProjectBuilder?

    In article <cerfacs.fr>,
    Hubert Holin <fr> wrote:
     

    In the future, it would probably be better not to hard-code ::std::cout
    and friends, but instead use a parameter or a global variable that
    contains the streams to use. That way you can redirect them painlessly
    simply by changing what you set the global to, or by passing in a
    different parameter.
     

    It's quite easy to redirect your program's standard input and output to
    somewhere else in UNIX, see 'man dup2' for example. You could probably
    point them to pipes and then have a very easy way to display all of your
    stdin/out in a window.
     

    You can spawn the guts as a subprocess inside your own application and
    redirect the subprocess's standard IO to pipes that you control, again.
    This gets more complicated, but may be a better architecture for you. If
    you're using Cocoa for the front-end, NSTask can make this fairly easy.
    Michael Guest

  5. #5

    Default Re: Is it possible to have "console+menu" using ProjectBuilder?

    In article <cerfacs.fr>,
    Hubert Holin <fr> wrote:
     

    You haven't said whether you're married to any particular API for your
    GUI. If you aren't you could use Cocoa's NSTask class to launch your
    command-line tools, writing to their stdin and reading from their
    stdout. NSTask saves you from all that messy stuff like having to escape
    parameters for the command line, and with Cocoa your GUI would be a lot
    easier to write.

    Otherwise you could drop down to the POSIX layer and use popen() or
    fork()/exec() to do something similar with more manual labor.

    I don't think there's a cross-platform way to replace stdin/stdout with
    your own while the app is running, but you could search in the POSIX
    docs. All I know about POSIX, I picked up on the go, and I might have
    overlooked something. At worst, you could try looking at the Darwin
    sources, maybe something there shows how you'd redirect stdin/stdout to
    some other stream.

    Hope any of this helps.

    Cheers,
    -- M. Uli Kusterer
    http://www.zathras.de
    Uli Guest

Similar Threads

  1. Drafts are "stuck" in inactive draft console
    By J Bart in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: January 24th, 04:27 PM
  2. firefox: <param name="menu" value="false" /> !!!
    By whirled in forum Macromedia Flash Player
    Replies: 1
    Last Post: October 25th, 09:03 AM
  3. Replies: 1
    Last Post: August 26th, 07:01 PM
  4. "save", "selective color" menu go too slow. Please help!
    By bmjun20 in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 1
    Last Post: August 12th, 08:56 PM
  5. "Start" "Program" "Menu" list is empty
    By Pete in forum Windows XP/2000/ME
    Replies: 2
    Last Post: July 10th, 10:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139