image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
Thread Tools
  #1  
Old August 29th, 2003, 04:16 PM
Registered User
 
Join Date: Apr 2003
Location: Glasgow, Scotland
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
willmac is on a distinguished road
Giving a CLI app an Aqua window - how easy?

Hya, I have a small CLI app that I have written for my work. Is it possible using Apple's Developer Tools to make it launch and operate within a single Finder window? If so could somebody point me in the direction of some instructions.

Thanks in advance

will
Reply With Quote
  #2  
Old August 29th, 2003, 06:43 PM
Arden's Avatar
Don't drink and derive.
 
Join Date: Dec 2002
Location: San Francisco
Posts: 7,743
Thanks: 0
Thanked 0 Times in 0 Posts
Arden is on a distinguished road
What's CLI?

What source code is it written in? If it's compatible with one of the languages in Project Builder, use Interface Builder to create the interface.
__________________
System:
2.5 GHz MacBook Pro Core 2 Duo, 4 GB RAM, 200 GB hard drive, runs 10.5.4
1.6 GHz iMac G5, 1.5 GB RAM, 250 GB hard drive, runs 10.4.11
iPhone, 4 GB, OS X 2.0.2
Reply With Quote
  #3  
Old August 30th, 2003, 10:49 PM
Registered User
 
Join Date: Jun 2003
Posts: 700
Thanks: 0
Thanked 0 Times in 0 Posts
Lycander is on a distinguished road
CLI = Command Line Interface, so basically it's a console app, and I'm guessing it's written in C/C++?

Probably the easiest thing to do is port it into a GUI app. Take Project Builder and start a new Cocoa app project. Objective-C is a superset of C so if your CLI app was written in C you can make the same calls to the C runtime library mixed in Objective-C code. Same goes for C++. That are articles (try www.macdevcenter) that discuss how to mix these languages. But the idea is to take the existing code and inject it into a GUI framework code.
__________________
vacant lot
Reply With Quote
  #4  
Old August 30th, 2003, 10:52 PM
kilowatt's Avatar
mach-o mach-o man
 
Join Date: Mar 2001
Location: irc.lfnet.net #kilonet
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
kilowatt is on a distinguished road
its also pretty easy to write applescript to do this. While apple script will not allow real-time control of a cli app, it is an extremely easy way to allow non-cli users to use a cli application.

At any rate, its probably easier than compiling your code into a cocoa app.
__________________
irc.lfnet.net #kilonet -+=join in=+-
Quote:
...the belief that the rights of man come not from the generosity of the state but the hand of God...
PEBKAC - Problem Exists Between Keyboard And Chair. --who said it first?
Audio Engineer - ProTools and Logic Pro Certified.
FCC Licensed RF Technician
Reply With Quote
  #5  
Old August 30th, 2003, 10:55 PM
kilowatt's Avatar
mach-o mach-o man
 
Join Date: Mar 2001
Location: irc.lfnet.net #kilonet
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
kilowatt is on a distinguished road
Oh, and if you would like to see this in action, a front end to 'nmap' (cli port scanning tool) written in applescript is avaliable on my site:
http://lfnet.net/index-old.html

I no longer maintain it, but there's enough code there for you to see how this is done.
Reply With Quote
  #6  
Old August 31st, 2003, 09:46 AM
Cat's Avatar
Cat Cat is offline
Registered User
 
Join Date: Jan 2003
Location: @ my Mac
Posts: 1,972
Thanks: 0
Thanked 0 Times in 0 Posts
Cat is on a distinguished road
Developer/Documentation/Darwin/GettingStarted/PortingUNIX/PortingUNIXToOSX.pdf partially addresses this issue. Other tutorials and docoumentation on InterfaceBuilder and ProjectBuilder are available in the Documentation directory and online at developer.apple.com
__________________
This is not a signature (but I could be wrong).
15" MacBook Pro C2D@2.4 GHz | 2 GB RAM | Mac OS 10.5.4 |
Website | LinkedIn | Publications
GP/O d-(+)@ s: a->? C++(+++) U* P+ L+>++ !E---- W+++ N o? K? w--- O? M++ V? PS+++ PE-- Y+ PGP t 5? X- R !tv b++++ DI+(++)@ D+(++) G++(+++) e+++$>++++$$ h--->---- r+++ y++++@
Reply With Quote
  #7  
Old September 1st, 2003, 05:30 AM
Arden's Avatar
Don't drink and derive.
 
Join Date: Dec 2002
Location: San Francisco
Posts: 7,743
Thanks: 0
Thanked 0 Times in 0 Posts
Arden is on a distinguished road
Off-topic...

I found this odd... Where did the your signature go?
Attached Images
File Type: gif odd.gif (17.5 KB, 9 views)
__________________
System:
2.5 GHz MacBook Pro Core 2 Duo, 4 GB RAM, 200 GB hard drive, runs 10.5.4
1.6 GHz iMac G5, 1.5 GB RAM, 250 GB hard drive, runs 10.4.11
iPhone, 4 GB, OS X 2.0.2
Reply With Quote
  #8  
Old September 2nd, 2003, 06:03 PM
Registered User
 
Join Date: Apr 2003
Location: Glasgow, Scotland
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
willmac is on a distinguished road
Thanks for all of you're advice. First of all, apologies for the lack of detail in my post. Yes the app does run in the console and it has been written in C++. Will have a look at the InterfaceBuilder and ProjectBuilder docs and take it from there.

Thanks again

will
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some changes for 10.3 Arden Opinions, & Open Letters 132 June 9th, 2003 07:54 PM
OS-X enhancement: window focus, no raise gweber Opinions, & Open Letters 1 November 4th, 2002 08:58 AM
Easy way to print window contents genghiscohen Mac OS X System & Mac Software 2 October 16th, 2002 02:14 PM
Aqua X window manager patzoul Mac OS X System & Mac Software 1 January 4th, 2002 11:13 PM
the easy way to program/use the terminal window... how work that language? how to lea ronin_X Apple News, Rumors & Discussion 12 September 20th, 2001 11:23 AM


All times are GMT -5. The time now is 11:33 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.