Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,33 @@
using fwt
using gfx
class Main
{
public static Void main ()
{
button1 := Button
{
text = "don't click!"
onAction.add |Event e|
{
echo ("clicked by code")
}
}
button2 := Button
{
text = "click"
onAction.add |Event e|
{
// fire all the event listeners on button1
button1.onAction.fire(e)
}
}
Window
{
title = "simulate mouse event"
size = Size (300, 200)
button1,
button2,
}.open
}
}

View file

@ -0,0 +1,28 @@
using [java] java.awt::Robot
using [java] java.awt.event::InputEvent
using fwt
using gfx
class Main
{
public static Void main ()
{
button := Button
{
text = "click for robot"
onAction.add |Event e|
{
robot := Robot ()
robot.mouseMove (50, 50) // move to screen point 50, 50
robot.mousePress (InputEvent.BUTTON1_MASK) // and click mouse
robot.mouseRelease (InputEvent.BUTTON1_MASK)
}
}
Window
{
title = "simulate mouse event"
size = Size (300, 200)
button,
}.open
}
}