Post all the code. Use codebox instead of code.
OK I will post the PUI as well just for completeness, although its nothing big, because I'm just testing things out in a new PUI.
PUI:
$panel(playlist,Single Column Playlist,0,0,%_width%,$sub(%_height%,20),)
$panel(trackinfo,Track info mod,0,$sub(%_height%,300),%_width%,280,)
$panel(buttons,Buttons,0,$sub(%_height%,20),%_width%,20,)
Track info:
$drawrect(0,0,%_width%,%_height%,pencolor-0-0-0 brushcolor-0-0-0)
$padding(2,4)$align(center,top)$font(,13,glow-200-247-60,SYSCOL-8)
$if(%_trackinfo_notrack%,
No Track $getpvar(mem1)
,
%title% $getpvar(mem1)$char(10)
$font(,9,bold,255-255-255)%artist%$char(10)
)
// PerTrack
$button2($sub($div(%_width%,2),$div($calcwidth(Library),2)),$sub(%_height%,$div(%_height%,5)),5,5,$add($calcwidth(Library),10),$add($calcheight(Library),10),'$font(Arial,10,,255-255-255) Library','$font(Arial,10,,255-0-0) Library',PVAR:SET:mem1:$ifgreater($getpvar(mem1),0,0,1),)
The button toggles properly when there is no track, but not if a track is playing.