Pop Up Button, size and style

Hi, have this Code:

PopupMenu.Open

[code]const NSPopUpArrowAtBottom = 2
const NSTexturedRoundedBezelStyle = 11

const CocoaLib = “Cocoa.framework”

declare function NSClassFromString lib CocoaLib (className as CFStringRef) as ptr

declare function cell lib CocoaLib selector “cell” (id as integer) as integer
declare function frame lib CocoaLib selector “frame” (id as integer) as NSRect
declare sub setFrame lib CocoaLib selector “setFrame:” (id as integer, frameRect as NSRect)
declare sub setPullsDown lib CocoaLib selector “setPullsDown:” (id as integer, value as Boolean)
declare sub setArrowPosition lib CocoaLib selector “setArrowPosition:” (id as integer, value as integer)
declare sub setBezelStyle lib CocoaLib selector “setBezelStyle:” (obj_id as integer, value as integer)

dim ctrlHandle as integer = me.Handle
dim cellHandle as integer = cell(ctrlHandle)

setBezelStyle(cellHandle, NSTexturedRoundedBezelStyle)
// setpullsDown(cellHandle, true ) // Text will not change
//setArrowPosition(cellHandle, NSPopUpArrowAtBottom) // Text will not change[/code]

NSRect (Structure)

x As Single y As Single h As Single w As Single

I only wanna see the Bottom Arrow, but if i set it via

setpullsDown(cellHandle, true ) // Text will not change setArrowPosition(cellHandle, NSPopUpArrowAtBottom) // Text will not change
i’ll see the Arrow, but if i change the PopupMenus ListIndex nothing will happens. Why?

Two things:
#1 Your NSRect struct is not 64-Bit compatible, suggest updating to “R4” and using the new CGFloat instead.
#2 setPullsDown changes the function of the Popup menu, not just the display.

If you want to use a Popup menu as a selector (like an option on a form) then leave it as it is. If you want to use it as a menu for performing actions, just like the “Action” menu within a Finder window, then setPullsDown to YES.

Last but not least, the “NSTexturedRoundedBezelStyle” should only be used on a Popupmenu when it’s in the toolbar, according to the AHIG.

Hi @Sam Rowlands,
I know the OS X Human Interface Guidlines says use “NSTexturedRoundedBezelStyle” only in a Toolbar. I have a Quickedit-Bar under my Toolbar and i love to use this Style to get my App more “stylish” :wink:
Sample Pic of Papersapp

Can’t use CGFloat, because working with R2014.2 :slight_smile:

Thanks Sam for your request, now i am more clear :slight_smile:

App looks cool. Did you use a listbox (left side) and how did you insert the vibrancy or is it a fake ?

It’s not mine :slight_smile: I like it to! But If you use @jean-paul devulder dtPlugins OSX it’s native possible with dtSourceList :slight_smile: (OS X only!)

I thought that but 3rd party tools/plugins are actually not my thing although some can be very useful.

Looks good mate, now I can see why’d you want it to be that style. The Quickedit-Bar is a sub toolbar, so that’s fine.

As for getting it to work like a Popupmenu, but use a Action menu style, I think you’re going to have to do some hacking to get it to look right. Maybe even create a custom control, at which point you sorta have to ask yourself is it worth it, or should I just give in an accept the uglky Popupmenus?

I really dislike the look of Popupmenus on Yosie & El Cap, mind you, I’m not a big fan of flatish interfaces for a desktop computer either.