YahooWidget@wiki

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

最終更新:

匿名ユーザー

- view
だれでも歓迎! 編集
コードがいかに字下がりにされるか最初に、ノート。あなたのコードを読み易い保つためには、常にそれを字下がりにするべきである。
First, note how the code is indented. In order to keep your code legible, you should always indent it.

タブ・キーを使用してこれをする為の最も容易で、最もよい方法はある、とても傾向がある感じればまたスペースを使用できる。ある編集者は自動的にあなたの コードを字下がりにする、従ってあなたのタブ・キーおよびより多くの時間の執筆コードから身に着けているより少ない時間を使う。
Using the tab key is the easiest and best method for doing this, but you can also use spaces if you
feel so inclined. Some editors even automatically indent your code, so you spend less time wearing
out your tab key and more time writing code.

このコードはタイマーの"間隔" の札によって定義されるようにあらゆる秒、実行する。望めばそれまたはより少しを頻繁にもっと更新させるこれを変えることができる。
This code will execute once every second, as defined by the timer's "interval" tag. You can change
this to make it update more or less often if you wish.

次に、ここにのコードはonTimerFired 大体英語に翻訳される札をある従って出来事は少しより容易にであるもの見ることができる。
Next, here's the code in the onTimerFired tag roughly translated into English, so you can see what's
happening a little more easily.


Make a new variable called "cpuLoad" and put the current CPU load percentage in it.
Change "myText" so that its data (what the text says) has "% CPU load" on the end of it.
Change the opacity of "myText" to match the cpuLoad variable.


"私の最初Widget.kon を除けば" 私の最初Widget.kon "を救ったところに" 、それからまたはKonfabulator
の皿アイコン(Windows) 、選り抜き"開いた仕掛" はKonfabulator ギヤアイコン(Mac) まで行き、運行する。

Save "My First Widget.kon", then go up to the Konfabulator Gear Icon (Mac) or the
Konfabulator Tray Icon (Windows), select "Open Widget", and navigate to where you
saved "My First Widget.kon".

それを開けなさい。注: あなたのCPU の負荷が高くなければ、するか、ビデオファイルか音楽をまたは開けるこれが事実なら従って仕掛は働いていることを見ることができれば負荷に間を取るプログラムを目に見える。
Open it.
Note: It may not be visible if your CPU load isn't high, so play a video file or
some music or open a program that takes a while to load if this is the case so
you can see that the Widget is working.

かなり、ハァッ涼しいか。いかに簡単それがあるか見なさいか。しかし私達はあなたのCPU の負荷が非常に高くなければ、示さないことを見る! そうこれを固定してもいい私達はいかにか。
Pretty cool, huh? See how simple it is? But we see that if your CPU load isn't very high, it won't even
show up! So how can we fix this?

よく、... 他に"声明は" 導入を見よう。このコードは基本に時間のあなたの働く習慣を最も侮辱し、悩ます。
Well, let's look at introducing an "if...else" statement. This code will basically insult your working
habits most of the time and annoy you.


if (cpuLoad > 80)
{
myText.data = "You're working your computer rather hard!";
}
else
{
myText.data = "The computer isn't doing much right now... Get back to work!";
}


何人かの人々上示されているのようなブラケットとのコードを書く。それをするために人々へと同じラインでブラケットとの同じコードを... 他に条件の声明より密集したように書く。これの例については次のページを見なさい。
Some people write code with brackets like shown above. Other people would write the same code
with the brackets on the same line as the if...else condition statements to make it a bit more
compact. See the following page for an example of this.


if (cpuLoad > 80) {
myText.data = "You're working your computer rather hard!";
} else {
myText.data = "The computer isn't doing much right now... Get back to work!";
}


Konfabulator はどの方法があなたにより多くの意味を成しているそれをいかに書くか、そう公正な使用気遣わない。コードがいかに字下がりにされるか再度、通知。最高の読 み易さを維持するためにKonfabulator はあなたのコードをどちらかいかに字下がりにするが、それはあなたのコードをきちんと字下がりにする非常によい考えであるか気遣わない。とにかく、私達の コードの上で固定しよう。新しいコードは次のページで見つけることができる。
Konfabulator doesn't care how you write it, so just use whichever way makes more sense to you.
Again, notice how the code is indented. Konfabulator doesn't care how you indent your code either,
but it's a very good idea to indent your code properly in order to maintain maximum legibility.
Anyway, let's fix up our code. The new code can be found on the next page.

タグ:

+ タグ編集
  • タグ:

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

目安箱バナー