librelist archives

« back to archive

creating a playlist

creating a playlist

From:
J. Kaiden
Date:
2011-06-08 @ 22:56
hello all,

  still working on the player when i can - it's coming along, thanks for the
help!  so, any thoughts about how best to implement a playlist?  i'll give
you an idea of what i'd like, and what i've tried -

what i'd like:
-> obviously, a list of the tracks in the current playlist, each on a new
line (no problem)
-> ideally list is in a new window, though a list_box could work
-> double click (or something) a track will play it
-> possibility to reorder the list
-> no possibility to "mess" with the track names, and thereby throw a
massive wrench into the works
-> clear, load, and save new tracks - (no problem)
-> drag and drop tracks...  pretty please?  from what i understand shoes
doesn't yet support drag and drop - would someone please tell me i'm wrong?
 i'm finding shoes to be about a gazillion (and that's a wicked lot) times
easier / better / more fun than any of the other gui toolkits i've tried, so
i'm willing to sack the drag and drop if need be....  but wouldn't it be
great? ;)

what i've tried / thought of:
-> opening up a new window, and just using para to dump the playlist array
in, separated by newlines.  this certainly gets the list there, and no one
can "mess" with the text - but i don't think i can capture mouse-clicks and
read a particular line (or can i?)  also can't see how to re-order.
-> opening new window, with an edit_box inside it.  this gets me the list,
and i can re-order, clear tracks, etc. - but i can also "mess" with the
track titles quite easily.  is there any way to make the items in an edit
box blocks that can be moved, but not edited?
-> putting the whole playlist into a list_box.  i kinda like this approach -
i can select a song to play, but don't see a way to re-order.
-> (this one is the cheesiest, but kind of funny) creating a stack of
buttons, each of which is labeled with a track title.  this obviously
captures clicks on the tracks, and i could make a menu with options like
'play,' 'delete,' or 'scan for subliminal messages' - though it looks a
little strange, is probably WAY overkill, and again is not reorderable (as
far as i can tell.)

  in the gtk2 version of this player i use a #ListStore and #TreeView, which
was total pain in the ass to figure out - but once you get it working it
provides you with a way to do all this stuff.  is there nothing similar to a
listview or treeview for shoes?  should i quit my bitching and try to write
my own?

  any thoughts / suggestions are greatly appreciated...

 rock on,

 - j

Re: [shoes] creating a playlist

From:
Cecil Coupe
Date:
2011-06-09 @ 03:30
I once tried to build an 'itunes' app with Shoes. I used DAAP as the
backend music DB so that was easy to handle. Creating ListViews and
TreeViews widgets in Shoes and the navigation issues and widget
bugs/huhs was too much effort for me to continue.

Have you looked at using Green Shoes where you have all the gtk2 widgets
available to you as well a a direct connection to dbus. I don't think
ashbb has added support for all gtk widgets so it's not Shoes 'like' in
those missing areas.  I know if I was ever going to create a Linux only
Ruby music player again, I would use Green Shoes. 


