Flow is undefined - class inheritance issue? (Ruby Shoes) -
i following sample located here in samples folder on official shoes github repo. saw programmer defined class book
inherited shoes
. have relatively large program coming along shoes i'm porting 3.x, , wanted split of different classes smaller files make easier on me. have file so
#this class sets user interface class interface < shoes def initialize flow @shed = button "new" @editbutton = button "edit" @employees = button "employees" @sdays = button "special days" @makenote = button "make note" @backbutton = button "go back" end end end
my main file looks so
$load_path << "." require 'loader' #all of these other classes have defined require 'interface' #contains interface class require 'schutil' shoes.app title: "baesler's scheduling application", width: 1024, height: 768, resizable: true interface.new end
first of all, in sample provided, programmer never had use block shoes.app. don't know how, class got initialized shoes when ran. original intention, when try (the code above without ever calling interface.init), nothing shows in shoes, load. however, using above code as-is, following error: nomethoderror: undefined method 'flow' nil:nilclass
if helps @ all, using shoes 4 preview 3 gem , running windows 8.1 64 bit. doing wrong? bug in shoes codebase, or doing wrong? appreciated.
you overwriting initialize method breaks whole setup of shoes (it needs app instance on call flow method instance).
you following url
sample without using actual url
calls.
a widget might suit use case better.
personally rather resort defining methods within app , calling :)
Comments
Post a Comment