Is it possible to set the height of a MenuItem. Now when a menuitem has 100 items then the height of menutiem is the screen height of the screen. I need to define my own height. I am on windows 10
no it is not possible… and I suggest if you have 100 menu items. that you
- create more drop downs
- create a multi-level menu (grouping similar topic items under one sub menu)
- step back and rethink your entire approach
On OS X you can set the view property of an NSMenuItem. Define an NSRect structure like this:
x As CGFloat
y As CGFloat
width As CGFloat
height As CGFloat
And then copy this code into App.Open:
[code]Declare Function NSClassFromString Lib “Foundation” (className As CFStringRef) As Ptr
Declare Function alloc Lib “Foundation” Selector “alloc” (NSClass As Ptr) As Ptr
Declare Function initWithFrame Lib “Foundation” Selector “initWithFrame:” (NSView As Ptr, rect As NSRect) As Ptr
Declare Sub setView Lib “AppKit” Selector “setView:” (NSMenuItem As Ptr, NSView As Ptr)
Dim rect As NSRect
rect.x = 0
rect.y = 0
rect.width = 0
rect.height = 100
Dim viewPtr As Ptr = initWithFrame(alloc(NSClassFromString(“NSView”)), rect)
Dim menuItemPtr As Ptr = Ptr(EditUndo.Handle(MenuItem.HandleType.CocoaNSMenuItem))
Mac? Win? Linux?
Maybe ask first?
On Windows, I think you can add flags to wrap menu into two columns.
A very simple way would be to replace the menu by a ListBox. With 100 items anyway, scrolling would be a lot easier.
[quote=284649:@Christian Schmitz]Mac? Win? Linux?
Maybe ask first?
On Windows, I think you can add flags to wrap menu into two columns.[/quote]
Its for winows. How to add that flag. Could you give me some code.
I am calling this inside a listbox cell. I tried to this with a container control which has listbox. But the listbox bleed through.