MCPcopy Create free account
hub / github.com/cogentcore/core / TestSystemEvents

Function TestSystemEvents

core/widgetevents_test.go:66–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestSystemEvents(t *testing.T) {
67 b := NewBody()
68 bt := NewButton(b).SetText("Button")
69
70 b.AssertRender(t, "events/system-events", func() {
71 bt.SystemEvents().MouseButton(events.MouseDown, events.Left, image.Pt(20, 20), 0)
72 }, func() {
73 expect := states.States(0)
74 expect.SetFlag(true, states.Active)
75 assert.Equal(t, expect, bt.Styles.State)
76 })
77}
78
79func TestWidgetPrev(t *testing.T) {
80 b := NewBody()

Callers

nothing calls this directly

Calls 10

AssertRenderMethod · 0.95
StatesTypeAlias · 0.92
NewBodyFunction · 0.85
NewButtonFunction · 0.85
SystemEventsMethod · 0.80
EqualMethod · 0.80
MouseButtonMethod · 0.65
SetFlagMethod · 0.65
SetTextMethod · 0.45
PtMethod · 0.45

Tested by

no test coverage detected