Re: [Cocoadialog-users] Newline in --informative-text?
Status: Beta
Brought to you by:
sporkstorms
From: Mark A. S. <ma...@sp...> - 2009-01-04 06:17:26
|
Well, the problem with sending the newline isn't one for CocoaDialog. CocoaDialog takes exactly what you give it, newlines included, and displays it. Finding an elegant way to send a newline to a program in command-line arguments is a problem with the shell. In Perl, for example, you can do `cocoadialog yesno-msgbox --informative-text "one\ntwo"` without a problem. Regarding the last line being cut off... do you mean the one that says "Filefly Process ID : " ? If so, I just tested it, copying and pasting that command exactly as you typed it, and it worked just fine. So I don't know what the problem might be. Are you using the newest version of cocoadialog (i added auto-resizing to dialogs in one of the later releases)? - mark Thomas Patko wrote: > Hello Mark: > > Yes. That works. It is a bit brute force, but it works. A discrete > call for a newline without --informative text would be nice for the > next release. The informative text does wrap VERY nicely and does > support large amounts of text (just what i needed here). I am writing > a simple job termination little app with Platpus/CocoaDialog and > echoing out the parameters of the job (pulled from separate calls) > that the user is going to be terminating (to ensure that they are > killing the RIGHT job). > > It seems to work OK using the syntax below, but the final line is not > printed out in the dialog box. Any ideas why? > > CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" > rv=`"$1"/Contents/Resources/$CD yesno-msgbox --no-cancel --float > --string-output --no-newline \ > --title "Firefly for Mac Job Termination Prompt" \ > --text "Do you want to cancel this Firefly Job? Job $COUNT of > $NO_ITEMS" \ > --informative-text "Job Type Summary : $JOBTYPE > Run Time (Minutes:Seconds) : $TIME > Input File : $INPUTFILE > Number of CPU Cores : $NCPU > Firefly Process ID : $MAINFIREFLYPID"` > > Cheers, > > Thomas > > On Sat, Jan 3, 2009 at 2:44 PM, Mark A. Stratman <ma...@sp... > <mailto:ma...@sp...>> wrote: > > I'm sure there's a cleaner way to do it, but you can just > hard-code a newline in there: > CocoaDialog yesno-msgbox --text "Hi" --informative-text "hello, > world" > > That will work just fine, but I admit it's not the most elegant > way. But anyway, it definitely supports multiple lines, both > forced, and wrapped if you have a really long informative-text. > This was a feature/fix I added to the 2.1.0 release. > > The informative-text label in the nib file will allow for an > extremely large amount of text. It wraps lines automatically, and > will extend itself vertically to allow for as much as text as you > need (within reason). > > - mark > > Thomas Patko wrote: > > Hello CocaDialog Users: > > Is it possible to print out multiple lines in the > --informative-text portion of a CocoaDialog call? In my > particular case it is for a yesno-msgbox type call. > > I would like to be able to do something like: > > --informative-text "Process ID: $MAINFIREFLYPID \n Run Time: > $TIME"` > > But obviously this will not work. Is there a syntax that > support newline calls from within the --informative-text > option and if so what is the syntax? > > Thanks, > > Thomas > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > ------------------------------------------------------------------------ > > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > <mailto:Coc...@li...> > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > |