Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sunnzy

macrumors regular
Original poster
Jan 30, 2007
116
0
Are there anything like Visual Basic for OS X? I don't mean like the exact replica where you actually code in BASIC, but anything that allows you to quickly create a GUI and add some lines of code to make it do stuff?

Sometimes I want to do something like that for writing a quick and dirty app that may be just have one time use, or maybe simply just "prototyping" for a larger project.

I actually have taken a look at XCode, it has an interface builder which was cool, I was able to come up with a GUI quickly but I just don't know where to code it!! I've tried to google tutorials but haven't got any luck so far, all the one's I have seen is either for Xcode 2 which doesn't work well for 3.0 for someone who is still trying to learn Xcode at all!! Or the 3.0 guides I've seen just stops at the coding stuff by simply saying check back later... and then there are 3.1's which apparently is very different to 3.0.
 
Depends on what language you prefer. NetBeans has a GUI builder, for you Java programmers out there. If you're coding in Python or Objective-C on the Mac, Xcode is probably the best option. I don't recommend pure C or pure C++ anymore, since Apple dropped 64-bit support for Carbon apps - that said, using a mixture of C and some other language is perfectly fine.
 
Depends on what language you prefer.[/quote]

I don't mind learning new language.

NetBeans has a GUI builder, for you Java programmers out there.

I currently knows Java and Swing reasonably well, and I use C for command line stuff

If you're coding in Python or Objective-C on the Mac, Xcode is probably the best option.

Oh yes I used python as well on the command line, just like C, I haven't look into Obj-C yet... so you can use python with Cocoa and build GUI Apps? Are there any tutorial/documentation to get started? I'll try and see if Google has anything. :D

I don't recommend pure C or pure C++ anymore, since Apple dropped 64-bit support for Carbon apps - that said, using a mixture of C and some other language is perfectly fine.

Oh... mixture of C and Obj-C seems the way to go, because I got a few C code that would be nice to write a GUI on top of ti, and that Obj-C is a superset of C, or so I heard...

But I'll be really interested in Cocoa python at this stage.

1) Go here http://developer.apple.com/iphone/index.action
2) Follow the Videos link
3) On iTunes go to iPhone Development Resources > Iphone Getting Started Videos
4) Watch the "Fundamentals of Cocoa Session from WWDC"

That is better than any tutorials :eek:

Hmm... iPhone? But... I want to do this on a Mac? Or is this exactly the same on the Mac? :D
 
Are there anything like Visual Basic for OS X? I don't mean like the exact replica where you actually code in BASIC, but anything that allows you to quickly create a GUI and add some lines of code to make it do stuff?

Realbasic is exactly what you need. Rapid GUI development better than Visual Basic.

http://realsoftware.com/
 
I'd say that learning Interface Builder is the way to go. As you have noticed, the user interface has been reshuffled, including in some significant ways, since version 2, so I'm not sure where you should go now for free tutorials. The iPhone video may well be the perfect place to start — although the iPhone has a completely distinct widget set, Interface Builder is essentially the same. You still draw the widgets you want, wire them up, then head to Xcode to write actual code if necessary.

I looked only briefly, but a Google search for "Interface Builder 3 tutorial" turned up some relevant results, such as this one.

You are correct that Objective-C supersets C. Apple also supply Objective-C++ which allows you to freely mingle Objective-C and C++. If you have existing code or are in the habit of using useful bits from the GPL world or wherever, this can be very helpful.

The main thing to get your head around before you launch into Interface Builder is that Objective-C is fully reflective. That means that you can query objects to find out which methods they support at runtime, or attempt to perform any method on any object, starting with just its name as a string if you want. In addition, the Mac has the concept of a first responder, which is commonly used to route any message (messages = method calls, since that's how they're implemented underneath in Objective-C) from the menubar to whichever is the frontmost window.

What that means in practice is that the method you use to tell objects in Interface Builder what action to perform needs to be sufficiently open that you can set a button to message another widget directly (so you don't write any code whatsoever inbetween) or set the menubar to propagate a message to nobody in particular. Which all helps enormously with complicated applications, but means that it's not possible for Interface Builder to be quite as simple as VB/etc for tiny, quick things. You can't draw on a button then double click on it to be automatically taken to the code that is called when it is clicked, for example.

General pattern is: add control to user interface, add method definition to class that you want to handle messages from the interface, control drag from the user interface control to the object with the method, select the method from the list that appears. Then go to Xcode and implement that method if necessary (which won't be if you've wired one control directly to another, for example). Sorry if that's a bit patronising, it's something that a lot of converts from tools like VB find very hard to understand the need for at first.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.