you use the api on the wrong way you should use a code like this.
os.loadAPI("button")
m = peripheral.wrap("top")
p = peripheral.wrap("back")
m.clear()
function fillTable()
button.setTable("Peat",peat,3,17,1,3)
button.setTable("Pumpkin",pumpkin,3,17,5,7)
button.setTable("Melon",melon,3,17,9,11)
button.setTable("Netherwart",netherwart,3,17,13,15)
button.setTable("Wheat 1",wheat1,3,17,17,19)
button.setTable("Wheat 2",wheat2,23,37,1,3)
button.setTable("Oak",oak,23,37,5,7)
button.setTable("Birch",birch,23,37,9,11)
button.setTable("Spruce",spruce,23,37,13,15)
button.setTable("Jungle",jungle,23,37,17,19)
button.screen()
end
function getClick()
event,side,x,y = os.pullEvent("monitor_touch")
button.checkxy(x, y)
end
function pulse()
redstone.setOutput("back", true)
sleep(0,5)
redstone.setOutput("back", false)
end
function peat()
button.toggleButton("Peat")
p.setFreq(151)
pulse()
end
function pumpkin()
button.toggleButton("Pumpkin")
p.setFreq(152)
pulse()
end
function melon()
button.toggleButton("Melon")
p.setFreq(153)
pulse()
end
function netherwart()
button.toggleButton("Netherwart")
p.setFreq(154)
pulse()
end
function wheat1()
button.toggleButton("Wheat 1")
p.setFreq(155)
pulse()
end
function wheat2()
button.toggleButton("Wheat 2")
p.setFreq(156)
pulse()
end
function oak()
button.toggleButton("Oak")
p.setFreq(157)
pulse()
end
function birch()
button.toggleButton("Birch")
p.setFreq(158)
pulse()
end
function spruce()
button.toggleButton("Spruce")
p.setFreq(159)
pulse()
end
function jungle()
button.toggleButton("Jungle")
p.setFreq(160)
pulse()
end
fillTable()
while true do getClick() end
this is a link to the pastebin code
http://pastebin.com/ug7DQbaF and if you use the code "button.heading("yourtext") you can have a text above the buttons