Re: NSMapTable with C strings as keys

2013-05-27 Thread Michael Crawford
Cryptographic hashes such as md5 are intensive to calculate because
they are meant to make it difficult for an attacker to come up with
different inputs that output identical hashes.

For purposes of looking up strings in a hash table, a 32 bit CRC
(Cyclic Redundancy Check) would be quick to calculate with few
collisions.  It also doesn't require multiprecision arithmetic.

Mike Crawford
mdcrawf...@gmail.com

On Mon, May 27, 2013 at 11:25 PM, Oleg Krupnov  wrote:
> Hi Jens,
>
> I guess you may be right. But… two questions in this regard:
>
> 1. I thought that "isEqual" method is alternative to "hash" method,
> because searching by key and searching by hash are two mutually
> exclusive methods of looking up values, aren't they?
>
> 2. What hash function you'd suggest in my case, that would calculate
> unsigned int on output, for C strings? Because calculating hash
> functions (such as md5) may be computationally expensive, which could
> undermine my entire idea of sparing extra few calls on creating
> NSStrings :)
>
> Thanks!
>
> On Tue, May 28, 2013 at 9:08 AM, Jens Alfke  wrote:
>>
>> On May 27, 2013, at 10:46 PM, Oleg Krupnov  wrote:
>>
>> Now, the problem is that sometimes when I try to get a value from the
>> table, the MapTableKeyComparator function is not called at all, and
>> NSMapGet returns NULL, thought immediate dump of the table shows that
>> all previous records are perfectly present in the table.
>>
>>
>> Probably because you haven’t implemented a hash function, only an equals
>> function. I’m guessing NSMapTable’s default hash function merely hashes the
>> key pointer itself, which means that if you pass it a different pointer to
>> an equal C string, it won’t find anything.
>>
>> —Jens
>>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/mdcrawford%40gmail.com
>
> This email sent to mdcrawf...@gmail.com



-- 
Michael David Crawford
mdcrawford at gmail dot com

  Custom Software Development for the iPhone and Mac OS X
  http://www.dulcineatech.com/custom-software-development/

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSMapTable with C strings as keys

2013-05-27 Thread Oleg Krupnov
Hi Jens,

I guess you may be right. But… two questions in this regard:

1. I thought that "isEqual" method is alternative to "hash" method,
because searching by key and searching by hash are two mutually
exclusive methods of looking up values, aren't they?

2. What hash function you'd suggest in my case, that would calculate
unsigned int on output, for C strings? Because calculating hash
functions (such as md5) may be computationally expensive, which could
undermine my entire idea of sparing extra few calls on creating
NSStrings :)

Thanks!

On Tue, May 28, 2013 at 9:08 AM, Jens Alfke  wrote:
>
> On May 27, 2013, at 10:46 PM, Oleg Krupnov  wrote:
>
> Now, the problem is that sometimes when I try to get a value from the
> table, the MapTableKeyComparator function is not called at all, and
> NSMapGet returns NULL, thought immediate dump of the table shows that
> all previous records are perfectly present in the table.
>
>
> Probably because you haven’t implemented a hash function, only an equals
> function. I’m guessing NSMapTable’s default hash function merely hashes the
> key pointer itself, which means that if you pass it a different pointer to
> an equal C string, it won’t find anything.
>
> —Jens
>

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSMapTable with C strings as keys

2013-05-27 Thread Jens Alfke

On May 27, 2013, at 10:46 PM, Oleg Krupnov  wrote:

> Now, the problem is that sometimes when I try to get a value from the
> table, the MapTableKeyComparator function is not called at all, and
> NSMapGet returns NULL, thought immediate dump of the table shows that
> all previous records are perfectly present in the table. 

Probably because you haven’t implemented a hash function, only an equals 
function. I’m guessing NSMapTable’s default hash function merely hashes the key 
pointer itself, which means that if you pass it a different pointer to an equal 
C string, it won’t find anything.

—Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

NSMapTable with C strings as keys

2013-05-27 Thread Oleg Krupnov
I'd like to have a dictionary using C strings as keys (because I
already have const char* strings and would like to spare on creating
NSString wrappers) and C structures as values.

