librelist archives

« back to archive

Styling a Para?

Styling a Para?

From:
Scott Harman
Date:
2013-07-30 @ 01:43
Hi all
I've shamelessly copied Ola's work, and am trying to maintain the style of
a para when replacing the contents of said Para

i.e.

  def para(text='')
    super text, :stroke=> white, :size=>'small'
  end

    def update_capacity

      background rgb(70,21,107)
        man = SNMPManager.new(:hostname=>@hostname)
        @disp = para man.output
        every(30) {
          @disp.replace man.output
        }
    end

Weirdly, the first time the block displays, it looks perfect - but after
the first event fires, it switches back to black text (but remains the same
size)

Same issue occurs in my configuration block, but it's more noticeable here.

Re: [shoes] Styling a Para?

From:
ashbb
Date:
2013-07-31 @ 11:29
Hi Scott,

Thanks for the post. Sorry for my late reply.
If you are using Red Shoes (i.e. Shoes 3) or Green Shoes and you want to
change default style of Para, use `style` method.

Try this out. ;-)

Shoes.app do
  background rgb(70,21,107)
  style Shoes::Para, stroke: white, size: 'xx-small'
  para "Hello!\n"
  @disp = para 'Hello!'
  every(1){|i| @disp.replace "Hello#{i}"}
end

ashbb

Re: [shoes] Styling a Para?

From:
Tobias Pfeiffer
Date:
2013-07-31 @ 11:35
feature pending to be implemented in Shoes4... :-)

Shoes on!
Tobi

On Wed 31 Jul 2013 01:29:56 PM CEST, ashbb wrote:
> Hi Scott,
>
> Thanks for the post. Sorry for my late reply.
> If you are using Red Shoes (i.e. Shoes 3) or Green Shoes and you want
> to change default style of Para, use `style` method.
>
> Try this out. ;-)
>
> Shoes.app do
>   background rgb(70,21,107)
>   style Shoes::Para, stroke: white, size: 'xx-small'
>   para "Hello!\n"
>   @disp = para 'Hello!'
>   every(1){|i| @disp.replace "Hello#{i}"}
> end
>
> ashbb

Re: [shoes] Styling a Para?

From:
Scott Harman
Date:
2013-08-04 @ 23:25
Thanks guys
I've changed my structure to support that, and it's now working brilliantly.
Sadly, I had a weekend in the way, and all my other improvements have been
destroyed by a combination of BBQ and Powertools - so I might have some
more silly questions as they occur to me ;)
I'm using Green Shoes which isn't as portable, but gives me more consistent
results than Red Shoes.

Many thanks
Scott


On Wed, Jul 31, 2013 at 9:35 PM, Tobias Pfeiffer <
tobias.pfeiffer@student.hpi.uni-potsdam.de> wrote:

> feature pending to be implemented in Shoes4... :-)
>
> Shoes on!
> Tobi
>
> On Wed 31 Jul 2013 01:29:56 PM CEST, ashbb wrote:
> > Hi Scott,
> >
> > Thanks for the post. Sorry for my late reply.
> > If you are using Red Shoes (i.e. Shoes 3) or Green Shoes and you want
> > to change default style of Para, use `style` method.
> >
> > Try this out. ;-)
> >
> > Shoes.app do
> >   background rgb(70,21,107)
> >   style Shoes::Para, stroke: white, size: 'xx-small'
> >   para "Hello!\n"
> >   @disp = para 'Hello!'
> >   every(1){|i| @disp.replace "Hello#{i}"}
> > end
> >
> > ashbb
>