ruby shoes: Preventing a new window from opening -
so have gui this:
shoes.app title: "main" class mainpanel @myapp def initialize(myapp) @myapp = myapp end def alert(message) @myapp.app alert message end end def add(text) @myapp.app append para "lol" end end end stack @currpanel = mainpanel.new(self) button "start!" @currpanel.alert("balh") @currpanel.add("balh") end end end
i confused why doesn't work. saying doesn't work mean opens new window (updated). every time executes something, new window generated.... don't understand did wrong. have tried putting class declaration outside of shoes.app didn't work either.....
i believe want 'lol's maintain piling each time button pressed , alert shown. if case, need create little alter , things work perfectly:
change add together method from:
def add(text) @myapp.app append para "lol" end end
to:
def add(text) @myapp.app append para "lol" end end end
let me know if have not understood question correctly. hope helps :)
ruby shoes
No comments:
Post a Comment