samples/07_advanced_audio/02_sound_synthesis/app/main.rb
def button args, opts
    button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))

    button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0

    label_offset_x = 5
    label_offset_y = 30

    button_def[:label]  = button_def[:rect].merge text: opts[:text],
                                                  size_enum: -2.5,
                                                  x: button_def[:rect].x + label_offset_x,
                                                  y: button_def[:rect].y + label_offset_y

    button_def
  end
# region: button definitions, ui layout, callback functions
button definitions, ui layout, callback functions
button definitions ui layout callback functions
def button args, opts
    button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))
    button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0
    label_offset_x = 5
    label_offset_y = 30
    button_def[:label]  = button_def[:rect].merge text: opts[:text],
                                                  size_enum: -2.5,
                                                  x: button_def[:rect].x + label_offset_x,
                                                  y: button_def[:rect].y + label_offset_y
    button_def
  end
def button args , opts button_def = opts . merge rect : ( args . layout . rect ( opts . merge w : 2 , h : 1 ) ) button_def [ :border ] = button_def [ :rect ] . merge r : 0 , g : 0 , b : 0 label_offset_x = 5 label_offset_y = 30 button_def [ :label ] = button_def [ :rect ] . merge text : opts [ :text ] , size_enum : - 2.5 , x : button_def [ :rect ] . x + label_offset_x , y : button_def [ :rect ] . y + label_offset_y button_def end
region: button definitions, ui layout, callback functions
region : button definitions ui layout callback functions
args
opts