I thought using NSMapTable would be a good idea for this.

Here is my code:

// function for comparing string keys
static BOOL MapTableKeyComparator(NSMapTable* table, const void* key1,
const void* key2)
{
int result = strcmp((const char*)key1, (const char*)key2);
return result == 0;
}


NSMapTable* _table;

…

NSMapTableKeyCallBacks keyCallbacks = NSNonOwnedPointerMapKeyCallBacks;

keyCallbacks.isEqual = MapTableKeyComparator;

NSMapTableValueCallBacks valueCallbacks = NSNonOwnedPointerMapValueCallBacks;

_table = NSCreateMapTable(keyCallbacks, valueCallbacks, 0);

…

NSMapInsert(_table, name, value);

…

value = NSMapGet(_table, name);


Now, the problem is that sometimes when I try to get a value from the
table, the MapTableKeyComparator function is not called at all, and
NSMapGet returns NULL, thought immediate dump of the table shows that
all previous records are perfectly present in the table. The bug
happens sporadically, at different moments. Sometimes it happens at
the line of code where it perfectly worked on last debug session.

What could be wrong?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Building an MVC based App for Mac OS X - NOT for iOS

2013-05-27 Thread Quincey Morris
On May 27, 2013, at 20:34 , YT  wrote:

> Here is an extracted section

I found the section of documentation you're referring to (it wasn't easy, you 
didn't give us much to go on).

The short answer to your concern is that this piece of documentation is just 
plain wrong. If you need to add a view-specific controller, it should be a 
NSViewController, or a subclass, and not a subclass of NSController. 
NSController subclasses serve a different purpose -- they are "mediating" 
controllers, which is a respectable name for class-wrapped glue code. 

If you're coming from iOS, the nearest equivalent to UIViewController is 
NSWindowController -- *not* NSViewController, and certainly not NSController.

When starting a new Mac app, the Cocoa classes you need to pay immediate 
attention to are:

-- the app delegate (a custom class you define)

-- if it's a document-based app, a NSDocument subclass

-- for each window in your app a NSWindowController subclass

In the broadest MVC terms, the "C" is often a NSWindowController subclass. The 
"M" is often the app delegate *or* a NSDocument subclass, or is a more 
specialized object graph to which the app delegate or document holds a 
reference. The "V" is the window and its contained views.

However, it's a bit difficult to advise you more specifically on this without 
knowing whether your app is document-based or non-document-based.

Stay away from NSViewController until and unless you find that you need it, and 
know why you need it. It isn't UIViewController. Rather, it's a sort of 
specialized NSWindowController, but for independently-loaded views instead of 
windows.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Building an MVC based App for Mac OS X - NOT for iOS

2013-05-27 Thread Jens Alfke

On May 27, 2013, at 8:34 PM, YT  wrote:

> SO what I am after is a ViewController.  I have a View placed in a Window 
> where I use Quartz 2D to draw graphics into and need a Controller.  The 
> Interface Builder was trying to force me to place ACTIONS AND OUTLETS in the 
> Delegate files.
> I found that (as a nubee) very disconcerting and confidence shaking with 
> regard to my experience with using an MVC.

It’s pretty common to have a window controller, and make it responsible for 
managing the views in the window too. (NSViewController wasn’t added until OS X 
10.5 or so.)

You can use NSViewController if you want to be more modular, especially if you 
want to use the same view (or view hierarchy) in multiple windows, but it’s not 
any more or less MVC compliant. It’s just a difference in what granularity you 
make your controllers. Also, “controller” is really just a role in a design 
pattern; it doesn’t have to inherit from some system class with “Controller” in 
the name to be a valid controller.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Building an MVC based App for Mac OS X - NOT for iOS

2013-05-27 Thread YT

On May 27, 2013, at 7:56 PM, Jens Alfke  wrote:

