Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Columns UI: Panel Toggle Button (Read 2150 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Columns UI: Panel Toggle Button

Hi everyone. I saw someone else make a similar post about how to go about making a button to do a particular function in foobar, which seemed to help them, so I wanted to see if someone can help me with mine.

I've spent many hours trying to figure this out, but it always seems to come up with an error in the console windows and a crash of the panel with the created button when I try running it.

In one panel of the skin, I have a button that toggles a playlist side panel on/off. The code for it looks like this.
Code: [Select]
$imagebutton($sub(%ps_width%,113),5,14,10,,%do.images%Default.png,SETGLOBAL:do.view.switch:$ifequal(%do.view.switch%,1,2,1);REFRESH)

This button works fine and makes the playlist panel hide/display as intended. However, I do not like the tiny button hiding in the top corner of the window, and want to have it in the same area as the other large buttons in the bottom left of the skin.

Using the destination panel's pre-existing buttons (which are in a different format than the other panel) as a template, I copy the function in and get this:
Code: [Select]
Buttons.PLAYLIST = new Button(Math.max(0, ww / 2 - 226), 0, 58, 30, c, SETGLOBAL:do.view.switch:$ifequal(%do.view.switch%,1,2,1);REFRESH);

This results with a console error and a crashed panel.

Any idea as to why it functions correctly in one panel, and not in another? How can I to get this to work? Any help would be greatly appreciated.

Re: Columns UI: Panel Toggle Button

Reply #1
Not possible. You're looking at 2 completely different components. The dialogs where you edit the code should have been a massive clue as they're nothing like each other.

 

Re: Columns UI: Panel Toggle Button

Reply #2
The dialogs where I enter the code are under Splitter Settings>Script>PerTrack in both places, and when I looked at the skin's layout through the Preferences>Columns UI>Layout Tab, both places are there, listed as "Panel Stack Splitter>PSH Panel Mod".

Maybe it's just because I'm new to working with code in foobar, but I thought the "global" variable could be called and changed from anywhere throughout foobar and that the problem might have something to do with the REFRESH not working because of being called from a different panel.

I thought maybe trying to use %pp% as refreshall might work, but wasn't sure what to do for that, and was hoping someone here could help.