You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kvirc/doc/scriptexamples/label1.kvs

40 lines
880 B

# A little label test.
class(myLabel, label)
{
constructor
{
$$->$setBackgroundColor(dcdc00);
$$->$setAutoResize(0);
$$->$setGeometry(10, 10, 500, 150);
$$->$setAlignment(Center);
$$->$setText("Come here !");
}
mouseEnterEvent
{
$$->$setMargin(10);
$$->$setAlignment(Right, Top);
%al = "My alignment is $$->$alignment(), and I have margin $$->$margin() pixels wide !";
$$->$setText(%al);
$$->$setFrameStyle(Panel, Raised);
echo "Label frame style: $$->$frameStyle()";
}
mouseLeaveEvent
{
$$->$setMargin(0);
$$->$setAlignment(Left, Bottom);
%al = "My alignment is $$->$alignment(), and I have margin $$->$margin() pixels wide !";
$$->$setText(%al);
$$->$setFrameStyle(Panel, Sunken);
echo "Label frame style: $$->$frameStyle()";
}
}
%w = $new(widget, 0);
%w->$resize(520, 170);
%w->$move(50, 50);
%l = $new(myLabel, %w);
%w->$show();