> 
> On May 27, 2013, at 6:46 PM, Keary Suska  wrote:
> 
>> Mac OS X development os much more complicated than iOS development. It is 
>> not likely somehting you can just dive into without a learning curve.
> 
> Well, it’s different. Coming from OS X, I’ve found iOS UI development the 
> more difficult of the two, because the UI is so much more limited, there is 
> no document model or user-accessible filesystem, there’s very little you can 
> do when in the background, etc. 
> 
> I don’t think either is diveable-into, even if you’re comfortable with the 
> other.
> 
> Anyway, to answer YT’s original question: To create new controllers you can 
> use the New File… command and create a new OS X NSWindowController or 
> NSViewController subclass. Xcode will put boilerplate code in the new files 
> and even create .xibs. If you’re creating a document-based app you may want 
> to create an NSDocument subclass, which is higher-level and abstracts the 
> file I/O for you.
> 
> —Jens

SO...  I'm not sure if I did this correctly BUT...  I may have found a miss 
type in the Apple Guide: Edit User Interfaces

Here is an extracted section

Doc extract--
Add a New Controller
Every nib file is created with a File’s Owner object, which you link to the 
controller for the file. In the rare event that you need to add another 
controller to a nib file (to control a subview, for example), you need to 
create source files for the controller and add a controller object to the nib 
file so that you can make connections to the controller.
To add a controller to a user interface file:
Add the header and implementation files to your project.
Select the Objective-C Class template, enter your custom controller class’s 
name, and specifyNSController as its superclass.
From the Object library, drag an Object object to the Interface Builder dock.
Select the custom view and specify its class as the class you added in step 1 
by identifying it in the Identity inspector.

To see the outlets and actions provided by the controller, select the 
controller object in the dock and open the Connections inspector. To add new 
actions or outlets to the controller, see “Make Connections Directly Between 
User Interface Objects and Your Source Files.
DONE 

I followed the above selecting the custom view and it didn't work.

I THINK in Step 3 "Select the custom view" should read "Select the Object 
object".

SO what I am after is a ViewController.  I have a View placed in a Window where 
I use Quartz 2D to draw graphics into and need a Controller.  The Interface 
Builder was trying to force me to place ACTIONS AND OUTLETS in the Delegate 
files.
I found that (as a nubee) very disconcerting and confidence shaking with regard 
to my experience with using an MVC.

So in Step 1 above I created MyViewController files SuperClass NSView. 
In Step 2 & 3 I dragged a Object object into the Builder Doc and in the 
inspector classed it as MyViewController.  
THEN (perhaps an important tip) I went to the File's Owner in the Builder Doc, 
open the connection list and disconnected the auto generated Delegate 
connection from the File's Owner Outlets.  
THEN I opened the Helper Editor and it automatically brought up the Delegate.h
THEN I manually switched the Helper file to MyController.h
AND the BUILDER allowed me to set the ACTION and OUTLETs in the MyController 
file.

Well my tests have worked so far SO now I will give it go on placing 
graphics data into a model.
AND the interactive element ACTIONS AND OUTLETS into the Controller. 

YT





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Building an MVC based App for Mac OS X - NOT for iOS

2013-05-27 Thread Jens Alfke

On May 27, 2013, at 6:46 PM, Keary Suska  wrote:

> Mac OS X development os much more complicated than iOS development. It is not 
> likely somehting you can just dive into without a learning curve.

Well, it’s different. Coming from OS X, I’ve found iOS UI development the more 
difficult of the two, because the UI is so much more limited, there is no 
document model or user-accessible filesystem, there’s very little you can do 
when in the background, etc. 

I don’t think either is diveable-into, even if you’re comfortable with the 
other.

Anyway, to answer YT’s original question: To create new controllers you can use 
the New File… command and create a new OS X NSWindowController or 
NSViewController subclass. Xcode will put boilerplate code in the new files and 
even create .xibs. If you’re creating a document-based app you may want to 
create an NSDocument subclass, which is higher-level and abstracts the file I/O 
for you.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Building an MVC based App for Mac OS X - NOT for iOS

2013-05-27 Thread Keary Suska
On May 27, 2013, at 7:04 PM, YT wrote:

> I'm running 
> OS X 10.8.3 (Mountain Lion)
> XCODE 4.6.1
> on MacBook
> 
> 
> When I create a NEW project 
> Selecting
> Mac OS X => Application => Cocoa Application 
> 
> The end results does not automatically generate Controller.(m,h) files 