On Thu, 2011-06-09 at 00:56 +0200, J. Kaiden wrote:
> hello all,
> 
> 
>   still working on the player when i can - it's coming along, thanks
> for the help!  so, any thoughts about how best to implement a
> playlist?  i'll give you an idea of what i'd like, and what i've tried
> - 
> 
> 
> what i'd like:
> -> obviously, a list of the tracks in the current playlist, each on a
> new line (no problem)
> -> ideally list is in a new window, though a list_box could work
> -> double click (or something) a track will play it
> -> possibility to reorder the list
> -> no possibility to "mess" with the track names, and thereby throw a
> massive wrench into the works
> -> clear, load, and save new tracks - (no problem)
> -> drag and drop tracks...  pretty please?  from what i understand
> shoes doesn't yet support drag and drop - would someone please tell me
> i'm wrong?  i'm finding shoes to be about a gazillion (and that's a
> wicked lot) times easier / better / more fun than any of the other gui
> toolkits i've tried, so i'm willing to sack the drag and drop if need
> be....  but wouldn't it be great? ;)
> 
> 
> what i've tried / thought of: 
> -> opening up a new window, and just using para to dump the playlist
> array in, separated by newlines.  this certainly gets the list there,
> and no one can "mess" with the text - but i don't think i can capture
> mouse-clicks and read a particular line (or can i?)  also can't see
> how to re-order.
> -> opening new window, with an edit_box inside it.  this gets me the
> list, and i can re-order, clear tracks, etc. - but i can also "mess"
> with the track titles quite easily.  is there any way to make the
> items in an edit box blocks that can be moved, but not edited?
> -> putting the whole playlist into a list_box.  i kinda like this
> approach - i can select a song to play, but don't see a way to
> re-order.
> -> (this one is the cheesiest, but kind of funny) creating a stack of
> buttons, each of which is labeled with a track title.  this obviously
> captures clicks on the tracks, and i could make a menu with options
> like 'play,' 'delete,' or 'scan for subliminal messages' - though it
> looks a little strange, is probably WAY overkill, and again is not
> reorderable (as far as i can tell.)
> 
> 
>   in the gtk2 version of this player i use a #ListStore and #TreeView,
> which was total pain in the ass to figure out - but once you get it
> working it provides you with a way to do all this stuff.  is there
> nothing similar to a listview or treeview for shoes?  should i quit my
> bitching and try to write my own?
> 
> 
>   any thoughts / suggestions are greatly appreciated...
> 
> 
>  rock on,
> 
> 
>  - j

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-09 @ 09:52
  i've been interested in Green Shoes for a while now, coming from gtk2 and
all...  it's also been suggested to me by other folks, for other reasons.
 not sure i'll be able to use it, because for the life of me i can't seem to
get any version of gtk2 to install on my system (ubuntu 10.04) except the
repository version, which is 0.19.3 - and only with ruby 1.8.7.  this was
driving me crazy for months, i was all over the ruby forum gnome2 page,
posting and reading and trying everything from building from source,
installing with gems, using rvm to try it on three different versions of
ruby, even tried on a fresh ubuntu in a virtual box - and nothing, nada,
zilch - no freakin clue why.  i suppose i could undertake that battle again
and try to get 0.90.7+ installed - but i get a headache just thinking about
it.

  the other reason i've shyed away from it, is that i would like this player
to not be 'linux only' - i've already got one of those!  the biggest
disappointment i had after finishing the thing was that my dad couldn't get
it to run on his windoze machine...  bah!!  he's the one who got me into
ruby and for that matter programming at all, and while he can look at the
code and say "neat," he can't use the player.

  ashbb, a few questions when you've got the time...

  one of the big reasons for me to move to shoes from gtk was the
portability - being able to package the whole thing nicely and send it off
to some third party without them having to go through the headaches that
i've gone through to install all the dependencies.  as Green Shoes itself is
a gem which has dependencies, can a Green Shoes project be packaged into a
single bundle the same way a (red) Shoes project?

  if so, would a packaged Green Shoes app be cross-platform?  gtk2 "is"
cross-platform, except not really, and i really want my dad to be able to
use this thing!

  i've seen the Green Shoes Manual, here:
http://ashbb.github.com/green_shoes/Hello!.html
 - but i don't see anything gtk2-like in there...  can i create ListStores
and TreeViews for example?  if so, is there more documentation that i'm not
seeing?

  i'll start looking more carefully at the examples on the github page, and
see what i can figure out, but it'd be a big help if you could clear up some
of these questions for me...

  thanks again!

  - j

Re: [shoes] creating a playlist

From:
Steve Klabnik
Date:
2011-06-09 @ 13:06
Green shoes currently has no packager. It can run on windows, and sort-of on
osx.

Re: [shoes] creating a playlist

From:
ashbb
Date:
2011-06-09 @ 15:58
Hi Jake,

Let me answer your questions. :)

> can a Green Shoes project be packaged into a single bundle the same way
> a (red) Shoes project?
I can't give you a versatile answer. But if your dad has a Windows 7 pc, he
can install your gem (your app written with Green Shoes) by the following
two steps only.

- download and run rubyinstaller-1.9.2-p180.exe
- gem install your_app_gem_written_with_green_shoes

