Home > OpenStep, GNUstep > A ‘Programming with GNUstep’ Flash demo A ‘Programming with GNUstep’ Flash demo Submitted by Nicolas Roard 2005-01-28 OpenStep, GNUstep 49 Comments This flash demo shows how to create a GUI application with GNUstep. About The Author Eugenia Loli Ex-programmer, ex-editor in chief at OSNews.com, now a visual artist/filmmaker. Follow me on Twitter @EugeniaLoli 49 Comments 2005-01-28 9:26 pm you have to know which dots to connect. It doesnt really explain itself. 2005-01-28 9:37 pm I don’t believe it was meant to teach you application development but to demonstrate GNUstep dev tools. I liked it 2005-01-28 9:40 pm Yeah, and if you put someone who has never used a computer before in front of one, and told them to get to work, without giving them any training, do you think they would automatically be productive? How about all the troubles people had moving from Win3.1.1 to Win95? For me, having used GNUStep applications before and many development tools, it seemed fairly intuitive, but, I would also read the documentation 😉 The tool looks great to me! 2005-01-28 9:41 pm Well in fact, the principles in Gorm are not very complex — you have objects on your screen and you can link them. In fact, Gorm is not just a GUI builder — you really directly works on objects, which is very cool, because for example you can have your own palettes containing custom objects that you just drag’n drop like any other standard widget.. and you can also have normal non-graphical objects that you can link to your other objects (exactly what I did in this demo, in linking my MyController instance to the textfields..) Basically, it’s the target/action paradigm : objects can have a target to which they send messages. For example, a classic demo on NeXTSTEP was to put a slider and a textfield on a window, connect the slider’s action to the textfield method “takeIntValueFrom:” (for example), and connect the textfield’s action to the slider method “takeIntvalueFrom:”. Then, if you move the slider, it will send a message to the textfield (basically, it will call the method takeIntValueFrom: of the textfield object), and in reverse, if you type something in the textfield and press enter, it will call the the method takeIntValueFrom: of the slider object… you can even test it without compiling your program ! (Gorm allow you to do the same thing, of course). So here, I just created a controller class, instanciated it, and link this object to my GUI widgets (the valueA outlet for example is linked automatically to the NSTextfield when the program load the main gorm file). The same way, I linked the widgets to set the next responder view, so you can just tab-circulate easily between them (the responder is the object that has the focus). 2005-01-28 10:00 pm Definitely awesome! It’s also incredible that people opt to go for C++ with all the headaches it brings, when there’s Objective-C… 2005-01-28 10:28 pm I’m not sure why, but I used C++ for years and the OOP paradigm never really clicked. Once I learned Objective-C and SmallTalk, it made a lot more sense. Which is kinda odd, since objects in Objective-C feel a lot more like unwanted appendages than in C++. 2005-01-28 10:43 pm How was it recorded? 2005-01-28 10:49 pm Seems to be a program called vnc2swf or something like that. It’s been used a lot for such demos lately. 🙂 2005-01-28 11:13 pm Hmm interesting demo, though I could do the same thing in Qt in about the same amount of code. Setting the tab order was pretty cool graphically was pretty cool though. Its nice to know that if I ever decided I wanted to learn some Objective-C that there are tools around the same level as Qt’s. (I know looks arent everything but seriously they need to do something about WindowMaker/*Step) 2005-01-28 11:25 pm I’ve gotta say I’m really impressed with GNUStep. Their tools really seem quite top notch, and have a damn-near one-to-one correspondence with Apple’s tools. #gnustep is also my favorite resource after the apple docs for info on cocoa programming since cocoa and gnustep are so similar. If I were to return to Linux, I’d be a GNUStep guy in a heartbeat. 2005-01-29 12:03 am I happy to see this video about an alternative DE, but i think is difficult that another free project can compete with gnome/kde. It seemed an unintuitive version of Glade 2005-01-29 12:06 am “If I were to return to Linux, I’d be a GNUStep guy in a heartbeat. ” *Actually, you’d be a GNUstep guy 😉 As for the previous comment about the UI, (A) it’s themable, and has been for quite a while (A year? two?) and (B) Lots of folks use GNUstep *BECAUSE* the GUI is not candy-coated and because its form follows its function, not the other way around. I’ve always been an advocate of themes, but a quick check in any theme repository and you’ll see that 99% of the themes there are complete and utter trash. 2005-01-29 12:47 am And it took him about a quarter of an hour. Nice to see how drag-and-drop-point-and-click he did it. But then, he went out and coded it using vim. Sorry, but that doesn’t match – RAD has to be an integrated approach – like in NetBeans or VS.NET (*no* OSS/CSS discussions please). No, that’s not my way to develop software. Switching back and forth between UI and command line is inconsistent. But this doesn’t change anything about the fact that it’s OSS and that it’s free. 2005-01-29 12:54 am Well, I took 10 minutes because I did it slowly, with some explanations, and even put a nice gui 😉 The thing you don’t realize, it’s that the application is neatly done, no GUI code, but moreover, it follows a strict separation of the GUI and the code. In short, this approach is extremely scalable to applications a LOT more complex. Doing a quick demo in five minutes is doable with a lot of other environments, but I don’t think you end up with something scalable most of the time (ie the examples are just that, examples, and it’s painful when your app is complex. Here it’s not, even for more complex apps, because the design and separations are sound). For the Comment about vim… well.. at one point you need to type some text 🙂 and personally I’m too used to vim, so I just configured ProjectCenter to use it. Nothing prevents you to use the embedded text component.. 2005-01-29 1:13 am Well, if you liked this then check out Mac OS X and its developer tools Interface Builder and Xcode. It is far more mature and thought through. 2005-01-29 1:30 am Well, if you liked this then check out Mac OS X and its developer tools Interface Builder and Xcode. It is far more mature and thought through. I’d like to know what you mean by that. I use XCode and Interface Builder a fair bit, they’re DAMN nice tools (though IB has been pissing me off lately). Mature, yes. Thought through? How? The only way I can think of is how it’ll manage files between XCode and IB a little better. As for the capitalization of GNUstep.. so sue me. 2005-01-29 1:43 am Well, Gorm is really nice now… ProjectCenter is still not as good as XCode though. But well, it works not too bad. It can be better (and it will be !). One point that can (and will be, soon) improved is a communication between PC and Gorm (to tell PC to automatically load files created in Gorm, and vice-versa, when you modify a class in PC automatically reload it in Gorm). 2005-01-29 1:46 am Yeah, as a cocoa programmer, I can tell you that Apple’s ( FREE developer.apple.com / with OS X ) developer tools function exactly like this. Its an amazing development environment for both novices and advanced users. 2005-01-29 1:54 am I didn’t know GNUStep was themable! I haven’t seen any such thing on the GNUStep website. And while I’m at it, is Renassance a replacement for GORM? 2005-01-29 2:38 am “I didn’t know GNUStep was themeable! I haven’t seen any such thing on the GNUStep website.” Yes, GNUstep is themeable. The theme engine is quite simple and flexible. “And while I’m at it, is Renassance a replacement for GORM?” No, Renaissance is not a replacement for GORM. Renaissance is just a tag library for GNUstep widgets, there’s no graphical editor and all of the markup must be done by hand in a text editor. Future directions: With the implementation of NSKeyedArchiver, there’s now an XML format for .nibs, the same will be true of .gorm files. In fact, I’ve been working on making Gorm read .nib files which were written using the keyed archiver from IB on OSX. So full compatibility with OSX (as far as the archiving format goes) is in the works. For now, it’s possible to import your nibs using nib2gmodel and then reading the resulting gmodel into Gorm.app to create the appropriate .gorm file when porting your app. GJC (Gorm’s Author/Maintainer) 2005-01-29 2:41 am Renaissance is orthagonal to Gorm. It’s not better, not worse, just completely different, and you get no GUI layout, which is part of what makes Gorm so quick to use. 2005-01-29 3:05 am wow, that looks great. I tried gorm in its early days, and at that time, it crashed often so I gave it up. I didn’t understand it but I know now that’s because it is different (I wouldn’t call it “unintuitive version of Glade” for that) but seem powerful. one thing that I am used to in a window manager is the focus under the mouse. keep a terminals in the background, put clickodromes above. this was not really for the style of menus in gnustep where you have to cross other windows to catch it (and so, changes at each one crossed)… has something been done for that? OTOH, I do agree that the same can be done using the qt’s designer and I’m kinda allergic to objective-c… missing too many things from c++ like in c-simple, yeah, the headache ones 😉 (I don’t remember, does it have exceptions?). are there bindings to other languages, especially python? are they easy to integrate in these so called gorm/pc? and for portability, is the code produced by these tools are usable in macosx? what does this gorm produces after all, objective-c directly? no _need_ to answer, google is there, but if you do, be advice: I thank you 😉 2005-01-29 3:31 am About the focus… nothing is done. Sloppy focus don’t mix well with GNUstep Well, actually, there’s something you *can* do. Set the menu outside the screen (hm I’m not sure, but there’s perhaps even a defaults you can set to get rid of them), and just use the right-click mouse button to bring a menu (by default it brings the general menu, if the view underneath the mouse didn’t redefined a context menu). Else, there’s some tentative to have “windows”-like menu, that is, menus *in* the main windows. But it’s not available yet, and I’m not sure it will be in the cvs soon, because apparently it needs quite a few things to work. The other possibility you can do perhaps is to have “mac”-like menu (there’s a bundle that does that: WildMenu), but that’s a bit off-topic. About QT Designer: this particular demo could somehow be done with it, yes. Not entirely though, as as you can see in the demo, I define a class directly in Gorm, instanciate a new object and link this object with the other objects of my GUI.. And that’s where Gorm (and InterfaceBuilder) are a lot different than usual GUI builders: they are NOT just GUI builders, they are more like “object relationship modellers”, because you directly work with objects, you directly set values and relations, and above all, it’s not restricted to a set of standard widgets: you can use whatever objects, your own if you want, and not just “graphic” objects (widgets) but any kind — just like in this demo where I use an object of the class MyController… Else, what are you missing from C++ 😉 ? Objective-C by the way is a strict superset of C … and it’s really, really nice. But well, there’s binding for other languages, even if they aren’t much used (ruby and java). For python, there’s PyObjC, but I really don’t know how well it works (if any, I prefer ruby 😉 — there web page say that they have limited support for GNUstep (http://pyobjc.sourceforge.net/index.php) For portability, the code is quite portable 🙂 but you will need to redo your GUI with InterfaceBuilder, until gregory add the hability to load/save the new xml nib files.. 2005-01-29 8:34 am It is hilarious reading all these pro-Qt-Designer commentaries. Where the hell do you think Trolltech, Microsoft and dozens or more companies/projects stole their futuristic InterfaceBuilder(tm) ideas from? From those of us who once worked at NeXT it’s nothing but revisionist history and fucking annoying reading about advancements in RAD Tools and IDEs primarily for C++ and whatnot as if this shit was something original. Hell Brad Cox’s language should have bridged the gap between C and Smalltalk, but nope Bjorn and company convinced everyone that C++ was the way to go. Thanks Bell Labs. You bring us C and then fuck us with C++. Oh but don’t forget about Java! After NeXT and Sun couldn’t agree we get this copy cat language with most of ObjC’s ideals but without it’s self-readable syntax. Joy! On a side note since we are discussing C++ and ObjC, albeit not by choice with this being a demo on GNUstep and ObjC: I’m dying to read the future commentaries regarding ObjC vs C++ once ObjC++ is fully submitted to GCC. And yes I’m well aware of the current dipshit arrogant attitudes reprioritizing lesser languages like ObjC within GCC, currently. Either several former NeXT compiler engineers have retired since I left Apple back in mid-98 or they’ve let some serious prigs be the interface for Apple concerning GCC. Both sides of this debate need a moderator. Someone like Kevin Enderby if he still is at Apple should be the one helping steer the course. I’ve never seen such bitching back and forth currently happening with Ada, ObjC and all the other ‘secondary’ languages presently put on the back burner next to C/C++. I presume once Tiger is released and Apple merges their modifications to GCC with ObjC++ that all this whining will go away? One can hope for all sides, and for those of us using Linux as well with GNUstep there can be some peace and tranquility, not to mention future development with C++ and ObjC together. What annoys me is that GCC is being steered as the compiler for Linux primarily and then for FreeBSD, OS X, so on and so forth–oh but one can always fork the source and do what they will. Please. How many capable compiler engineers do you think exist in the IT World? Very few. That’s why they get paid handsomely by Apple, Sun, IBM, Microsoft, Borland, etc. They already work for proprietary corporations 50-70 hours per week. So reading comments that point out how one can just jump in and fix the broken ObjC support themselves is nothing more than hot air and fantasy. Of course if the GCC group would publish in-depth design books on how the Compiler is developed and the theories behind it, other than abstract white papers we might find more people being able to contribute to the compiler. Nothing more titillating than discovering all the documentation for ObjC at the GCC documentation section points you back to Apple. Hello! I’m glad I can read a whopping 38 page ObjCRuntimeRef.pdf from Apple. Surely there is much more about ObjC inside GCC than this sparse document, right? But as usual, develop and design continues on within a closed little group of people who think of professional documentation as inhumane torture on their precious time. Btw, I’m reading up on Qt and more in-depth C++ since Linux is such a C++ world and I’m not interested in GTK. It is just sad one has to become multi-lingual in C/C++/ObjC/Java just to get a basic job nowadays in the States. Spreading employees so thin doesn’t improve the results, it will more than likely creates inferior solutions. At least XML is agreed upon, mostly. 2005-01-29 8:36 am Great presentation. Steve would have been impressed. He has always been highly critical on such demonstrations. Perhaps that is why watching his presentations people aren’t bored after ten minutes. The man is a genius at presentation, unlike the prepubescent child who would be king up in Redmond. 2005-01-29 8:50 am there are very nice themes available for gnustep: http://www.roard.com/screenshots/screenshot_theme29.png http://www.roard.com/screenshots/screenshot_theme41.png 🙂 2005-01-29 10:07 am More Demos Please 🙂 2005-01-29 11:15 am 🙂 2005-01-29 11:17 am they are funny, but still not very good ones… 2005-01-29 12:23 pm Oh, but it is very good. That theme is not a pixmap theme. The guy has been working on programming that theme for quite some time now. I think he is also working on a pixmap theme engine but I don’t fallow GNUstep enough to know for sure if it’s the same guy or not. 2005-01-29 2:17 pm I have programmed 3 applications from start to finish with GTK. I for one, would never do that again. I also programmed MFC, ATL, C++, WinAPI C, even VB 3.0 . My opinion is that MFC, ATL, C++ (The language), GTK, C (For Application GUI , C is still useful for the tricky things with the OS) needs to frackin die. GTK IS HORRIBLE. Only good thing is people is wrapping bindings around that horrible thing, however you still have to make ungodly amounts of calls to create a DAMN SIMPLE MENU. Yes I know there is the menu factory, however simply put ITS STILL HORRIBLE to use. Most developers opt to use Glade, hook up XML to it. When you do that, you lose a bit of flexibility with it, WHERE YOU SHOULD NOT. its realy terrible GUI language. GNUStep is a great step in the right direction.. Apple took it, and use it for the base, for a VERY good reason. Apple is a good few years ahead of everyone EXCEPT in managed code department. They seriously need to add some kind of .net layer between the code and machine. Steve Jobs is a visionary, in the aspect of whats coming to computers, lucky he did not go the way of the amiga. 2005-01-29 2:30 pm How it is implemented is of NO interest to your average user. What matters is what it looks like. If it doesn’t look good then it doesn’t look good. I personally like the old nice and clean NeXT look, but most people don’t. For GNUstep to gain wider audience it really has to update the default theme. 2005-01-29 2:36 pm Well, the upcoming Camaelon 2 will have a nice pixmap theme engine, so it will be easy to have whatever theme you prefer. But I’d like to add something: you say that “most people don’t [like the NeXT look]”. In fact, I think that most “power users” don’t like it, because it looks too simple. But I also think that quite a lot of people, normal user, like it, because it’s non-intrusive, clean, don’t give you an headache. I remember a guy last year at the Fosdem, he was really interested, because the UI was clean and simple, not difficult to “read”. Problem of course is we need themes to convaince power users and developers.. And I agree the default theme could be slightly more “modern”-looking, even if personally I prefer the NeXT theme because it’s so clean.. 2005-01-29 2:40 pm And I agree the default theme could be slightly more “modern”-looking, even if personally I prefer the NeXT theme because it’s so clean.. i dont see why a modern theme has to be considered less “clean”. changing the colors a bit, making some gradients or round borders in some widgets will improve the look a lot, and doesnt have to ruin the “clean” feeling 2005-01-29 4:46 pm I don’t believe in a very configurable theme (ie. pixmap theme) and I wouldn’t do any. But thanks to GNUstep that you don’t really have to rely on a specific API to override the current theming system and can be easily done by third parties. Thanks to dynamicism and the great bundle system. For the theming, one day I’ll try to finish this thing http://home.gna.org/garma/lapis/images/lapis-extra-white.png hope it will be nice enough.. I bet it is, and sorry for taking a corner for my own ads 2005-01-29 4:53 pm A RISC OS theme, eh? Here’s a tip: make the menu font bigger. 2005-01-29 7:06 pm … that my subjective view. but there is one much bigger problem. Nextstep/Openstep/G__step does not nicely blend in a Windows/GTK/KDE desktop, which results in inconsitencies between applications. there is not even a window manager which is integrated in GNUstep- Windowmaker just looks a little bit like Nextstep, but is not written for GNUstep. I like GNUstep and the slightly different approach to a GUI, but it only makes sense, if most of your software is written for GNUstep. We have GTK/Gnome and QT/KDE, there is maybe no place for a third desktop environment. If you like GNUstep you should consider buying a Mac. 2005-01-29 8:16 pm Free Software. 2005-01-29 8:53 pm Also GNUstep is really the only way forward right now to have a NextSTEP like architecture on x86. There is still room for such a desktop, if it’s allowed to grow. Even now the development tools can be taken quite seriously. I’m sure many old NeXT fans will like it, even if it might not be 100% like the original. 2005-01-29 9:06 pm Just curious, as someone who does like WindowMaker, where does GNUstep fit in, or where does WindowMaker fit in if that’s the case? Thanks. 2005-01-29 9:31 pm Window Maker has some GNUstep support code. Some of their developers likes GNUstep and they would probably love to support it if they aren’t too busy. Once GNOME is moving its theme system to Cairo it would be easier for GNUstep to have a pixel by pixel compatible theme. Problem should be that other DEs don’t have global menu system and sloppy focus thing. But the problem should be (poorly) solved by implementing MDI mode in GNUstep as it was being discussed. So I doubt theming really is an issue. More important point should be the source code that will be used as components of large applications in future, reusability, portability etc. BTW. @Luke McCarthy thanks Never know risc os though. 2005-01-30 3:58 pm “Which is kinda odd, since objects in Objective-C feel a lot more like unwanted appendages than in C++.” You must be kidding. Objects is ObjC are one of great points. That is the whole reason to use ObjC. Objects are way more elegant in ObjC that C++. 2005-01-30 5:01 pm No, that’s not my way to develop software. Switching back and forth between UI and command line is inconsistent. How does using a terminal-based editor equal to using the command line? He _clicked_ to run vim . He did not write a single command into a prompt to create the program. To each his own, but I’d preffer a development environment which does not dictate me which editor to use to write the code. 2005-01-30 6:22 pm Whats the quickest way of installing Gnustep on a linux install ? 2005-01-31 6:15 am Well, it depends on your linux flavor: on debian, a mere apt-get install gnustep will install it, for gentoo it’s similar afaik. On other system you could use rpm, and in any case, you still have the possibility of downloading the tgz of the releases on the gnustep website… Check that page: http://gnustep.org/resources/sources.html And this one for documentation: http://gnustep.org/experience/documentation.html You can also go to irc.debian.org (or any other irc server on freenode), channel #gnustep, and ask for help/ 2005-01-31 6:18 am In Debian: apt-get install gnustep 2005-01-31 8:43 pm Thanks for the demo Nic. Where can I learn more about ObjC? 2005-01-31 9:18 pm I use WebObjects but never realised how great a debt it owed to NEXTStep. And I love WindowMaker as a desktop (every other desktop just looks crass to me – well, with the exception of OS/2’s WPS). Anyway, this demo makes me want to learn more about GNUStep. I’m going to apt-get it right now. What’s the best way to learn more about GNUStep and ObjectiveC? Any books to recommend? 2005-02-04 2:56 pm For learning ObjC apple have an excellent online book at http://developer.apple.com/documentation/Cocoa/Conceptual/Objective… aswell as other documents detailing memory managment, ObjC runtime and Distributed Objects. Actual a lot of the stuff at apples developer connection is applicable to GNUStep e.g. the foundation API reference, and its very well presented and maintained.