It does, kind of. The app delegate may be considered a kind of controller, 
though not in the same sense as iOS.

> WHY NOT?

Because iOS is not Mac OS X--they may have some similar underpinnings, but they 
really are two different operating systems. Would you expect programing Windows 
to work the same OS X, considering that from a user-interaction point of view 
they share more concepts than iOS?

The short answer is that unlike iOS, Mac apps do not necessarily have a primary 
window. In fact, a Mac app may have no GUI at all. Thus there is no good 
"default" choice for a controller.

Really, in a Mac App what happens in main.m is all that is needed to launch a 
fully-functional app, even though it won't do anything. That's the Mac OS X 
starting point. Everything from there you have to build yourself.

> You automatically get Controller files when creating an iOS based App.
> 
> SO!  I've been trying to create Controller files that I can set up 
> connections to like Target-Actions and Outlets in the Interface Editor. 
> So far I have not been successful using instructions I found in the Apple 
> Guide: Edit User Interfaces.
> 
> Perhaps there is a better Guide on setting up an MVC for Mac OS X Apps or 
> maybe there is a little know incantation some one might hare with me?

Mac OS X development os much more complicated than iOS development. It is not 
likely somehting you can just dive into without a learning curve. There are 
plenty of good books on Mac OS X development--you may want to pick one up.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Auto Layout & NSScrollViews

2013-05-27 Thread Keary Suska
I am hoping someone has run into this problem and has a suggestion or two: I am 
building an Xcode-like inspector. Each collapsible "pane" is in its own xib and 
is loaded in the window controller's windowDidLoad. If I load just a single 
pane, it works beautifully out-of-the-box. If I add a second pane, auto layout 
bombs with constraint conflicts.

So I tried to follow advice about working with NSScrollViews and auto layout by 
using an "adaptor" view. This seems to resolve the conflicts but for some 
reason the adaptor view always loads with a zero height (even though it is not 
this way in the nib) and so everything gets squashed into oblivion.

There is a gotcha, perhaps, and that is that I need all of the subviews of the 
adaptor view to conform to the width of the clipview's viewable area, so I 
can't fix the width, but heights are already fixed.

Anyone know why auto layout squashes everything into a zero height? If I don't 
set the document view as not resizable in initWithFrame: it squashes the 
ScrollView too. Bizarre.

TIA,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Building an MVC based App for Mac OS X - NOT for iOS

2013-05-27 Thread YT
I'm running 
OS X 10.8.3 (Mountain Lion)
XCODE 4.6.1
on MacBook


When I create a NEW project 
Selecting
Mac OS X => Application => Cocoa Application 

The end results does not automatically generate Controller.(m,h) files 

WHY NOT?

You automatically get Controller files when creating an iOS based App.

SO!  I've been trying to create Controller files that I can set up connections 
to like Target-Actions and Outlets in the Interface Editor. 
So far I have not been successful using instructions I found in the Apple 
Guide: Edit User Interfaces.

Perhaps there is a better Guide on setting up an MVC for Mac OS X Apps or maybe 
there is a little know incantation some one might hare with me?

Thanks

YT 

I actually had a Snow Crash on my iMac. Maybe that is why I'm floundering. 



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


UIWebview back/forward buttons

2013-05-27 Thread Koen van der Drift
I'm looking for a way to get a simple left/right pointing arrow to use with a 
UIBarButtonItem in my toolbar under a UIWebView.  The closest that iOS provides 
are the UIBarButtonSystemItemRewind and UIBarButtonSystemItemFastForward 
button, but there are no left/right pointing triangles available in iOS.  I 
tried some Unicode variants, but they don't look right or are just too plain 
ugly IMHO.

Are there any alternatives that look good on iOS?

Thanks,

- Koen.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Show / hide application menu / icon in dock / windows cycling / ...

2013-05-27 Thread Ken Thomases
On May 27, 2013, at 6:30 AM, Robert Vojta wrote:

> Tried to change activation policy and it does work partially. LSUIElement = 1 
> equals to NSApplicationActivationPolicyAccessory. According to the 
> documentation, I can change it to NSApplicationActivationPolicyRegular to 
> show menu and show app icon in cycling. But anyway, it's not possible to go 
> back from NSApplicationActivationPolicyRegular to 
> NSApplicationActivationPolicyAccessory. setActivationPolicy: always returns 
> NO and it's correct according to the documentation: Currently, 
> NSApplicationActivationPolicyNone and NSApplicationActivationPolicyAccessory 
> may be changed to NSApplicationActivationPolicyRegular, but other 
> modifications are not supported.

That's what the docs say although, apparently, since Lion you can also set it 
to NSApplicationActivationPolicyProhibited.  See 
,
 keeping in mind that Eric Schlegel is an Apple developer.

That doesn't particularly help you, though.

> Is there another way how can I achieve this behavior? LSUIElement = YES 
> application with menu/app icon in dock/... for just one particular window? 
> Other windows can't be opened in the same time and this is just the only 
> visible window.

No.  The usual recommendation is to launch a helper app, one which is not an 
LSUIElement, to handle the interaction.

Regards,
Ken


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Show / hide application menu / icon in dock / windows cycling / ...

2013-05-27 Thread Robert Vojta
Hi all,  

I've got application (Mac Application Store, deployment target >= 10.8), which 
has LSUIElement set to YES in Info.plist. It's status bar application. I do 
open windows without menu in menu bar and app icon is not visible in dock, 
cycling, … Just what I need.

But now, I've got one window, which is wizard/tour/... and I would like to show 
menu for this one window and I also would like to have it visible in cycling 
(cmd-tab windows switching).

Tried to change activation policy and it does work partially. LSUIElement = 1 
equals to NSApplicationActivationPolicyAccessory. According to the 
documentation, I can change it to NSApplicationActivationPolicyRegular to show 
menu and show app icon in cycling. But anyway, it's not possible to go back 
from NSApplicationActivationPolicyRegular to 
NSApplicationActivationPolicyAccessory. setActivationPolicy: always returns NO 
and it's correct according to the documentation: Currently, 
NSApplicationActivationPolicyNone and NSApplicationActivationPolicyAccessory 
may be changed to NSApplicationActivationPolicyRegular, but other modifications 
are not supported.

Is there another way how can I achieve this behavior? LSUIElement = YES 
application with menu/app icon in dock/... for just one particular window? 
Other windows can't be opened in the same time and this is just the only 
visible window.

Thanks,
Robert

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Restricted FontPanel

2013-05-27 Thread Gerriet M. Denkmann

On 27 May 2013, at 17:26, Uli Kusterer  wrote:

> On 26.05.2013, at 13:48, Gerriet M. Denkmann  wrote:
>> I want (on OS X 10.8.3) to show a font panel, which only has nice fonts 
>> (e.g. only fonts which are able to show "门").
> 
> Have you tried whether you can just create a classic font menu for this 
> purpose? Leave the font panel alone, and just have a menu dedicated to only 
> showing 'nice fonts' ? Those will then be faster to access, and you don't 
> have to do so much work.

I made a Panel with a TableView which displays eligible font names.
The use is: in Preferences the user can choose some suitable default fonts 
(depending on some choices, as "Serif" vs. "SansSerif", etc.).

As the list of eligible fonts changes according to these parameters, I think a 
TableView is a better fit than a menu.
> 
> Of course, it gets a little unmanageable if you have a case where all (or 
> most of) the fonts are considered 'nice' by whatever algorithm you plan to 
> apply.

No problem. There are no more than a dozen.


Kind regards,

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Restricted FontPanel

2013-05-27 Thread Uli Kusterer
On 26.05.2013, at 13:48, Gerriet M. Denkmann  wrote:
> I want (on OS X 10.8.3) to show a font panel, which only has nice fonts (e.g. 
> only fonts which are able to show "门").

 Have you tried whether you can just create a classic font menu for this 
purpose? Leave the font panel alone, and just have a menu dedicated to only 
showing 'nice fonts' ? Those will then be faster to access, and you don't have 
to do so much work.

 Of course, it gets a little unmanageable if you have a case where all (or most 
of) the fonts are considered 'nice' by whatever algorithm you plan to apply.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com