import("guilib")
class SampleDial
{
inject(System.GUI)
method create_dial ()
{
attr =
{
Attribute.BGCOLOR : {"red":0, "green":255, "blue":128},
Attribute.EXPAND : "HORIZONTAL",
Attribute.RASTERSIZE : {"width":250, "height":80}
}
dial = Dial.new("HORIZONTAL", attr)
@dial = dial
}
public method show ()
{
@dialog.popup(CENTER, CENTER)
@dial.set_raster_size(nil)
}
method initialize ()
{
field @dialog
field @dial
attr =
{Attribute.TITLE : "Sample Dial",
Attribute.OPACITY : 255}
create_dial()
dialog = Dialog.new(@dial, attr)
@dialog = dialog
}
}
method main ()
{
dialog = SampleDial.new()
dialog.show()
}
main()