我不能真正解释我的意思,所以我要用html来显示它
var c = 0;
function getSong() {
if (c>=3) {
c=0
}
c++;
if (c==1) {
document.getElementById("3").style.backgroundColor = "white";
}
document.getElementById(""+c-1).style.backgroundColor = "white";
document.getElementById(""+c).style.backgroundColor = "blue";
}
window.setInterval(function() {getSong()}, 2000);
<div id="0">Song Change Automatic Change In ListBox</div>
<div style="border: 1px black solid; height: 150px; width: 100px;">
<p id="1" style="border: 1px black solid; width: 100px;">Song 1</p>
<p id="2" style="border: 1px black solid; width: 100px;">Song 2</p>
<p id="3" style="border: 1px black solid; width: 100px;">Song 3</p>
</div>
div表示列表框song 1/song 3表示歌曲更改并在完成后突出显示下一首歌曲。在wxPython这可能吗?你知道吗
不是使用
ListBox
而是可以使用ListCtrl
更改项属性。它允许您为列表控件中的项设置wx.ListItemAttr
,并且在attr对象中可以设置fg、bg颜色和字体等内容。如果您使用wx.LC_REPORT
和wx.LC_NO_HEADER
样式,那么它看起来和大部分行为都像ListBox
。你知道吗相关问题 更多 >
编程相关推荐