Toolbar Buttons as "Small" Buttons?

Is it possible to make the buttons on my toolbar “small”, like the ones in the “System Information” app that you can access from “More Info” in “About this Mac”?


mmm just normal Toolbar without icons?

Nope, because when you add an item to the toolbar, it doesn’t have a icon by default. Also, with the Toggle Button style, having the “Pushed” property set to “On” doesn’t do anything either.

Have you made it in carbon?
I’ve put a Sample in here:

[quote=42964:@Tomas Jakobs]Have you made it in carbon?
I’ve put a Sample in here:[/quote]

Weird. I tried your example and the toolbar items display as small. I switched it to Cocoa and they displayed as big. How can I accomplish this in Cocoa? Or is there anyway at all?

I can’t tell you why it won’t work in Cocoa anymore, I only know this workaround for carbonized apps and to me it looks like that system information is running in carbon aswell. Maybe somebody from xojo staff may tell you more why this is not possible in cocoa anymore.

You can do this
However it might take a couple declares

Public Enum DisplayMode NSToolbarDisplayModeDefault NSToolbarDisplayModeIconAndLabel NSToolbarDisplayModeIconOnly NSToolbarDisplayModeLabelOnly

[code]Sub SetToolbarDisplaymode(extends w as window, mode as DisplayMode)
declare function toolbar lib “Cocoa.framework” selector “toolbar” (obj_id as Integer) as Ptr
declare sub setDisplayMode lib “Cocoa.framework” selector “setDisplayMode:” (obj_id as Ptr, displayMode as integer)

dim tb as Ptr = toolbar(w.Handle)
if tb <> nil then
setDisplayMode( tb, Uint32(mode) )
end if

End Sub[/code]

Then set the display mode to NSToolbarDisplayModeLabelOnly

There is also a custom toolbar class that I wrote and discussed in this forum a few weeks ago…
That provides not only this feature, but allows both OSX and WIN to operate identically and provides features missing for each OS (such as flexible space in Windows)

hi dave, do u have the link for the above mentioned?

Custom Toolbar

Demo Project