Closed leviwilson closed 11 years ago
The proposed API seems cumbersome, e.g. it does not follow RAutomation API style. I'm not sure if it is possible technically, but it could be something like this:
window.menu(:text => "File").menu(:text => "Recent Files").menu(:text => "1.) last_file.txt").open
window.menu(:text => "File").menus.map(&:text) # => ["About", "Recent Files", ...]
window.menu(:text => "File").exists? # => true
In other words, menu should be just another control and have the same API like every other control + some method like my proposed #open
to finally select that menu item. Or maybe the method name should be #select
instead? Otherwise good idea to support menu items too.
What do you think about my ideas?
I like it. I'll refactor to be consistent with the api later today. On Nov 11, 2012 10:35 AM, "Jarmo Pertman" notifications@github.com wrote:
The proposed API seems cumbersome, e.g. it does not follow RAutomation API style. I'm not sure if it is possible technically, but it could be something like this:
window.menu(:text => "File").menu(:text => "Recent Files").menu(:text => "1.) last_file.txt").open window.menu(:text => "File").menus.map(&:text) # => ["About", "Recent Files", ...] window.menu(:text => "File").exists? # => true
In other words, menu should be just another control and have the same API like every other control + some method like my proposed #open to finally select that menu item. Or maybe the method name should be #selectinstead? Otherwise good idea to support menu items too.
What do you think about my ideas?
— Reply to this email directly or view it on GitHubhttps://github.com/jarmo/RAutomation/pull/35#issuecomment-10268371.
Refactored to include all of your suggestions. Let me know if this will work.
Added support to be able to select menu items when using the
ms_uia
adapter.Example