librelist archives

« back to archive

widget wiki

widget wiki

From:
J. Kaiden
Date:
2011-08-20 @ 01:10
hey folks -

  well, i just put up a wiki on Shoes widgets.  it's pretty basic, and
really just covers some of the issues that i had while beginning to use
widgets.  thanks very much to everyone for all the help and ideas along the
way - this list freakin' rocks.

  please let me know if you see something in the wiki that is just plain
wrong, is misleading, could be better expressed, or if you think i'm missing
something important.

  Steve - i checked out the link you sent for the manual, but i don't think
this really fits with the manual - it's just too danged long.  maybe on the
'tutorials' page of the Shoooes! site we could put links to all the various
blogs, samples, and tutorials that folks have put together...  dunno, a
thought.

  here's the link:  https://github.com/lljk/shoes-stuff/wiki/Shoes-Widgets

  thanks again,

  - j

Re: [shoes] widget wiki

From:
Steve Klabnik
Date:
2011-08-20 @ 19:06
Super cool! https://twitter.com/#!/shoooesrb/status/104992595884773376

:D

Re: [shoes] widget wiki

From:
J. Kaiden
Date:
2011-08-20 @ 19:46
On Sat, Aug 20, 2011 at 9:06 PM, Steve Klabnik <steve@steveklabnik.com>wrote:

> Super cool! https://twitter.com/#!/shoooesrb/status/104992595884773376
>
> :D
>

hey!  cool!  thanks again to you, ashbb, and everyone who helped me figure
the dang things out some...

 - j

Re: [shoes] widget wiki

From:
ashbb
Date:
2011-08-21 @ 10:45
Hi J,

At last I finished to read through your fantastic StarMonkey story.
I confirmed all code you put on the wiki. They all works very well
on my Windows7 with Red Shoes 3. Great work, awesome!!

Well okay, the following is my two cents. ;-)

First, an another way. There is no need to write the code like this.
But, how about this one?
You don't have to add `attr_reader :name` and local variables: sm1, sm2, ..

class StarMonkey < Shoes::Widget
  def initialize(name)
    @name = name
    stack width: 140, height: 200, stroke: red, fill: blue do
      r = star(70, 65, 5, 60, 40)
      r.style(stroke: blue, fill: black)
      star(40, 60, 5, 25, 10)
      star(100, 60, 5, 25, 10)
      a = arc(70, 90, 100, 20, 90, 180)
      para name, align: "center", displace_top: 150, stroke: blue
    end
    self.click{yield name if block_given?}
  end
end

Shoes.app do
  star_monkey("Laverne"){|name|
    para "#{name} to sew L's on my sweaters.  ", stroke: green}
end


Second, I heard the following from your aunt Liza. ;-)
Try out this snippet.

class StarMonkey < Shoes::Widget
  def initialize(name)
    alert 'hi'
  end
end

class Shoes::Types::App
  def method_missing m, *args, &blk
    stack.send m, *args, &blk
  end
end

Shoes.app do
  button("call Shirley"){star_monkey("Shirley")}
end

Yes, `class Shoes::Types::App .... end` is a patch to use star_monkey
method without stack that user have to add.

But, don't ask me now,
- What is the Shoes::Types?
- Where is the star_monkey method defined?

Because they are so deep questions. I'm not sure that the current
Shoes behavior is the spec that _why expected or a bug...

Cheers,
ashbb

Re: [shoes] widget wiki

From:
J. Kaiden
Date:
2011-08-21 @ 12:52
On Sun, Aug 21, 2011 at 12:45 PM, ashbb <ashbbb@gmail.com> wrote:
>
>
> ...I confirmed all code you put on the wiki. They all works very well
> on my Windows7 with Red Shoes 3...
>

  glad to hear it!  thanks for checking them out...


You don't have to add `attr_reader :name` and local variables: sm1, sm2, ..
>
> ...

>     self.click{yield name if block_given?}
>
...

> Shoes.app do
>   star_monkey("Laverne"){|name|
>     para "#{name} to sew L's on my sweaters.  ", stroke: green}
> end


  oooh, that's much nicer...  thanks for the idea!  i'll change that...


Second, I heard the following from your aunt Liza. ;-)
> Try out this snippet.
>
.......

Yes, `class Shoes::Types::App .... end` is a patch to use star_monkey
> method without stack that user have to add.
>

  whoah - cool!  i'll have to fool around with that some...


>
> But, don't ask me now,
> - What is the Shoes::Types?
> - Where is the star_monkey method defined?
>
> Because they are so deep questions. I'm not sure that the current
> Shoes behavior is the spec that _why expected or a bug...


  ;)  i'll just roll with it!

  thanks again for your two cents, and all the help figuring this stuff
out...


  Ever Onward Shoes!

  - j

Re: [shoes] widget wiki

From:
ashbb
Date:
2011-08-21 @ 13:30
Hi J,

>  whoah - cool!  i'll have to fool around with that some...
Thanks.
But be careful.

Shoes::Widget class is interesting, but we don't know the behavior is
spec or bug...

IMHO, Shoes::Types::App is a bug.

