Building a global appMenu

appMenu

Often you need an a so-called appMenu that has the same items and options in every scene. Sure you can build the Model and the Attributes for the appMenu in every scene and call every time a this.controller.setupWidget(…) . But you can also define a global for that and you have also the solution to put scene specific options in it.

It’s pretty easy, also if you have only little experience with webOS.

Continue reading

A nice little helper: Snippets!

Sometime i wonder why some little helpers for programming in daily business, are hidden to me under some stones.

So today i found such a nice little helper, called Snippets, I read about it on this german blog, so thank you ad for point me directly to this tool! :-)

Who else can describe this little tool better that the devs:

Snippets is an application for Mac OS X that stores the most valuable pieces of your code you can re-use in different projects many times.

The main idea is to make the process of re-using as easy as possible to avoid wasting your valuable time to write the same code again.

It even has support for external editors. TextMate is the editor I use, if I’m not developing with Ares, and this tool really makes snippet-collecting easy. You can also post some code directly into a Mail (if you’re using Mail.app).

Support for public code-sharing on pastie.org or snipplr.com is also included.

So if you’re a developer or a web-site designer who needs some code again and again, try it out.  I use this tool now for only a few hours, but I’m very impressed! It’s even free until version 1.0 (now we have 0.8) It only has one disadvantage if you’re not using Mac OS X 10.6 (aka Snow Leopard), you cant use it only on Snow Leopard. But hey! Thats not a real problem eh? :-)

So if you also have some little tools that you use for your development, that you think its worth to be suggested, post it in the comments.

And no! I get no money, or something else for mentioning this here.

Ares Tutorial Deutsch – Teil 2

So here is the 2nd and last part of the tutorial of my screen cast I’ve made.

Again this part is in german.

Watch in HD

Update:
I forgot to provide the code snippets that are used in the tutorial.
(Thanx PUGcaster for this hint :-) )

In first-assistant.js you need this:

this.photo = argFromPusher;

and also the new activate function:

,
 activate: function() {
 this.controller.get("photoView").mojo.centerUrlProvided(this.photo.photoUrl);                
}

Don’t forget the “,” in first line!

Your complete first-assistant.js should now look like this:

function FirstAssistant(argFromPusher) {
 this.photo = argFromPusher;
 }

FirstAssistant.prototype = {
 setup: function() {
 Ares.setupSceneAssistant(this);
 },
 cleanup:  function() {
 Ares.cleanupSceneAssistant(this);
 },
 activate: function() {
 this.controller.get("photoView").mojo.centerUrlProvided(this.photo.photoUrl);
 }
};

If you have any suggestions, please leave a comment here or send me a message on twitter (@rretsiem)

I'm sure that was not my last screen cast I've made, because it was really fun and I'll hope you have something learned from it.

Part 1 of the tutorial is available here

Interested in develop something?

Trying to develop my skills in webOS, JavaScript and Mojo.
I try to start a project to develop something and release it later as open-source in the App-Catalog. But I won’t start it as a single coder project. So im searching for another person or two their are interested and lets start coding together.

I think the Application should have something to do with Social-Networks that are accessible with an API, any ideas here? But any other ideas are welcome.

As long as you can speak English or German you’re welcome! Send me a Mail or leave a post in the comments if your interested!

Ares Tutorial – Part 1 – German

Today I released the first screen cast of two to show Palm’s Ares Development Environment.

It shows the tutorial that available on http://palm.ares.com called “FlickrSearch”. Some people asked in german forums if there is a tutorial for webOS programming available in german. Since I didn’t find any easy first steps in german, I thought I make my own.

So here it is:

This video is also available in HD resolution

This is my first screencast, it was fun, but I surely also made some mistakes, so go lazy if you find any mistakes :-)

Edit: Here is Part2

Setting the source of a picture

I’ve ever wondered why there exists a Picture-Widget that is not really documented at all. You can find information on the imageView, but thats not the same, because sometimes you need only a simple image presented in your scene.

Yep, you can do it by simple specifying a IMG-element in your template and call a

this.controller.get('imgElement').update('http://yournew/picture.png');

to get a new picture presented.
But you must also do eventually the dirty-work and check the size, height or proportion.

The Picture-Widget does all this for you!

But it is really hard to find some information on how to update this widget. It is not possible to update it simply by calling a

this.controller.modelChanged(PictureWidgetModel);

You cannot update it that way, because the picture widget is something special. It provides a IMG-element inside of a DIV-element.

Simply update the DOM via MOJO with:

this.controller.get("pictureWidget").firstChild.src = "http://your-new/image-here.png";

Or if you’re using Ares:

this.$.pictureWidget.setSrc("http://your-new/image-here.png");

You can also use an image that already exists in your application by specifying the correct path like “images/some-other-pic.png”