Re: how do I make chat bubbles using a custom cell
Re: how do I make chat bubbles using a custom cell
- Subject: Re: how do I make chat bubbles using a custom cell
- From: "I. Savant" <email@hidden>
- Date: Thu, 17 Jul 2008 09:09:58 -0400
> Now my another query is when I type a text into a textfield and press the send button how it comes on the same window with a bubble background.
> So far I am only getting a webview on window with a textfield and the colour of view is according to css file.
You're going to need a controller that listens for a return in the
text field (end of editing) and responds to the send button's action.
When either occurs, you'll get the string from the text field and
either a) recreate the entire HTML 'page' with all the messages in it
or, b) more efficiently use the DOM structure of the page to insert a
new div containing the latest message.
In the background, of course your controller will probably want to
maintain an array of all the messages as strings (or attributed
strings) so you can do further processing (like saving to a history
file, etc.).
All of the subjects above are covered in the documentation though
the DOM part is definitely not trivial given your relative "newness"
to all this. Here's what I suggest:
Go through all the introductory and basic Cocoa documentation,
online tutorials, etc. and just get the basic application running with
a standard text view. In other words, append each new message to the
text view with no special drawing or formatting. Once you have the
basics of your application working (which covers your basic learning
curve for Cocoa), then tackle the hard part - manipulating a web view
and a DOM structure to format the messages into a "pretty" view.
Either way you look at it, the first part is necessary and you have to
do that work anyway. By attacking the problem in that order, your
experience will grow at just the right pace necessary to tackle the
hard part later.
Besides, function first, then form is *usually* the best way to go
when designing a desktop application. As long as you follow the MVC
design pattern (also thoroughly covered in the documentation),
changing the form is easy. It's the function that's more difficult to
change later.
I hope this helps.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden