Christiaan Hofman | 1 Nov 2010 12:22
Picon

WebKit favicon for bookmarks and history

In an app that supports browsing using WebKit, I want to use cached favicons from sites for menus for history
and bookmarks.

For the history I can in theory use -[WebHistoryItem icon] to get the cached icon. The problem with this is
that this only uses icons for sites that were loaded during the run, not icons cached on disk from previous
runs. So somehow reading the cached database is not working. BTW, I have confirmed that the icon database
is in fact enabled (WebIconDatabaseEnabled pref is set to YES), and also that the icon database file is
changed by my app, and includes new items (database located at default location
~/Library/Icons/WebpageIcons.db, but I also have tried it with a custom location set through the
WebIconDatabaseDirectoryDefaultsKey pref). 

For the bookmarks, I can find no API whatsoever, only SPI through the private WebIconDatabase class. Is
there a reason this class is not made private? the header does like designed as for a public class, and it
certainly has public uses. Is there another, public, way to get to it?

I am somewhat surprised it does not work, given that several webkit based browser, such as Safari and
OmniWeb, do use favicons for the history and bookmarks. Are they actually using SPI?

Thanks,
Christiaan
Christiaan Hofman | 6 Nov 2010 14:23
Picon

Calendar to use for smart groups

In our app we have a notion of smart groups that can also use date conditions, such as "this week" or "in the
last month", as in Mail.app's smart mailboxes. These should be properly interpreted in terms of actual
data ranges, for which we use NSCalendar. Currently we are using the standard NSCGregorianCalendar for
this. However, would it be better to use the currentCalendar instead?

I wonder what Apple's apps like Mail.app do in such cases. I cannot really make sense of what it does though.
For instance, a smart mailbox for date received "is this week" always seems to give me dates starting on
sunday, no matter if my preferred first weekday is sunday or monday, and this is also not consistent with
the standard NSGregorianCalendar, which always has monday as firstWeekDay, so then what is it using?

Christiaan
Abhijeet Singh | 22 Nov 2010 10:54
Favicon
Gravatar

How to avoid multiple clicks on a push button

Hi,I am working on a user interface. There is only one window in my application with Back and Next buttons on
it. On Next / Back button click my application performs some task and the current view is swapped with
another view in the window. It works fine until somebody clicks Next (or Back) button twice in succession
like a double click. The event is fired 2 times and it messes up the whole functionality of my application. I
tried controlling this behavior by disabling the buttons as soon as they are clicked but it doesn't help.
Still the event is fired multiple times. Is there any way i can control this behavior of the push buttons.
Please help....RegardsAbhijeetDear macosxdev ! Get Yourself a cool, short  <at> in.com Email ID now!
Eric Gorr | 22 Nov 2010 22:42
Favicon

Controls & Key Equivalents

One is allowed to assign key equivalents to controls like Push Buttons. 

For example, one might assign Cmd-P to push button. Would you make any attempt to let the user know that
pressing Cmd-P is the same as clicking on that button? (Perhaps, via a tooltip, in the label of the control,
etc.) Or, would you expect the user to learn about such equivalents in the documentation alone?
Christiaan Hofman | 22 Nov 2010 22:59
Picon

Re: Controls & Key Equivalents


On Nov 22, 2010, at 22:42, Eric Gorr wrote:

> One is allowed to assign key equivalents to controls like Push Buttons. 
> 
> For example, one might assign Cmd-P to push button. Would you make any attempt to let the user know that
pressing Cmd-P is the same as clicking on that button? (Perhaps, via a tooltip, in the label of the control,
etc.) Or, would you expect the user to learn about such equivalents in the documentation alone?

That depends entirely on the situation. In particular how obvious the shortcut is. For instance, Enter for
a default button, Escape for a Cancel button, Cmd-. for a stop button, Cmd-D for a "Don't" button are so
common that they don't need explanation. Cmd-P should probably not be used as a key equivalent, as it is a
standard shortcut for the Print menu item (though it would be acceptable for a Print button, in which case
it would be clear.)

Christiaan
Eric Gorr | 22 Nov 2010 23:04
Favicon

Re: Controls & Key Equivalents


On Nov 22, 2010, at 4:59 PM, Christiaan Hofman wrote:

> 
> On Nov 22, 2010, at 22:42, Eric Gorr wrote:
> 
>> One is allowed to assign key equivalents to controls like Push Buttons. 
>> 
>> For example, one might assign Cmd-P to push button. Would you make any attempt to let the user know that
pressing Cmd-P is the same as clicking on that button? (Perhaps, via a tooltip, in the label of the control,
etc.) Or, would you expect the user to learn about such equivalents in the documentation alone?
> 
> That depends entirely on the situation. In particular how obvious the shortcut is. For instance, Enter
for a default button, Escape for a Cancel button, Cmd-. for a stop button, Cmd-D for a "Don't" button are so
common that they don't need explanation. Cmd-P should probably not be used as a key equivalent, as it is a
standard shortcut for the Print menu item (though it would be acceptable for a Print button, in which case
it would be clear.)

Pretend it was some other letter that isn't common for some app specific functionality.
Christiaan Hofman | 22 Nov 2010 23:18
Picon

Re: Controls & Key Equivalents


On Nov 22, 2010, at 23:04, Eric Gorr wrote:

> 
> On Nov 22, 2010, at 4:59 PM, Christiaan Hofman wrote:
> 
>> 
>> On Nov 22, 2010, at 22:42, Eric Gorr wrote:
>> 
>>> One is allowed to assign key equivalents to controls like Push Buttons. 
>>> 
>>> For example, one might assign Cmd-P to push button. Would you make any attempt to let the user know that
pressing Cmd-P is the same as clicking on that button? (Perhaps, via a tooltip, in the label of the control,
etc.) Or, would you expect the user to learn about such equivalents in the documentation alone?
>> 
>> That depends entirely on the situation. In particular how obvious the shortcut is. For instance, Enter
for a default button, Escape for a Cancel button, Cmd-. for a stop button, Cmd-D for a "Don't" button are so
common that they don't need explanation. Cmd-P should probably not be used as a key equivalent, as it is a
standard shortcut for the Print menu item (though it would be acceptable for a Print button, in which case
it would be clear.)
> 
> Pretend it was some other letter that isn't common for some app specific functionality.

That does not change my central answer: it depends (all the rest is illustration).

Christiaan
Eric Gorr | 22 Nov 2010 23:25
Favicon

Re: Controls & Key Equivalents

Ok.

Then, what solutions, if any, have you seen people use in modern cocoa applications?

On Nov 22, 2010, at 5:18 PM, Christiaan Hofman wrote:

> 
> On Nov 22, 2010, at 23:04, Eric Gorr wrote:
> 
>> 
>> On Nov 22, 2010, at 4:59 PM, Christiaan Hofman wrote:
>> 
>>> 
>>> On Nov 22, 2010, at 22:42, Eric Gorr wrote:
>>> 
>>>> One is allowed to assign key equivalents to controls like Push Buttons. 
>>>> 
>>>> For example, one might assign Cmd-P to push button. Would you make any attempt to let the user know that
pressing Cmd-P is the same as clicking on that button? (Perhaps, via a tooltip, in the label of the control,
etc.) Or, would you expect the user to learn about such equivalents in the documentation alone?
>>> 
>>> That depends entirely on the situation. In particular how obvious the shortcut is. For instance, Enter
for a default button, Escape for a Cancel button, Cmd-. for a stop button, Cmd-D for a "Don't" button are so
common that they don't need explanation. Cmd-P should probably not be used as a key equivalent, as it is a
standard shortcut for the Print menu item (though it would be acceptable for a Print button, in which case
it would be clear.)
>> 
>> Pretend it was some other letter that isn't common for some app specific functionality.
> 
> That does not change my central answer: it depends (all the rest is illustration).
(Continue reading)

Christiaan Hofman | 22 Nov 2010 23:47
Picon

Re: Controls & Key Equivalents


On Nov 22, 2010, at 23:25, Eric Gorr wrote:

> Ok.
> 
> Then, what solutions, if any, have you seen people use in modern cocoa applications?
> 

For what? Seriously, you ask a generic question on which I have now answered several times that there is no
generic answer (that's what "it depends" means). The ONLY specific context you have actually provided in
your question is one that you have later said is not really the context. Also, "common functionality" is
almost by definition NOT "app specific", so that sentence makes no sense to me. I made my point that if the
functionality is common/not app specific/standard, you need do nothing. On the other hand when it is NOT
common/standard/app specific, you probably shouldn't use key equivalents to begin with.

Christiaan

> 
> On Nov 22, 2010, at 5:18 PM, Christiaan Hofman wrote:
> 
>> 
>> On Nov 22, 2010, at 23:04, Eric Gorr wrote:
>> 
>>> 
>>> On Nov 22, 2010, at 4:59 PM, Christiaan Hofman wrote:
>>> 
>>>> 
>>>> On Nov 22, 2010, at 22:42, Eric Gorr wrote:
>>>> 
>>>>> One is allowed to assign key equivalents to controls like Push Buttons. 
(Continue reading)

Eric Gorr | 22 Nov 2010 23:56
Favicon

Re: Controls & Key Equivalents

On Nov 22, 2010, at 5:47 PM, Christiaan Hofman wrote:

> On Nov 22, 2010, at 23:25, Eric Gorr wrote:
> 
>> Ok.
>> 
>> Then, what solutions, if any, have you seen people use in modern cocoa applications?
>> 
> 
> For what? 

In Cocoa, one is allowed to assign key equivalent to controls like Push Buttons. The default
implementation of a Push Button does not provide any way to display to the user what that key equivalent is.

If you have seen any application which does display what that key-equivalent is, I would be interested in
learning what they did. One person mentioned elsewhere that they seemed to recall Mac OS used to show key
equivalents of the Don't Save, Cancel, Save buttons when the user held down the command key. I too seem to
have a vague memory of that, but, Apple seems to have dropped that particular UI design a long time ago.

If you still wanted further context for the original question, consider a push button on a modal dialog. 

Gmane