Cowboy coding

Here’s the setup.
Shoes.app do
flow do
check(checked: true).click do |c|
# alert "#{c.checked?}"
para "Check 1 #{c.checked?}\n"
end
para "Check 1"
end
flow do
@c = check(checked: false).click do |c|
para "Check 2 #{c.checked?}\n"
end
para "Check 2"
@c.checked = true
end
para "First line or Last line?\n"
end

has different results on Linux(GTK) vs OSX. In Linux, the click block is run before the user gets a chance to check or uncheck. IMNSHO, that’s wrong and if the click block runs something complicated – like an SQL query, all kinds of strange things could happen. OSX does’nt run the click block at startup.

That undefined behaviour has been there for years and years. So I decided to ‘Go Cowboy’ — I asked the Shoes 4 team what they think and then without waiting for their answer, I changed Shoes 3.2 Linux to match OSX behaviour. Since Shoes 3.2 Windows uses GTK2, it applies there as well. That’s cowboy problem solving in action.

That’s a change you’ll see in 3.2.13.

Leave a Reply

Your email address will not be published. Required fields are marked *