ashbb

Re: [shoes] widget wiki

From:
J. Kaiden
Date:
2011-08-21 @ 13:42
On Sun, Aug 21, 2011 at 3:30 PM, ashbb <ashbbb@gmail.com> wrote:

>
> Thanks.
> But be careful.
>
> Shoes::Widget class is interesting, but we don't know the behavior is
> spec or bug...
>
> IMHO, Shoes::Types::App is a bug.


  i guess i'll just keep calling them from slots as it doesn't really cost
me anything, and i don't want my starmonkeys getting out of control ;)  -
but your Shoes::Types::App solution (whether spec or bug) is certainly an
interesting peek at the inner workings of Shoes...

  - j

Re: [shoes] widget wiki

From:
Cecil Coupe
Date:
2011-08-20 @ 03:16
Jake,

  I just tried some of the examples from your wiki entry and on my
Ubuntu 10.10, ruby 1.9.1 complied Shoes, the example with Observers
behaves very oddly. No errors in the Shoes Console. the Windows and
shapes are drawn, the initalize StarMonkey class appears to be exited
when I push the  but control never returns to the code to create the
para "Watching BooBoo" (or to set up the watch) Weirder yet, I can click
the button again for a second window and it shows up so the Shoes.app
thread isn't hung. 

 I suspect Window doesn't work the way we want it too, cross platform.
There are also refresh/expose problems if the StarMonkey window is
partially covered and then exposed.

--Cecil



On Sat, 2011-08-20 at 03:10 +0200, J. Kaiden wrote:
> hey folks -
> 
> 
>   well, i just put up a wiki on Shoes widgets.  it's pretty basic, and
> really just covers some of the issues that i had while beginning to
> use widgets.  thanks very much to everyone for all the help and ideas
> along the way - this list freakin' rocks.
> 
> 
>   please let me know if you see something in the wiki that is just
> plain wrong, is misleading, could be better expressed, or if you think
> i'm missing something important.
> 
> 
>   Steve - i checked out the link you sent for the manual, but i don't
> think this really fits with the manual - it's just too danged long.
>  maybe on the 'tutorials' page of the Shoooes! site we could put links
> to all the various blogs, samples, and tutorials that folks have put
> together...  dunno, a thought.
> 
> 
>   here's the link:
>  https://github.com/lljk/shoes-stuff/wiki/Shoes-Widgets
> 
> 
>   thanks again,
> 
> 
>   - j

Re: [shoes] widget wiki

From:
J. Kaiden
Date:
2011-08-20 @ 08:15
>
> ...on my Ubuntu 10.10, ruby 1.9.1 complied Shoes, the example with
> Observers behaves very oddly.
>  I suspect Window doesn't work the way we want it too, cross platform.
> There are also refresh/expose problems if the StarMonkey window is
> partially covered and then exposed.
>
>
hi Cecil,

  Thanks for getting back with this...  Interesting, this was all written on
Ubuntu 10.04, also with 1.9.1 Shoes.  Not sure what the problem is, as on my
box it runs just fine...

  Just a thought - clicking the button that says "call Shirley" will pop up
the window, but you've got to click on Shirley herself to get her to start
watching BooBoo - that might not be clear in the text, and could explain why
she just sits there!  Try clicking on her starry face when she pops up, and
let me know if that works...

  thanks again,

  - j

Re: [shoes] widget wiki

From:
Cecil Coupe
Date:
2011-08-20 @ 18:33
I always like to start my day learning how dumb I can be. Sigh. 
Yes that works. 

On Sat, 2011-08-20 at 10:15 +0200, J. Kaiden wrote:

> 
>   Just a thought - clicking the button that says "call Shirley" will
> pop up the window, but you've got to click on Shirley herself to get
> her to start watching BooBoo - that might not be clear in the text,
> and could explain why she just sits there!  Try clicking on her starry
> face when she pops up, and let me know if that works...


Re: [shoes] widget wiki

From:
J. Kaiden
Date:
2011-08-20 @ 19:45
On Sat, Aug 20, 2011 at 8:33 PM, Cecil Coupe <ccoupe@cableone.net> wrote:

>
> I always like to start my day learning how dumb I can be. Sigh.
> Yes that works.
>
>
  glad to hear it works!  my 'explanation' of how it works in the 'tutorial'
is not exactly the most straightforward...  could easily be confusing - i'll
look at making things a bit clearer ;)

 - j

Re: [shoes] widget wiki

From:
Cecil Coupe
Date:
2011-08-20 @ 02:08
Jake,
  Wonderful! The Wiki is the correct place for that. The Manual entry
for Widget should say, 'See the wiki' or something like that. 

It's nice to see all the flurry of activity on Shoes, issues list and
the mailing list. For whyday, I wrote a little green_shoes, linux only
script to sftp to a rooted Android device -- something that general
purpose Red Shoes should never have to accommodate. 

--Cecil

On Sat, 2011-08-20 at 03:10 +0200, J. Kaiden wrote:

> 
>   here's the link:
>  https://github.com/lljk/shoes-stuff/wiki/Shoes-Widgets

> 
>   - j