librelist archives

« back to archive

green_shoes button size headache

green_shoes button size headache

From:
Catsquotl
Date:
2011-02-28 @ 21:16
Hi,

I am fairly new to ruby, but have taken a shine to green_shoes.

I can't seem to figure out how to manipulate the size of a button though.
If i create buttons from an array like.
-----------------------------------------------
flow width: 0.5,height: 0.3 do
         a.punten.each {|e|
         button(e.afk) {alert "
             Naam   :  #{e.name}
             Locatie:  #{e.locatie}
             Aard   :  #{e.aard}
             Actie  :  #{e.actie}"}
         }
        end
--------------------------------------------
Where do I put the width and height statements?
i've tried before and after the (e.afk) with colons before and after the 
width height calls, but no luck...

Eelco

Re: [shoes] green_shoes button size headache

From:
Steve Klabnik
Date:
2011-02-28 @ 22:06
Try leaving off the ()

it _should_ (note, im not up on the latest on green_shoes) be

button "Push me", :height => 1000000 do

If you must have ()s, it would be

button("Push me", :height => 1000000) do

Re: [shoes] green_shoes button size headache

From:
Devyn Cairns
Date:
2011-03-01 @ 05:31
Actually, that *should* work just fine. The only difference between { } and
do..end are in syntax; Ruby compiles them the same way.

On Mon, Feb 28, 2011 at 2:06 PM, Steve Klabnik <steve@steveklabnik.com>wrote:

> Try leaving off the ()
>
> it _should_ (note, im not up on the latest on green_shoes) be
>
> button "Push me", :height => 1000000 do
>
> If you must have ()s, it would be
>
> button("Push me", :height => 1000000) do
>
>


-- 
    ~devyn

Re: [shoes] green_shoes button size headache

From:
Elias Crespin
Date:
2011-03-01 @ 13:08
could not decode message

Re: [shoes] green_shoes button size headache

From:
Steve Klabnik
Date:
2011-03-01 @ 14:15
>
> Once I resize the buttons to a smaller size, lets say to width => 20 and
> height => 16 which is half the default, the text and surrounding shape of
> the button are not visible anymore. Any ideas how to fix it ?
>

Yeah, the problem is that the button is too small for the text! If you want
to make a button that small, you will probably have to draw your own, and
use a .click handler on it...


> How do I check what version/color of shoes I am running ? Not sure...


If you didn't explicitly do something else, you're using Red Shoes. You'd
know if you installed any of the others.

Re: [shoes] green_shoes button size headache

From:
Elias Crespin
Date:
2011-03-01 @ 14:34
Thanks steve,


On Tue, Mar 1, 2011 at 3:15 PM, Steve Klabnik <steve@steveklabnik.com>wrote:

> Once I resize the buttons to a smaller size, lets say to width => 20 and
>> height => 16 which is half the default, the text and surrounding shape of
>> the button are not visible anymore. Any ideas how to fix it ?
>>
>
> Yeah, the problem is that the button is too small for the text! If you want
> to make a button that small, you will probably have to draw your own, and
> use a .click handler on it...
>
Can't the text font size be reduced ?

Before I may start reinventing the wheel, can you point me out at doc on how
to draw my own button ?


>
>> How do I check what version/color of shoes I am running ? Not sure...
>
>
> If you didn't explicitly do something else, you're using Red Shoes. You'd
> know if you installed any of the others.
>

I can't find instructions for installing green on the Mac. I tried
installing gem on ruby,
and then

gem install green_shoes-0.171.0.gem

It complains of not finding

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Looks like the ruby sources or development environment is needed.....??

Im checking ruby gem's documentation...

Re: [shoes] green_shoes button size headache

From:
ashbb
Date:
2011-03-01 @ 15:30
Hi Elias,

> Can't the text font size be reduced ?
Sorry, it can't so far.

> how to draw my own button ?
How about this one?

Shoes.app do
  nofill
  bg = rect(50, 50, 20, 16, curve: 5)
  para '^', left: 53, top: 50
  fg = rect(50, 50, 20, 16, fill: rgb(128, 128, 128, 0.4), curve: 5).hide
  bg.hover{fg.show}
  bg.leave{fg.hide}
  bg.click{alert 'hi'}
end

> I can't find instructions for installing green on the Mac.
Oh, sorry...
For now, green_shoes gem is available on Windows and Linux.
But if you can use X11 for Mac, i5m will help you. > Hey, i5m. Could you
please?

ashbb

Re: [shoes] green_shoes button size headache

From:
Elias Crespin
Date:
2011-03-01 @ 15:41
Great button!! Thanks.

I 'll play around with it and let you know. Will try the i5m later... thanks

Elias \\.


On Tue, Mar 1, 2011 at 4:30 PM, ashbb <ashbbb@gmail.com> wrote:

> Hi Elias,
>
>
> > Can't the text font size be reduced ?
> Sorry, it can't so far.
>
>
> > how to draw my own button ?
> How about this one?
>
> Shoes.app do
>   nofill
>   bg = rect(50, 50, 20, 16, curve: 5)
>   para '^', left: 53, top: 50
>   fg = rect(50, 50, 20, 16, fill: rgb(128, 128, 128, 0.4), curve: 5).hide
>   bg.hover{fg.show}
>   bg.leave{fg.hide}
>   bg.click{alert 'hi'}
> end
>
>
> > I can't find instructions for installing green on the Mac.
> Oh, sorry...
> For now, green_shoes gem is available on Windows and Linux.
> But if you can use X11 for Mac, i5m will help you. > Hey, i5m. Could you
> please?
>
> ashbb
>

Re: [shoes] green_shoes button size headache

From:
Steve Klabnik
Date:
2011-03-01 @ 15:58
Hey Elias-

Yeah, green shoes is only with X11 on the mac. Just install the OSX
developer tools, here:
http://developer.apple.com/devcenter/mac/index.action(Xcode and iOS
SDK). You'll have to sign up for a free apple developer
account...

