Re: Setting image one pulldown popup button
Christiaan Hofman <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
On Dec 7, 2009, at 14:32, Hamish Allan wrote: > On Mon, Dec 7, 2009 at 1:19 PM, Christiaan Hofman <[email protected]> wrote: > >> However, the sample code does not have a popup like I have, without border and only an image. That still does not work. > > Then I would suggest adding a popup *to* the sample code in the most > minimally-impacting way possible, testing in increments as small as > you can. > > H Thanks, that does tell me something. To some extent. I do get a popup with an image. But the image is completely misplaced. There is a huge margin on the left, even with NSImageOnly and NSPopUpNoArrow. In fact, the margin gets even bigger for smaller frame sizes. Nothing at all like a borderless button, which is what I would expect. I see now that with my own code and image the image falls outside the frame. I think that's wrong. That said, I must stress that I am 100% confident that a while back setting the image in code did not work at all, in a different instance where I know the problem was not that it was shown outside the frame, because that same code is working now and setting in IB did work then. The fact that I tried then for so many hours was a reason that I was not trying very hard this time, because I assumed this was the same problem. The conclusion seems to be that I still need to use a subclass. Christiaan