// Grrr for SuperCollider: an UI library for grid based controllers
// Grrr classes are loosely based on SuperCollider GUI classes. GRControllers are similar to Windows, GRView and its subclasses are similar to View and its subclasses. Like GUI classes a parent is typically passed to a GRView upon instantiation to indicate which controller or view the view will become a child of. Instead of GUI bounds (a Rect supplied to GUI Views) arguments origin (a Point), numCols and numRows designate where on the parent view or controller a Grrr widget is added and how large it is supposed to be.
a=GRScreenGrid.new; // A GRScreenGrid is a virtual grid with configurable size that defaults to 8x8
b=GRButton(a, 0@0, 2, 2); // a button spanning 2x2 keys is placed at top left key on the virtual grid
b.action = { |view, value| (value.if("Hello", "Goodbye") + "World").postln }; // pressing the top-leftmost 2x2 grid keys will now post a message to the Post Window and toggle button value which in turn toggles led state
b.value