The module (using by button builder not widget.*) would look like something this:
-- ============================================================= -- Rudimenatary Common Button Builder -- ============================================================= local composer = require( "composer" ) local shared = {} function shared.makeButtons( sceneGroup, d1, d2 ) local function listener1( self, event ) composer.gotoScene( "ifc." .. d1 , { effect = "slideRight", time = 500 } ) end local function listener2( self, event ) composer.gotoScene( "ifc." .. d2 , { effect = "slideLeft", time = 500 } ) end PushButton( sceneGroup, display.contentCenterX - 150, display.contentCenterY, d1, listener1, { labelColor = {0,1,0}, labelSize = 24 } ) PushButton( sceneGroup, display.contentCenterX + 150, display.contentCenterY, d2, listener2, { labelColor = {0,1,1}, labelSize = 24 } ) end return shared