ashbb / green_shoes

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

Roadmap Ideas #6

Open zzak opened 13 years ago

zzak commented 13 years ago

Here's a list of some of the ideas for green_shoes I have that I would like to see on the Roadmap as possible features:

If there is anything else I missed feel free to comment and add other ideas to the list.

sentientwaffle commented 13 years ago

I recently forked green_shoes and have been re-writing much of it. Mostly because I am a perfectionist and certain things bother me, not because of problems in the code. One of the things that bothers me about it is that there are effectively constructors. Example: to create a button we call

def button(name, args={}, &blk)
  args = basic_attributes args
  b = Gtk::Button.new name
  b.signal_connect "clicked", &blk if blk
  @canvas.put b, args[:left], args[:top]
  b.show_now
  args[:real], args[:text], args[:app] = b, name, self
  Button.new args
end

This in turn calls Gtk::Button#new and Button#new, which is an alias for Basic#new. This seems non-intuitive to me -- yes, we need the "button" method to create buttons, but I think that the Button class should create the GTK widget, not App.

I have done this for Flow and Stack already, see my fork http://github.com/sentientwaffle/green_shoes/tree/master/lib/shoes for details. The object hierarchy has a much more intuitive structure.

// sentientwaffle

ashbb commented 13 years ago

Hi sentientwaffle,

Wow, you forked and rewrote Green Shoes. Awesome! I reviewed your code a little and realized following two differences.

i) Use Gtk::VBox and HBox to implement stack and flow. ii) Change directory/file structure

I'm now trying to find a better way to implement Green Shoes. I don't think my approach is the best way. So, I'm happy to see your another approach. :)

Now, we've just started. Let's enjoy growing Green Shoes!

ashbb

sentientwaffle commented 13 years ago

Yes, the change in file directory structure is not really necessary at this point because of the size of the widget files. However, as we progress, there will be more methods and such. It just felt nicer to me to have stuff spread out more. About the HBox and VBox -- that was an experiment. I'm not really happy with how they work. If you notice, they do not wrap text when the window shrinks and I have little control over the widths and heights.

I am not particularly familiar with the original Shoes implementation of Flows and Stacks. What widget do they use?

ashbb commented 13 years ago

(Red) Shoes is using Gtk::Fixed widget. Look at _why's comment: https://github.com/shoes/shoes/blob/master/shoes/native/gtk.c#L377