On Mon, Sep 29, 2008 at 9:48 PM, Jeff Hodges <[EMAIL PROTECTED]> wrote: > Seth Thomas Rasmussen wrote: >> >> On Mon, Sep 29, 2008 at 9:23 PM, Hugh Sasse <[EMAIL PROTECTED]> wrote: >>> >>> On Mon, 29 Sep 2008, Jeff Hodges wrote: >>> >>>> Hey, >>>> What's the right way to include widgets defined in files other than the >>>> one >>>> the shoes app is defined? >> >> Wouldn't you just define the widget class and then require the file >> from your main app file? >> > > That's what I did and what I described.
Right. Sorry. So, the "unitialized constant Widget" error that I assume is the same you found got me to remembering that the main Shoes app file lives in a strange invisible namespace. In that file when you say Widget you are really saying Shoes::Widget. I think. This simple example worked for me: http://gist.github.com/13728 I figured it out after remember that oddity of Shoes' Ruby environment, so in a sense.. yay.. but really, sort of disturbingly unintuitive for one coming to Shoes and thinking, "hai, ima do sum roobie." Mr. _why, will namespacing in Shoes become more plain in the future, or does this trickery facilitate something integral to Shoes' character? -- Seth Thomas Rasmussen http://greatseth.com
