librelist archives

« back to archive

edit_line question

edit_line question

From:
J. Kaiden
Date:
2011-07-29 @ 16:00
hey all,

  encountered edit_line behavior that seems strange to me.  when i set the
text shown by default with #text=, it is not then returned by #text...

 Shoes.app do
el = edit_line
el.text = "some text"
p el.text
 end

=> nil

  is this normal?  is there a way to set the text so that it is returned as
a default with edit_line#text if the line is not changed?

thanks,

  - j

Re: [shoes] edit_line question

From:
ashbb
Date:
2011-07-30 @ 05:32
Hi J,

Thank you for sharing the issue. :)

> is this normal?
I think it's not normal...
But I'm not sure this is a bug or not.
In Shoes (not in Green Shoes), when the line, `el.text = "some text"`, is
executed, the edit_line element is not yet created actually.

> is there a way to set the text so that it is returned as a default with
> edit_line#text if the line is not changed?
How about this one? It's not so nice, though. :-P

Shoes.app do
  el = edit_line
  el.text = "some text"
  timer(0.01){para el.text}
end

ashbb

Re: [shoes] edit_line question

From:
J. Kaiden
Date:
2011-07-30 @ 11:24
hi ashbb,

  thanks for the reply...  interesting that waiting 1/100th of a second
works!  i managed a workaround where i pull the default text from an array,
and then reference it via the array rather than the edit_line#text...
 works, but not very pretty either ;)

  off topic - i really want to try out Green Shoes, but for some reason i
just can't install any version of gtk aside from that which came with my
package manager (gtk 0.19.3, on ubuntu 10.4.)  i've tried a bunch of
different gtk versions, and methods of installing - but nothing.  i'm trying
again with gtk 1.0 and ruby 1.9.2 patch 180 under rvm via the gem - i get
errors about Gdk::Drawable...  frustrating.  i've posted about this on the
gnome2 ruby forum http://www.ruby-forum.com/topic/2236450#new and i'm hoping
to figure out a solution...

  once i get gtk properly installed i'll certainly give GreenShoes a
test-drive, seems like it's got a lot of things i'm looking for...

  thanks again for all the help...

  - j

On Sat, Jul 30, 2011 at 7:32 AM, ashbb <ashbbb@gmail.com> wrote:

> Hi J,
>
> Thank you for sharing the issue. :)
>
> > is this normal?
> I think it's not normal...
> But I'm not sure this is a bug or not.
> In Shoes (not in Green Shoes), when the line, `el.text = "some text"`, is
> executed, the edit_line element is not yet created actually.
>
>
> > is there a way to set the text so that it is returned as a default with
> > edit_line#text if the line is not changed?
> How about this one? It's not so nice, though. :-P
>
>
> Shoes.app do
>   el = edit_line
>   el.text = "some text"
>   timer(0.01){para el.text}
> end
>
> ashbb
>

Re: [shoes] edit_line question

From:
ashbb
Date:
2011-07-30 @ 13:51
Hi J,

> i've posted about this on the gnome2 ruby forum
http://www.ruby-forum.com/topic/2236450#new and i'm hoping to figure out a
solution...

Cool.
I hope Kou or other Ruby/gnome2 core members find your post asap.

> once i get gtk properly installed i'll certainly give GreenShoes a
test-drive

Fantastic! Let's have fun with Green Shoes. :-D

ashbb