Floating Window - Hiding Resize Button

Greetings,

I am working with a Floating Window - using it as a Palette and I would like to hide the resize, minimize buttons - not just disable them. (And keep the ‘close’ button.)

A quick search of the forum/docs doesn’t seem too revealing in this area. Is there something I am missing here? Thanks :slight_smile:

[quote=200406:@Doug Smith]Greetings,

I am working with a Floating Window - using it as a Palette and I would like to hide the resize, minimize buttons - not just disable them. (And keep the ‘close’ button.)

A quick search of the forum/docs doesn’t seem too revealing in this area. Is there something I am missing here? Thanks :)[/quote]

There may be declares to remove the maximize and minimize buttons instead of making them grey, but I am not aware of them.

You could use the same technique employed by Mac OS Lib for its splash screen, and crop the window bar by making it transparent.

@ Michael, thanks, but…

I have already done that and the buttons are still there (but greyed out).

However - if I also hide the ‘close’ button then all the title bar buttons do disappear. Perhaps this is the way of floating window palettes?

That would work. And you can always add a dismiss button.

I’ve moved the buttons before, but this is non-standard and they get reset to default position on resize.

[code]Sub Open() //Window events
positionTrafficLights
End Sub

Sub Resizing()
positionTrafficLights
End Sub

Private Sub positionTrafficLights()
declare function standardButton lib “Cocoa” selector “standardWindowButton:” _
(id As integer, b As UInt32) As Ptr
declare sub setFrameOrigin lib “Cocoa” selector “setFrameOrigin:” _
(id As Ptr, p As NSPoint)

dim butt As Ptr, pnt As NSPoint

pnt.y = self.Height - 4 //set common traffic light drop

for buttonType As UInt32 = 0 to 2 //for each light
pnt.x = 7 + buttonType * 20 //set x for light
butt = standardButton(self.Handle, buttonType) //get light
setFrameOrigin(butt, pnt) //apply new position
next

End Sub

Structure NSPoint
x As single
y As single[/code]

In my case I moved all 3 buttons down a bit to be centered in a slightly taller title bar.

The y coordinate is measured from the bottom up, so self.Height is it the very top of the contentView and self.Bounds.Height would be the very very top of the Window.

In the loop, buttonType 0 corresponds to the red button, 1 = yellow, 2 = green.

You can modify this to move just 1 and 2 out of view.