Alan Smith | 2 Aug 15:15 2007
Picon

Getting Real for Desktop Software

Hello everyone,

Yesterday I finished reading 'Getting Real,' the book by 37Signals. For
those of you who haven't read it, I highly recommend it, to buy a copy or
read the free online version go to http://getreal.37signals.com/ In 'Getting
Real' there is major emphasis on keeping a web app simple and clean. One
example was 37Signals did not add text coloring to their multi-person chat
app (Campfire) because it wasn't necessary. That got me thinking, that's
fine for a web app where there is a monthly fee instead of a one-time
registration fee and so you don't have to add features to get people to buy
it but, what about desktop apps? If you don't add little things like that
how are you going to keep people interested in it?

How do all of you write apps? I want to keep my apps sleek and thin but I
don't want them to become stagnant. Is there a book like 'Getting Real' for
desktop apps? If there is that would be fantastic, I'd love to read it.

Cheers. Alan

--

-- 
My blog: cocoalatte.info

// Things I've said -------------------------
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that personal beliefs are not something to argue or
fight over, it shall evolve."
Andreas Mayer | 2 Aug 16:30 2007
Picon

[ANN] AMSerialPort - new version


AMSerialPort is a collection of classes to access serial ports.

This version features an API that better matches Cocoa design  
principles, adds a wider range of read and write methods and is able  
to detect the addition and removal of ports.

For more information see:

http://www.harmless.de/cocoa.php

Regards,

Andreas
Michael Dupuis | 4 Aug 04:39 2007
Picon

NSPopUpButtonCell within NSTextFieldCell: disappearing text

Greetings,

I'm trying to implement a "complex" NSTextFieldCell,
based originally on ImageAndTextCell from the
DraggableOutlineView demo app, and I've got most of
what I need working, but I'm having one problem I
can't seem to resolve: When I have an
NSPopupButtonCell within my NSTextFieldCell, popping
up the menu for the button causes the text field text
to vanish until the menu tracking is done. I could see
the text of the NSTextFieldCell maybe not getting
redrawn potentially, but why it gets blanked out
completely while the menu is displayed, and then comes
back perfectly when the menu is dismissed I can't
understand.

