The easiest way to do what you want is to write a class which inherits from
Shoes::Widget and then you do not have to worry about  providing reference
to the main Shoes.app class (using the global variable e.g. $app=self).

class Myclass << Widget
...
....
end
Shoes.app do
myclass ... #it is not an error - you do not start with a capital letter,
since you are creating a widget you use it as e.g. rect, oval, float etc
...
end

Have a look on the latest version of my menu widget for the example (
http://s3.amazonaws.com/shoes_code/public/versions/178/menu_widget.rb)

Hope it helps.

K
On Sun, Dec 14, 2008 at 12:47 AM, Jordan Applewhite <
[email protected]> wrote:

> I'm trying to make a class that has an array of paras, stacks, or some
> other Shoes object.  Then, I want to instantiate that class from the file
> that contains Shoes.app and append those elements to a slot therein.  I'm
> having a difficult time figuring out how to get my class to recognize the
> shoes objects and methods.  I've tried requiring different shoes source
> files and using the $app variable found in the expert-tankspank.rb sample
> (is $app  part of the Ruby language or is it a Shoes construct?).  How do
> you use shoes elements in your classes outside of the main Shoes.app file?
>
>
> I'm so very confused.  Halp!
>
> Thanks!
>

Reply via email to