YahooWidget@wiki

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

最終更新:

匿名ユーザー

- view
だれでも歓迎! 編集
警戒(「世界(こんにちは)!」!);
オーケー、今あるにこの新発見の知識を用いましょう。あなたの最初の小型装置を書く時間です。このためのappを編集するグラフィックスを開く必要がないでしょう。
alert(“Hello, World!”);
Okay, now let’s put this newfound knowledge to some use. It's time to write your first Widget. You
won't need to open your graphics editing app for this one.

あなたの暗号の原文の編集者の新しい文書を作り、"私の最初Widget.kon" と示しなさい。それからそれに次のコードを入れなさい。
Make a new document in your plain-text editor and name it "My First Widget.kon".

Then put the following code into it.


<?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";
      myText.opacity = cpuLoad * 2.55;
    </onTimerFired>
  </timer>
</widget>


タグ:

+ タグ編集
  • タグ:

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

目安箱バナー