> can i create ListStores and TreeViews for example?
If you use Ruby/GTK2 APIs directly, it's possible to use them with Green
Shoes. I've not tried to use them yet, though. :-P

ashbb

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-09 @ 20:23
thanks for the feedback everyone -

  interesting - i'll give it a shot and see what i come up with...  that
seems to be a motto around the shoes community, and i think that's awesome.

  ashbb - as i say, i'll play around with green shoes (when and if i manage
to install gtk 0.90.7+)  - and i manage to figure some things out and you're
interested, i'd be happy to help with some kind of documentation...

  thanks again -

  rock on,

  - j

Re: [shoes] creating a playlist

From:
Steve Klabnik
Date:
2011-06-10 @ 00:04
> that seems to be a motto around the shoes community, and i think that's awesome.

:) 

On Thursday, June 9, 2011 at 4:23 PM, J. Kaiden wrote:

> thanks for the feedback everyone - 
> 
> interesting - i'll give it a shot and see what i come up with... that 
seems to be a motto around the shoes community, and i think that's 
awesome.
> 
> ashbb - as i say, i'll play around with green shoes (when and if i 
manage to install gtk 0.90.7+) - and i manage to figure some things out 
and you're interested, i'd be happy to help with some kind of 
documentation... 
> 
> thanks again -
> 
> rock on,
> 
> - j 

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-10 @ 13:28
hey folks -

  well, thanks to your ideas i'm playing around with a list manager which
responds to mouse clicks, and making some progress - but i've run into a
question that i can't seem to figure out.  first the code, then the question
-

###
class ListCell < Shoes::Widget
def initialize(entry)
fill black
r = rect()
r.width= 600
r.height= 27
p = para entry, :stroke => white
r.hover{r.style(:fill => blue)}
r.leave{r.style(:fill => black)}
end
end

class ListManager < Shoes::Widget
def initialize(array)
array.each{|item|
cell = list_cell(item)
p "#{cell.hash} => #{item}"  ## to check what's going on
cell.click{para item, :stroke => red}
}
end
end


Shoes.app do
list = %W[aparagus cucumbers leafygreens]
manager = list_manager(list)
end
###

  so, i get my list, move the mouse over it, and "oooh, ahhhh - they change
colors!"  then i click on the last entry in the list, see "leafygreens," and
i'm giddy as a schoolgirl.  then i click on the other two entries and also
see "leafygreens" - huh? - what the heck, buddy?  the output of  p
"#{cell.hash} => #{item}"  seems to show that i've got three seperate
ListCell objects, yet the #click method only gives me the last item to have
passed through the block in ListManager#initialize.
  i've tried moving the #click block up into the ListCell class, using
"r.click{}" instead of "cell.click{}" in ListManager - with the same
results.
  i've also tried adding an "attr_accessor :entry" to the ListCell class
(which might be useful later to add entries to the list,) and passing
"cell.entry" rather than "item" to the #p called as a check in the
ListManager block - but this also gives me the same results.
  i can be pretty thick about this stuff sometimes, so i'm probably missing
something obvious - but i can't get my head around this one...  what's the
magic in Shoes::Widget that converts what would be "ListManager.new()"
outside the shoes world to "list_manager()" in shoes?  could the issue be
there?
  any other ideas?

  thanks again,

  -j

  p.s. ashbb:  thanks again for the link, it's been extremely helpful, and
has given me some important clues about how to work this thing out! :)

Re: [shoes] creating a playlist

From:
ashbb
Date:
2011-06-10 @ 14:31
Hi Jake,

Wow, you are using nested Shoes::Widget (calling ListCell Widget in
ListManager Widget).

I've never used like this. So, I'm not sure this is a bug or spec.

Anyway, a workaround is the following. Try it out. ;-)

class ListCell < Shoes::Widget
  def initialize(entry)
    fill black
    r = rect()
    r.width= 600
    r.height= 27
    para entry, :stroke => white
    r.hover{r.style(:fill => blue)}
    r.leave{r.style(:fill => black)}
    r.click{yield entry}
  end
end

class ListManager < Shoes::Widget
  def initialize(array)
    array.each{|item|
      list_cell(item) do |name|
        para name, :stroke => red
      end
    }
  end