-Steve

Re: [shoes] green_shoes button size headache

From:
i5m
Date:
2011-03-01 @ 16:14
I managed to get Green Shoes running on my ageing 10.5 PPC Mac so it
should be easily possible on a newer Mac. Basically follow the Ubuntu
instructions: 
https://github.com/ashbb/green_shoes/wiki/Building-Green-Shoes-on-Ubuntu

1) You need to install the OSX Developer tools
2) and then I used Macports since I already had it available, but I
believe the new cool way is Homebrew,
2a) Install Ruby 1.9
2b) Install Cairo
2c) Install gtk
2d) Install the Cairo and gtk gems
3) Install the green shoes gem (at the time I did it the gem wasn't
available so I just cloned ashbb's repo and ran it from there).

Job done.
-----------------------
i5m.co.uk
GPG Key: 0xA18A602B



On Tue, Mar 1, 2011 at 3:30 PM, ashbb <ashbbb@gmail.com> wrote:
> Hi Elias,
>

>
>> I can't find instructions for installing green on the Mac.
> Oh, sorry...
> For now, green_shoes gem is available on Windows and Linux.
> But if you can use X11 for Mac, i5m will help you. > Hey, i5m. Could you
> please?
>
> ashbb
>

Re: [shoes] green_shoes button size headache

From:
Elias Crespin
Date:
2011-03-01 @ 16:16
Thanks I was midway there installing gtk. Will tell you what happens and
steps followed.


Elias Crespin.


On Tue, Mar 1, 2011 at 5:14 PM, i5m <i5ivem@gmail.com> wrote:

> I managed to get Green Shoes running on my ageing 10.5 PPC Mac so it
> should be easily possible on a newer Mac. Basically follow the Ubuntu
> instructions:
> https://github.com/ashbb/green_shoes/wiki/Building-Green-Shoes-on-Ubuntu
>
> 1) You need to install the OSX Developer tools
> 2) and then I used Macports since I already had it available, but I
> believe the new cool way is Homebrew,
> 2a) Install Ruby 1.9
> 2b) Install Cairo
> 2c) Install gtk
> 2d) Install the Cairo and gtk gems
> 3) Install the green shoes gem (at the time I did it the gem wasn't
> available so I just cloned ashbb's repo and ran it from there).
>
> Job done.
> -----------------------
> i5m.co.uk
> GPG Key: 0xA18A602B
>
>
>
> On Tue, Mar 1, 2011 at 3:30 PM, ashbb <ashbbb@gmail.com> wrote:
> > Hi Elias,
> >
>
> >
> >> I can't find instructions for installing green on the Mac.
> > Oh, sorry...
> > For now, green_shoes gem is available on Windows and Linux.
> > But if you can use X11 for Mac, i5m will help you. > Hey, i5m. Could you
> > please?
> >
> > ashbb
> >
>

Re: [shoes] green_shoes button size headache

From:
Steve Klabnik
Date:
2011-03-01 @ 16:35
I switched from MacPorts to homebrew last night. It's much better.

http://mxcl.github.com/homebrew