summaryrefslogtreecommitdiffstats
path: root/kjsembed/docs/examples/dcop/weather.js
blob: 00c16e0e7133753644808ea482cb723908d7ed08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env kjscmd

var dcop = new DCOPClient(this);
var box = new TQHBox(this);
var go = new KPushButton(box);
var loc = new KLineEdit(box);

go.pixmap = StdIcons.DesktopIcon("go",32);
go.connect(go, "clicked()", this, "getWeather");

dcop.attach();
box.show();

function getWeather()
{
	if ( dcop.isAttached() )
	{
		var icn = new Image(this);
		icn.pixmap = dcop.call("KWeatherService","WeatherService","icon(TQString)", loc.text);
		icn.smoothScale(32,32);
		go.pixmap = icn.pixmap;
	}
}

application.exec();