Skip to content

Idea: Adding UI::Eventable to label #55

@friendlyuis

Description

@friendlyuis

Hi All,

I was trying to make a simple menu system with lists//labels and realized there were no actual way of making it work (or at least, that I know of) so I started thinking, can't we make anything anything tap-able like UI::Button? Now I haven't tried this, but looking at the button.rb file, I found this:

def initialize(view)
@view = view
end

def onClick(button)
@view.trigger :tap
end
end

module UI
class Button < UI::Control
include Eventable

...

Does it mean all we have to do to make labels tap-able is add the first two methods and include UI::Control::Eventable in the Label Class? I tried to modify the label.rb files but they were read-only. Needless to say I haven't actually actioned anything yet.

If there's an obvious solution that already exists, I apologise in advance, I'm new to ruby, rubymotion and the mac ecosystem. lol. Figured I'd suggest it, just as food for thought. Let me know what you guys think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions