Re: Long delay of NSPopUpButton first click

2011-09-06 Thread Rimas M.
On Mon, Aug 29, 2011 at 6:40 PM, Glenn L. Austin gl...@austin-soft.comwrote: ... Also, just because you're using an image for the menu item doesn't mean that you can't set the title of the item. Yes - I can set the title of item with an image, but I don't need duplicated title which is

Re: Long delay of NSPopUpButton first click

2011-09-06 Thread Rimas M.
On Wed, Aug 31, 2011 at 6:04 PM, Glenn L. Austin gl...@austin-soft.comwrote: Having worked on that code at one time, they are doing *exactly* what I outlined -- they are pre-creating item images (image with mask) and putting plain text titles in the menu item and drawing the images with the

Re: Long delay of NSPopUpButton first click

2011-09-06 Thread Rimas M.
OK. Answering by myself - to avoid title duplication it is possible by setting small-invisible attributed title. Rimas M. On Tue, Sep 6, 2011 at 9:47 AM, Rimas M. apple.list...@gmail.com wrote: Going to try masked image way right now. As for plain text title, I am confused, because if I do

Re: Long delay of NSPopUpButton first click

2011-09-06 Thread Glenn L. Austin
On Sep 5, 2011, at 11:44 PM, Rimas M. wrote: On Mon, Aug 29, 2011 at 6:40 PM, Glenn L. Austin gl...@austin-soft.com wrote: ... Also, just because you're using an image for the menu item doesn't mean that you can't set the title of the item. Yes - I can set the title of item with

Re: Long delay of NSPopUpButton first click

2011-09-06 Thread Rimas M.
M.. Actually not. I am using setImage: of NSMenuItem to keep default highlighted item selection drawing and large menu scrolling with scroll-wheel. Rimas M. On Tue, Sep 6, 2011 at 4:40 PM, Glenn L. Austin gl...@austin-soft.comwrote: Yes, you will need to set the item's title, unless

Re: Long delay of NSPopUpButton first click

2011-08-31 Thread Rimas M.
On Mon, Aug 29, 2011 at 7:13 PM, Jens Alfke j...@mooseyard.com wrote: On Aug 28, 2011, at 11:25 PM, Rimas M. wrote: Well.. that worked. Generally. But those images must have transparent background. And as I have discovered, when dealing with text drawing, that causes loose of sub-pixels

Re: Long delay of NSPopUpButton first click

2011-08-31 Thread Glenn L. Austin
On Aug 31, 2011, at 2:19 AM, Rimas M. wrote: On Mon, Aug 29, 2011 at 7:13 PM, Jens Alfke j...@mooseyard.com wrote: On Aug 28, 2011, at 11:25 PM, Rimas M. wrote: Well.. that worked. Generally. But those images must have transparent background. And as I have discovered, when dealing with

Re: Long delay of NSPopUpButton first click

2011-08-31 Thread Jens Alfke
On Aug 31, 2011, at 2:19 AM, Rimas M. wrote: Not really. Unless I am missing something. Menu-item's background is changing when item is selected (blue one, by default). C’mon, be creative. Cache two copies of the image, one with the plain background and one with the highlighted.

Re: Long delay of NSPopUpButton first click

2011-08-31 Thread Kyle Sluder
On Wed, Aug 31, 2011 at 10:05 AM, Jens Alfke j...@mooseyard.com wrote: On Aug 31, 2011, at 2:19 AM, Rimas M. wrote: Not really. Unless I am missing something. Menu-item's background is changing when item is selected (blue one, by default). C’mon, be creative. Cache two copies of the image,

Re: Long delay of NSPopUpButton first click

2011-08-29 Thread Rimas M.
Well.. that worked. Generally. But those images must have transparent background. And as I have discovered, when dealing with text drawing, that causes loose of sub-pixels antialiasing. This is unacceptable. Will need to use NSAttributedString+attributedTitle way... Any hints on speeding up menu

Re: Long delay of NSPopUpButton first click

2011-08-29 Thread Glenn L. Austin
If you use text drawing, your first click will be slow. That's the penalty of loading each font. That's why -- at least internally -- the menu code caches the image of each item, so that the second and subsequent displays of the menu will be quick. You really have two solutions -- pre-image

Re: Long delay of NSPopUpButton first click

2011-08-29 Thread Jens Alfke
On Aug 28, 2011, at 11:25 PM, Rimas M. wrote: Well.. that worked. Generally. But those images must have transparent background. And as I have discovered, when dealing with text drawing, that causes loose of sub-pixels antialiasing. This is unacceptable. Will need to use

Re: Long delay of NSPopUpButton first click

2011-08-04 Thread Rimas M.
Drawing item titles into image and caching them for later use works nice. But I have noticed unacceptable side effect. Normally, when menu is displayed you can press any letter key, and menu will scroll to the first item, which title starts with that letter. In my case , NSMenuItems does not have

Re: Long delay of NSPopUpButton first click

2011-08-03 Thread Rimas M.
Hi Glenn, Thank you for answering. Now I can understand why menu item title is black in fonts popup of iWork apps. Even if they are selected. Regards, RImas M. On Tue, Aug 2, 2011 at 6:13 PM, Glenn L. Austin gl...@austin-soft.comwrote: Yes -- don't do that!!! You are asking the system to

Long delay of NSPopUpButton first click

2011-08-02 Thread Rimas M.
Hello list, I am trying to do quite simple thing - add a popup with all fonts, available on system. Each item of menu, should be displayed in corresponding font. As an example could be all iWork apps. When you dealing with text, you have a popup with fonts, and each font name is displayed with

Re: Long delay of NSPopUpButton first click

2011-08-02 Thread Glenn L. Austin
On Aug 2, 2011, at 6:42 AM, Rimas M. wrote: Hello list, I am trying to do quite simple thing - add a popup with all fonts, available on system. Each item of menu, should be displayed in corresponding font. As an example could be all iWork apps. When you dealing with text, you have a popup