ToolButton.Pushed

I am using a toolbar and one of the buttons is a Toggle Button. I will be using it to bring up a sidebar with properties on it, toggle on visible, toggle off invisible.

So in my toolbar Action event I get the argument “item as ToolItem”. How do i test the state of the button, i.e. Pushed or Not. I really cannot see how to do it and its probably staring me in the face.

Thanks.

if item isa ToolButton then if ToolButton(item).Pushed then ... end end

Spot on. Thanks

Hi Mike,

I’m curious - how do you do your sidebar? Is it mimicking a drawer or is it just “in window”?

Thanks

Markus

(I’m asking in case you use a drawer: you can open the drawer from a toolitem, but you can’t close it)

Not a drawer. I have it within the main window. Similar to the Xojo inspector window. I use a timer to animate it sliding into and out of position. While it is resizing just resize all the other controls on the window to make way for the sidebar.