HTML Host Pages

21 views
Skip to first unread message

Donnie Lee

unread,
Sep 26, 2008, 8:25:48 AM9/26/08
to Cappuccino & Objective-J
Hello!

Does Cappuccino have HTML Host Pages functionality to selectively
insert widgets into specific places in an HTML page? I mean the same
functionality as in GWT:
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideHostPage

Marc

unread,
Sep 26, 2008, 9:14:49 AM9/26/08
to objec...@googlegroups.com
Hi,

I would like to write an application using a class like NSBrower to
navigate in an hierarchy.
I didn't see equivalent class of nsbrower, even in source.
Any idea to implement it ? Perhaps with a group of NSTableView ?

thanks

...Marc

Redmar Kerkhoff

unread,
Sep 26, 2008, 9:28:03 AM9/26/08
to objec...@googlegroups.com
Hey Marc,

The CPTableView is still under development, it's already in the
repository if you want to have a look.
After this is finished i think the cappuccino team or someone else
will pickup the work on CPBrowser.

Regards,

Redmar

Marc

unread,
Sep 26, 2008, 9:46:49 AM9/26/08
to objec...@googlegroups.com
Thanks Redmar

nciagra

unread,
Sep 26, 2008, 1:23:25 PM9/26/08
to Cappuccino & Objective-J
I'm not sure I understand what exactly you guys want, but if you're
just looking for iframe functionality so you can embed another HTML
page into your Cappuccino app, take a look at CPWebView. It's not
documented (yet) but it is in the source and fully functional. It just
uses an iframe.

Let me know if that's what you wanted or not.
--Nick

Tom Robinson

unread,
Sep 26, 2008, 4:32:13 PM9/26/08
to objec...@googlegroups.com
NSBrowser is a Cocoa class that displays a hierarchy (like "View as
Columns" in Finder)

It's a somewhat confusing name that was probably chosen before the
*web* browser was invented.

-Tom

Donnie Lee

unread,
Sep 27, 2008, 1:16:42 AM9/27/08
to Cappuccino & Objective-J
Hey Marc!

Why did you use my theme to ask your question? It's theme about HTML
Host Pages, not about NSBrowser.

Tom Robinson

unread,
Sep 27, 2008, 2:22:35 AM9/27/08
to objec...@googlegroups.com
Short answer: Yes. Currently the best (only?) way to embed a
Cappuccino application in another page is to use an iframe. Simply set
the iframe src to the Cappuccino application's index.html file.

Long answer: No. It's not currently possible to place a Cappuccino
application on the *same page* as other content (i.e. not in an
iframe), since Cappuccino takes over the whole page and all events. It
may be possible, but will require a bit of work.

While it's not really how Cappuccino was intended to be used, if
anyone wants to tackle this, the place to start would be
CPDOMWindowBridge.j. In particular, take a look at _initWithDOMWindow:

_DOMBodyElement = document.getElementsByTagName("body")[0];
_DOMBodyElement.innerHTML = "";

Rather than using the actual body node (and deleting everything inside
it) you would probably want everything contained in a div. You would
also need to do a lot of work to get events to play nicely across the
capp and non-capp portions of the page. And any CSS you have on the
page will probably mess things up, so you'll either need to do some
sort of CSS reset on the root element, or change a bunch of things to
explicitly set style properties that are currently relying on defaults.

Caveat emptor...

Donnie Lee

unread,
Sep 27, 2008, 5:06:05 AM9/27/08
to Cappuccino & Objective-J
Big thanks for your answer, Tom!

On Sep 27, 10:22 am, Tom Robinson <t...@280north.com> wrote:
> Short answer: Yes. Currently the best (only?) way to embed a  
> Cappuccino application in another page is to use an iframe. Simply set  
> the iframe src to the Cappuccino application's index.html file.
>
> Long answer: No. It's not currently possible to place a Cappuccino  
> ...
Reply all
Reply to author
Forward
0 new messages