PDA

View Full Version : Desktop wont accept any content except Window



jgpandit
21 Jul 2009, 1:06 PM
Hello,

I am trying to build a prototype using the Desktop panel. I can use the windows, task bar and shortbuts as I want. Now I am simply trying to put a couple of images like logos on the desktop and it is rather difficult. I tried to add a simple image or a ContentPanel to the layout container of the desktop. ( Desktop::getDesktop() ) but it wont show up. Seems that the desktop will only accept Window objects. I could put the logo image in a window and then override styles, but that seems like a lot for putting a single image on panel. Has anyone encountered this problem before ? Am I missing some step in putting the panel in the LayoutContainer. I am simply doing:

Image logo = new Image(logoUrl);
desktop.getDesktop().add(logo);

Any help if greatly appreciated.

Regards,
-Jayant.

takayser
22 Jul 2009, 3:18 AM
I extended dekstop like this:


public class BaseDesktop extends Desktop {
public BaseDesktop() {
super();
LayoutContainer c = new LayoutContainer();
c.setStyleName("top");
c.addText("abcde");
viewport.insert(c, 0, new RowData(1, 82));
}
}

jgpandit
22 Jul 2009, 10:27 AM
Hello Takayser,

Thanks. My desktop prototype is now complete with whatever we wanted to do. I am now working on another similar prototype, without using the desktop mainly because that is too windows specific layout and might not go well with everyone. I have a couple of questions regarding that however will post them seperately.

Regards,
-Jayant.

thejoker101
11 Aug 2009, 7:49 AM
Does anyone know why it doesn't let you add via the getDesktop().add()? I've also tried the extended desktop as above and that didn't seem to work for me on the latest 2.0 version. I don't even see any elements being rendered in Firebug. I'd figure since it's just a LayoutContainer you could add pretty much anything you wanted, but how come it doesn't throw an exception or at least show me some DOM that tried to render?

thejoker101
11 Aug 2009, 1:05 PM
I think the solution is to do a getDesktop().layout() after you add something to it. That seemed to fix it for me.