end

Shoes.app do
  list = %W[aparagus cucumbers leafygreens]
  manager = list_manager(list)
end

Cheers,
ashbb

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-10 @ 20:22
On Fri, Jun 10, 2011 at 4:31 PM, ashbb <ashbbb@gmail.com> wrote:

>
> >...Anyway, a workaround is the following. Try it out. ;-)


hi ashbb -

  thanks man!  your workaround is perfect.  i had been playing around with a
yield in the works as well, but never got it far enough to even mention it -
sure does the trick!
  as far as using nested Shoes::Widget's, i had no idea that that was
unusual...  ignorance is bliss! ;)

and a more general question to all...

  i'm still curious about the magic in the Shoes::Widget that turns
"DumbExample.new()" into "dumb_example()" within shoes.  it certainly works
well, but what the heck is going on there?

  thanks again,

  -j




>

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-10 @ 23:32
hi all,

  just noticed an odd behaviour - if i call for the creation of  the
list_manager widget from within a block, like this:

Shoes.app do
  list = %W[aparagus cucumbers leafygreens]
  button("playlist"){manager = list_manager(list)}
end

  i get this error:

undefined method `list_manager' for (Shoes::App "Shoes")

  hmmm....  not sure what that's about.  any thoughts?


  thanks,

  -j

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-10 @ 23:50
sorry for the noise, but...

  either i'm figuring it out, or i don't understand anything, or both ;-P
...  turns out that this works:

Shoes.app do
  list = %W[aparagus cucumbers leafygreens]
  button("manager"){window do
manager = list_manager(list)
end}
end


  this seems strange to me - maybe it's not?

 - j

Re: [shoes] creating a playlist

From:
Steve Klabnik
Date:
2011-06-11 @ 16:53
>
> sorry for the noise, but...


No need to be sorry, that's what the list is for! And this is really
interesting...

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-11 @ 17:51
hey folks,

>Shoes.app do
>  list = %W[aparagus cucumbers leafygreens]
>  button("manager"){@slot.append{domanager = list_manager(list)}}
>  @slot = stack
>end
>
>Hope this helps,
>ashbb

  it does, thanks - i had also noticed shortly after the last post that
putting the stuff in a slot worked, but i didn't think of using #append,
instead i put the stuff inside a stack block and it suddenly worked.  any
ideas why Shoes doesn't recognize the widgets when called from a button
click unless they're inside some other container?  seems strange...

  anyway, i'm working on making the playlist pop up in its own window and
report back to the main app, and making some progress - i'll get back when i
have a decent working solution.  also working on a pop-up menu widget, which
i'll of course post as well when it works.

  anybody have any experience working with the Shoes::Window class?  i was
fooling around with it some, but couldn't get anywhere.  looks like it could
be useful though...

  ashhbb, thanks also for enlightening me about the Shoes::Widget magic -
very interesting...

  and steve, thanks for the moral support!  good to know i'm not annoying
anyone yet!

  rock on -

  - j

Re: [shoes] creating a playlist

From:
Steve Klabnik
Date:
2011-06-11 @ 18:48
What are you looking for from Window?  I've only used it with very basic
sizing and styling stuff.

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-11 @ 19:54
On Sat, Jun 11, 2011 at 8:48 PM, Steve Klabnik <steve@steveklabnik.com>wrote:

> What are you looking for from Window?...
>

  anything i can get!  ;)
  i was really just playing around seeing what i could do with a class that
inherited from Shoes::Window, which was exactly zero...  so i was wondering
if anyone had found it useful.
  what i'm really trying to grok is how to make various windows interact
with the main app.  the observer module that you mentioned has helped a lot
with making progress - and has led me to some questions about how best to
pass things around between the main app and various widgets.  i'm working on
a simple example that will (hopefully) better show what i'm trying to do and
what my questions are... i'll post that as soon as i can.
  all in all i have to say that i really enjoy the 'freedom' that shoes
offers, even if it leaves me kinda lost in the woods at times...  also great
that there are folks around to suggest a path or two when you're stumped!

  have a good weekend (i sure am - sox just swept the yanks, again!)  ;)

  - j

Re: [shoes] creating a playlist

From:
i5m
Date:
2011-06-13 @ 09:42
Sorry, no time to read through everything...

On Sat, Jun 11, 2011 at 8:54 PM, J. Kaiden <jakekaiden@gmail.com> wrote:

>   i was really just playing around seeing what i could do with a class that
> inherited from Shoes::Window, which was exactly zero...  so i was wondering
> if anyone had found it useful.
>   what i'm really trying to grok is how to make various windows interact
> with the main app.

have you had a look at Helperdeck to see how the window interaction
works there? (Sorry, also no time to point you in the direction of the
relevant bits of code).

https://github.com/AnthonBerg/helperdeck

Re: [shoes] creating a playlist

From:
James Harrison
Date:
2011-06-11 @ 23:27
Hey buddy, 


Are you familiar with how 
an observer pattern works?

James

On Jun 11, 2011, at 1:54 PM, "J. Kaiden" <jakekaiden@gmail.com> wrote:

> On Sat, Jun 11, 2011 at 8:48 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
> What are you looking for from Window?...
> 
> 
>   anything i can get!  ;)  
>   i was really just playing around seeing what i could do with a class 
that inherited from Shoes::Window, which was exactly zero...  so i was 
wondering if anyone had found it useful.
>   what i'm really trying to grok is how to make various windows interact
with the main app.  the observer module that you mentioned has helped a 
lot with making progress - and has led me to some questions about how best
to pass things around between the main app and various widgets.  i'm 
working on a simple example that will (hopefully) better show what i'm 
trying to do and what my questions are... i'll post that as soon as i can.
>   all in all i have to say that i really enjoy the 'freedom' that shoes 
offers, even if it leaves me kinda lost in the woods at times...  also 
great that there are folks around to suggest a path or two when you're 
stumped!
> 
>   have a good weekend (i sure am - sox just swept the yanks, again!)  ;)
> 
>   - j
> 
> 

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-12 @ 15:22
On Sun, Jun 12, 2011 at 1:27 AM, James Harrison <oscartheduck@gmail.com>wrote:

> Hey buddy,
>
> Are you familiar with how
> an observer pattern works?
>
> James
>
>
  well, yeah - and they're the ticket, but here's a couple of examples that
show a little better what my question is -

this works:
###########
require 'observer'

class ListCell < Shoes::Widget
  def initialize(entry)
    fill black
    r = rect()
    r.width= 600
    r.height= 27
    para entry, :stroke => white
    r.hover{r.style(:fill => blue)}
    r.leave{r.style(:fill => black)}
    r.click{yield entry}
  end
end

class ListManager < Shoes::Widget
include Observable
  def initialize(array)
    array.each{|item|
      list_cell(item) do |entry|
changed
notify_observers(entry)
      end
    }
  end
end
Shoes.app :title => "main" do

@list = %W[aparagus cucumbers leafygreens]
 def update(message)
para "observed: #{message} ", :stroke => red
end
 def manager(list)
stack{
@manager = list_manager(list)
@manager.add_observer(self)
}
end
 button ("playlist"){self.manager(@list)}
end
###########

  but what i want to do is have the playlist in a new window.  so i change
the #manager(list) method to look like this:

def manager(list)
window{
@manager = list_manager(list)
@manager.add_observer(self) ### not self, but what?
}
end

  so, obviously this doesn't work because self is no longer the main app,
but the window that has popped up.  if i throw a #p self in the main app, it
shows me 'Shoes::App "main"' - but neither that (error: undefined method
`App' for Shoes:Class,) nor "main" (error: observer does not respond to
update) work inside #add_observer().

  how do i reference the main app from inside the window?

  thanks,

 -j

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-12 @ 16:37
ok, getting somewhere...

  this works:

##(ListCell and ListManager as above...)##

@@app = Shoes.app :title => "main" do
 @list = %W[aparagus cucumbers leafygreens]
 def update(message)
para "observed: #{message} ", :stroke => red
end
 def manager(list, app)
window{
p app
@manager = list_manager(list)
@manager.add_observer(app)
}
end
 button ("playlist"){self.manager(@list, @@app)}
end

  nifty...

  - j

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-12 @ 21:53
hmmm,

  so yeah, the above works - but i get a warning about calling a class
variable from the top level, a reasonable warning for ruby to issue.

  any other ideas about how to reference the main app when passing it as an
argument?

  thanks,

  - j

Re: [shoes] creating a playlist

From:
Steve Klabnik
Date:
2011-06-13 @ 11:26
> any other ideas about how to reference the main app when passing it as 
an argument?

Here's something fun: 

Shoes.app do
para Shoes.APPS.count
end


You can also do what I do for Hackety: 
https://github.com/hacketyhack/hacketyhack/blob/master/app/ui/mainwindow.rb#L55


On Sunday, June 12, 2011 at 5:53 PM, J. Kaiden wrote:

> hmmm,
> 
> so yeah, the above works - but i get a warning about calling a class 
variable from the top level, a reasonable warning for ruby to issue.
> 
> any other ideas about how to reference the main app when passing it as 
an argument? 
> 
> thanks,
> 
> - j
> 
> 
> 

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-13 @ 11:42
thanks to all for the ideas...

  got plenty to play around with now!  once again, you guys rock....

  cheers,

  - j

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-25 @ 14:30
could not decode message

Re: [shoes] creating a playlist

From:
ashbb
Date:
2011-06-26 @ 02:07
Hi J,

Good work!
It worked on my Windows 7 with Shoes 3.

Keep going. Looking forward to seeing next step. ;-)

ashbb

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-26 @ 12:35
thanks!  :)


On Sun, Jun 26, 2011 at 4:07 AM, ashbb <ashbbb@gmail.com> wrote:

> Hi J,
>
> Good work!
> It worked on my Windows 7 with Shoes 3.
>
> Keep going. Looking forward to seeing next step. ;-)
>
> ashbb
>
>

Re: [shoes] creating a playlist

From:
serialhex
Date:
2011-06-26 @ 20:28
hey kaiden, are you thinking of posting your code somewhere?  like github
perhaps??  i'm sure the community would *LOVE* to see your code & learn from
it, though you don't have to if you don't want to.  it's your beer, you
don't have to tell us the secret ingredient :P
hex

On Sun, Jun 26, 2011 at 8:35 AM, J. Kaiden <jakekaiden@gmail.com> wrote:

>
> thanks!  :)
>
>
>
> On Sun, Jun 26, 2011 at 4:07 AM, ashbb <ashbbb@gmail.com> wrote:
>
>> Hi J,
>>
>> Good work!
>> It worked on my Windows 7 with Shoes 3.
>>
>> Keep going. Looking forward to seeing next step. ;-)
>>
>> ashbb
>>
>>
>


-- 

> > Other than the fact Linux has a cool name, could someone explain why I
> > should use Linux over BSD?
>
> No.  That's it.  The cool name, that is.  We worked very hard on
> creating a name that would appeal to the majority of people, and it
> certainly paid off: thousands of people are using linux just to be able
> to say "OS/2? Hah.  I've got Linux.  What a cool name".  386BSD made the
> mistake of putting a lot of numbers and weird abbreviations into the
> name, and is scaring away a lot of people just because it sounds too
> technical.
	-- Linus Torvalds' follow-up to a question about Linux

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-26 @ 20:52
On Sun, Jun 26, 2011 at 10:28 PM, serialhex <serialhex@gmail.com> wrote:

> hey kaiden, are you thinking of posting your code somewhere?  like github
> perhaps??


hey hex -

   i was starting to put stuff up on github a while back, and basically got
lazy and gave up - i'll get back on the ball.  no problem sharing beer or
code!  ;)

  - j

Re: [shoes] creating a playlist

From:
serialhex
Date:
2011-06-26 @ 20:58
On Sun, Jun 26, 2011 at 4:52 PM, J. Kaiden <jakekaiden@gmail.com> wrote:

>    i was starting to put stuff up on github a while back, and basically got
> lazy and gave up - i'll get back on the ball.  no problem sharing beer or
> code!  ;)
>
>   - j
>