A little code (some details omitted for brevity:

in drawWithFrame: inView:

I draw my image, just like the sample code, then call
super:

[super drawWithFrame:cellFrame inView:controlView];

then draw my popup button:

[popUpButtonCellOne drawWithFrame:
   NSMakeRect(POPUP_X_OFFSET, cellFrame.origin.y +
   POPUP_Y_OFFSET, 150.0, 24.0) inView:controlView];
(Continue reading)

Alan Smith | 4 Aug 05:11 2007
Picon

Re: NSPopUpButtonCell within NSTextFieldCell: disappearing text

Michael,

If you don't need the subclass to be a cell then I suggest making
things easier for yourself and subclassing NSTextField. That way you
can add the pop-up button as a sub-view.

If you would explain why you are attaching a pop-up button to a text
field it would be greatly appreciated.

It sounds like NSComboBox might be the kind of thing you are looking
for. If it helps any to know how NSComboBox works, the blue button
with the triangle on it is in fact a NSButton, or maybe a
NSButtonCell, I forget which. When the button is pressed a transparent
window with a table in it is popped up near the button. The editing
part is a NSTextField, again, it might be a cell, NSTextFieldCell.
Perhaps you'd find it easier to take this route and start from
scratch.

>From here it looks like if you are hooking up a NSPopUpButton to a
NSTextField and NSComboBox isn't the sort of thing you are trying to
accomplish you need to redesign your UI. By the way, it has been a
long time since I've seen NSComboBox used in a modern application. If
I have, they were disguised so I didn't notice.

Let me know why you need to do this, I'm curious.

Cheers, Alan

--

-- 
My blog: cocoalatte.info
(Continue reading)

Michael Dupuis | 4 Aug 05:27 2007
Picon

Re: NSPopUpButtonCell within NSTextFieldCell: disappearing text


--- Alan Smith <alanrogersmith@...> wrote:

> If you would explain why you are attaching a pop-up
> button to a text
> field it would be greatly appreciated.

Ah yes, that might help, I didn't mention what the
cell was for. It's an NSTableView cell that has
several labels and at least one popup menu in it. It's
definitely not an NSComboBox, it's a table cell that
displays a summary of information, and allows some
simple editing. Think Safari's Downloads window, or
something similar, where the cell is made up of an
image, two labels, and a couple of buttons.

      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!  
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 
David Dunham | 4 Aug 08:17 2007
Picon

Updating Align Left/Center/etc. for NSTextView

I'm doing something much like TextEdit, where I want to have a menu  
control text alignment. I want to place a checkmark (or a hyphen)  
next to the appropriate menu item(s) depending on whether the  
selected text is left aligned, centered, etc.

TextEdit doesn't do this. So I don't see an obvious way to do this.

To make things worse, I also want to update a toolbar icon (much like  
the one in NSRulerView) to also show alignment.

Any suggestions? The menu part is easy (I think), but I'm not sure  
how to efficiently track the selection changing. (Or am I worrying  
too much about observing every keystroke?)

David Dunham   www.pensee.com/dunham/
Imagination is more important than knowledge. -- Albert Einstein
Alan Smith | 4 Aug 14:33 2007
Picon

Re: NSPopUpButtonCell within NSTextFieldCell: disappearing text

Michael,

I suggest not subclassing NSTextFieldCell but NSCell. That way you
don't have to worry about overriding some of NSTextFieldCell's
behavior. If you override NSCell just create a NSTextFieldCell and
NSPopUpButtonCell as instance variables and draw them in
drawWithFrame::

Good luck!

Peace, Alan

--

-- 
My blog: cocoalatte.info

// Things I've said -------------------------
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that personal beliefs are not something to
argue or fight over, it shall evolve."
Scott Stevenson | 5 Aug 00:16 2007
Picon

Re: Updating Align Left/Center/etc. for NSTextView


On Aug 3, 2007, at 11:17 PM, David Dunham wrote:

> Any suggestions? The menu part is easy (I think), but I'm not sure  
> how to efficiently track the selection changing. (Or am I worrying  
> too much about observing every keystroke?)

Does NSTextView's -textViewDidChangeSelection: do what you want?

You'll probably also what to look at - 
textViewDidChangeTypingAttributes:.

     - Scott
David Dunham | 5 Aug 06:53 2007
Picon

Re: Updating Align Left/Center/etc. for NSTextView

On 3 Aug 2007, at 23:17, David Dunham wrote:

>  The menu part is easy (I think)

Hmm, harder than I was hoping. I not only have to determine if I  
should use typingAttributes, but most of the time the selection's  
paragraph is of NSNaturalTextAlignment. So how do I determine the  
"default alignment for script?"

I see this question was asked in 2004, with no answer. Yet somehow an  
NSTextView's ruler manages to show it correctly.

David Dunham     A Sharp, LLC
Voice/Fax: 206 783 7404     http://a-sharp.com
"People seem to misinterpret complexity as sophistication" -- Niklaus  
Wirth
David Dunham | 6 Aug 04:53 2007
Picon

Re: Updating Align Left/Center/etc. for NSTextView

> most of the time the selection's paragraph is of  
> NSNaturalTextAlignment. So how do I determine the "default  
> alignment for script?"

This part at least I figured out -- I'd imported some of the text,  
and used [NSParagraphStyle defaultParagraphStyle]. This uses  
NSNaturalTextAlignment. In my case it's probably better to be explicit.

David Dunham     A Sharp, LLC
Voice/Fax: 206 783 7404     http://a-sharp.com
"People seem to misinterpret complexity as sophistication" -- Niklaus  
Wirth

Gmane