YahooWidget@wiki

チュートリアル:初めてのWidget-3

最終更新:

匿名ユーザー

- view
だれでも歓迎! 編集
"私の最初Widget.kon への" そしてそれを除けば次の変更を行ないなさい、次にデバッギングの窓の"リロード仕掛" をかちりと鳴らしなさい。
Make the following changes to "My First Widget.kon" and save it, then click "Reload
Widget" in the debug window.

<?xml version="1.0" encoding="UTF-8"?>
<widget>
<debug>on</debug>
<window>
<name>main_window</name>
<title>My First Widget</title>
<height>30</height>
<width>300</width>
<visible>true</visible>
</window>
<text>
<name>myText</name>
<color>#FF0000</color>
<size>18</size>
<alignment>left</alignment>
<vOffset>25</vOffset>
<hOffset>2</hOffset>
</text>
<timer>
<name>timer</name>
<interval>1</interval>
<ticking>true</ticking>
<onTimerFired>
<!--
var cpuLoad = system.cpu.activity;
myText.data = cpuLoad + "% CPU load";
if (cpuLoad < 40)
{
myText.opacity = 102;
}
else
{
myText.opacity = cpuLoad * 2.55;
}
//-->
</onTimerFired>
</timer>
</widget>


これは少なくとも幾分目に見えるいつもとどまるために仕掛を強制する。私達があなたのジヤバ・スクリプトのまわりでXML のコメントのtags(を) 加えたことに気づきなさい。これはあなたの"読むとき別のXML の札は続いて壊れるために挿入されていることをXML のパーサーが考えないようにされ、
This will force the Widget to stay at least somewhat visible at all times. Notice that we've added
some XML comment tags(<!-- and //-->) around your JavaScript. This is done so that the XML parser
won't think another XML tag is being inserted and subsequently break when it reads your "<" sign in
your if statement.

3 つの喝采! あなたの最初虫を固定した! 今、この悪い男の子にある特徴を加えよう。
Three cheers! You've fixed your first bug! Now, let's add some features to this bad boy.

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

目安箱バナー