ahh, cool cool... let us know when it's up!!  and maybe sometime we can
share some beers!! :D
hex

-- 

> > Other than the fact Linux has a cool name, could someone explain why I
> > should use Linux over BSD?
>
> No.  That's it.  The cool name, that is.  We worked very hard on
> creating a name that would appeal to the majority of people, and it
> certainly paid off: thousands of people are using linux just to be able
> to say "OS/2? Hah.  I've got Linux.  What a cool name".  386BSD made the
> mistake of putting a lot of numbers and weird abbreviations into the
> name, and is scaring away a lot of people just because it sounds too
> technical.
	-- Linus Torvalds' follow-up to a question about Linux

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-26 @ 22:35
hey all,

  github page is up - i can quit littering the forum with attached code ;)

   https://github.com/lljk/shoes-stuff

... and maybe sometime we can share some beers!! :D


  mmmm....  cold beer....

  thanks again for all the help,

  - j

Re: [shoes] creating a playlist

From:
ashbb
Date:
2011-06-13 @ 11:10
Hi Jake,

> any other ideas about how to reference the main app
> when passing it as an argument?
Try out the following:

Shoes.app :title => "main" do
  @list = %W[aparagus cucumbers leafygreens]
  def update(message)
    para "observed: #{message} ", :stroke => red
  end
  def manager(list, app)
    window{
      p app
      @manager = list_manager(list)
      @manager.add_observer(app)
    }
  end
  app = self
  button ("playlist"){self.manager(@list, app)}
end

But there is no need to pass it as an argument.
How about this one? ;-)

Shoes.app :title => "main" do
  @list = %W[aparagus cucumbers leafygreens]
  def update(message)
    para "observed: #{message} ", :stroke => red
  end
  def manager(list)
    s = self
    window{
      @manager = list_manager(list)
      @manager.add_observer(s)
    }
  end
  button ("playlist"){self.manager(@list)}
end

ashbb

Re: [shoes] creating a playlist

From:
ashbb
Date:
2011-06-11 @ 13:39
Hi Jake,

> this seems strange to me - maybe it's not?
Yeah, it's strange. But I'm not sure it's a bug or not. :-P

If you want to show the playlist under manager button within the same
window.
This is a solution:

Shoes.app do
  list = %W[aparagus cucumbers leafygreens]
  button("manager"){@slot.append{domanager = list_manager(list)}}
  @slot = stack
end

Hope this helps,
ashbb

Re: [shoes] creating a playlist

From:
ashbb
Date:
2011-06-11 @ 13:23
Hi Jake,

>  i'm still curious about the magic in the Shoes::Widget that turns
> "DumbExample.new()" into "dumb_example()" within shoes.
> it certainly works well, but what the heck is going on there?
The magic code is here. ;-)

subc = "Shoes::Widget::DumbExampleHello"
puts subc.to_s[/(^|::)(\w+)$/, 2].
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
  gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase

You can find lib/shoes.rb line 538-540 on GitHub.
https://github.com/shoes/shoes/blob/develop/lib/shoes.rb

ashbb

Re: [shoes] creating a playlist

From:
ashbb
Date:
2011-06-09 @ 14:11
Hi Jake, Cecil and folks,

Thank you for the interesting topics and discussion.
IMHO, about using all gtk widgets on Green Shoes:

Ruby/GTK2 supports all gtk widgets. So, if you write your app with Ruby/GTK2
APIs directly, it's possible to use all gtk widgets on Green Shoes.
But that is called `Shoes`? ... I'm not sure. :-P

The drag-and-drop and tree-view feature are great.
But I think it's necessary to design new Shoes APIs in view of affinity for
Shoes.

So, as it is now, how about using keypress instead of mouse events?
Look at this: https://gist.github.com/1016801
This code works with both Red and Green Shoes. :)

Cheers,
ashbb

Re: [shoes] creating a playlist

From:
J. Kaiden
Date:
2011-06-09 @ 22:13
> Look at this: https://gist.github.com/1016801
> This code works with both Red and Green Shoes. :)

ashbb-

  thanks a lot for this link, just getting a chance to check it out now, and
it looks very interesting!

  cheers,

  -j