ashbb / green_shoes

Green Shoes is one of the colorful Shoes written in pure Ruby.
Other
204 stars 37 forks source link

Broken options: :left, :top, :resizable #49

Open translunar opened 12 years ago

translunar commented 12 years ago

It looks like the image method definition is trying to set the top and left positions of the Image object, but it doesn't actually appear to work. Is this normal?

I also can't get :resizable => false to work on the window method. I didn't try it on app.

Loving green_shoes so far. Trying to use it to build a GUI for rubyvis / sciruby.

John

ashbb commented 12 years ago

Hi John,

Yeah, the image method with :left and :top attributes doesn't work well for now. This is a bug. But sorry, I've no good solution so far. So, please write the code like this:

require 'green_shoes'
Shoes.app do
 image('./something.png').move 100, 100
end

If you can use the latest Green Shoes on Github, you can also write like this:

require 'green_shoes'
Shoes.app do
 style Shoes::Image, nocontrol: true
 image './something.png', left: 100, top: 100
end

The :resizable attirbute is not supported in Green Shoes so far.

BTW, are you trying to use Green Shoes to build a GUI for rubyvis / sciruby? Awesome!! On GitHub? Please let me know!

ashbb

translunar commented 12 years ago

Thanks. I was able to get it to work with move eventually.

And yes, I've been experimenting with using green shoes for a plotter GUI. You can find it in the gui branch of SciRuby/sciruby on github. (I have some more code I'll push today, most likely.)

FYI, though: I'm a terrible coder. Most likely someone else will come back and improve upon my ideas (clbustos has already threatened to), which is most of what I was hoping for. :)

Thanks again. John

On Sep 8, 2011, at 6:57 AM, ashbbreply@reply.github.com wrote:

Hi John,

Yeah, the image method with :left and :top attributes doesn't work well for now. This is a bug. But sorry, I've no good solution so far. So, please write the code like this:

require 'green_shoes'
Shoes.app do
image('./something.png').move 100, 100
end

If you can use the latest Green Shoes on Github, you can also write like this:

require 'green_shoes'
Shoes.app do
style Shoes::Image, nocontrol: true
image './something.png', left: 100, top: 100
end

The :resizable attirbute is not supported in Green Shoes so far.

BTW, are you trying to use Green Shoes to build a GUI for rubyvis / sciruby? Awesome!! On GitHub? Please let me know!

ashbb

Reply to this email directly or view it on GitHub: https://github.com/ashbb/green_shoes/issues/49#issuecomment-2039032

ashbb commented 12 years ago

Hi John,

Thank you for the fantastic suggestion. Try out sample56. ;-)

ashbb

translunar commented 12 years ago

Oh, nice! I actually implemented something very similar, but which also accepts an RSVG::Handle, in case the image has already been read.

The code's pretty similar to yours.

http://github.com/mohawkjohn/green_shoes

You'll also notice code in there for code_box, which is like edit_box but for Gtk::SourceView and Gtk::SourceBuffer. (I was preparing to do a pull request, but wanted to test a bit more first.)

translunar commented 12 years ago

Okay. Instead of doing a pull request, I'd just suggest you look at the commits I made in my fork (except for adding the gemspec). I also added a trivial resize method to App, and an option to set :title on alerts.

Possibly code_box should be a plugin instead.

ashbb commented 12 years ago

Hi John,

I've looked at your commits. The code_box, resize method and :title on alert are great ideas. Are they completed? If so, I'd like to merge your commits into my master repo. So, could you send me a pull request?

ashbb