PDA

View Full Version : Rapid GUI development like Visual Basic?




Sunnzy
Jun 10, 2009, 07:17 AM
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.



Flynnstone
Jun 10, 2009, 07:34 AM
Yes, I I thinks its better.

RealBasic.

wrldwzrd89
Jun 10, 2009, 07:43 AM
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.

pigoz
Jun 10, 2009, 07:55 AM
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 :o

Sunnzy
Jun 10, 2009, 07:58 AM
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 :o

Hmm... iPhone? But... I want to do this on a Mac? Or is this exactly the same on the Mac? :D

ghayenga
Jun 10, 2009, 10:05 AM
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/

Thomas Harte
Jun 10, 2009, 10:50 AM
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 (http://web.mac.com/elvis.dowson/Tutorial/Xcode_3.0_Tutorials/Entries/2008/3/7_Handling_button_events.html).

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.

pikester
Jun 10, 2009, 12:21 PM
For a good class on Xcode, check out the Stanford iPhone class:
http://deimos3.apple.com/WebObjects/Core.woa/Browse/itunes.stanford.edu.2024353965

Developing for the iPhone is the same as for the Mac. Another bonus for Xcode: AppleScript Studio

Have you looked at Automator as well? It might suit your needs as well.

cqexbesd
Jun 10, 2009, 01:08 PM
anything that allows you to quickly create a GUI and add some lines of code to make it do stuff?

Runtime Revolution perhaps? http://www.runrev.com/

It's kind of like the step child of Hypercard and is even cross platorm.

Andrew

Dragonlance1561
Jun 10, 2009, 10:58 PM
I don't recommend pure C or pure C++ anymore, since Apple dropped 64-bit support for Carbon apps

This may be true, but the recently released Qt 4.5 (http://www.qtsoftware.com) allows you to use C++ with Cocoa and Carbon combined allowing 64-bit support. Here is a video about it: http://www.youtube.com/watch?v=tWIq1YFRyqE&feature=channel_page


However, for fast GUI stuff I also recommend realbasic

wrldwzrd89
Jun 11, 2009, 07:38 AM
This may be true, but the recently released Qt 4.5 (http://www.qtsoftware.com) allows you to use C++ with Cocoa and Carbon combined allowing 64-bit support. Here is a video about it: http://www.youtube.com/watch?v=tWIq1YFRyqE&feature=channel_page


However, for fast GUI stuff I also recommend realbasic
Good to know, thanks! I wasn't aware that Qt let you do this.

Sunnzy
Jun 11, 2009, 08:41 AM
Hey thanks for all the replies I think it will take a while to digest all of it. (I have read through every single post.)

Meanwhile I think I have found some nice tutorial for building Cocoa-python app with Xcode 3.0, I'll put the link here for those who may be interested:

http://scottr.org/blog/2008/jun/11/build-cocoa-guis-python-pyobjc-part-one/

Dragonlance1561
Jun 11, 2009, 06:59 PM
Good to know, thanks! I wasn't aware that Qt let you do this.

Yeah it was just released in March.

Cromulent
Jun 12, 2009, 02:05 AM
Have you tried using Mono? C# is pretty darn easy and quite a nice language.