Re: Ruby modules collection
Posted: Fri Jun 21, 2019 7:31 am
Thanks Nubeat !
DSP Robotics and FlowStone Graphical Programming Software Support and Forums
http://dsprobotics.com/support/
Nubeat7 wrote:welcome back Mr Trogluddite !
def messageBox(message, title = "FlowStone", type = nil, &callback)
type = 'ok' if !type || type.empty?
@messagebox_callback = callback
super(callback.__id__, message, title, type)
rescue StandardError
@messagebox_callback = nil
raise
end
def messageBoxFinished(id, reply)
if @messagebox_callback && id == @messagebox_callback.__id__
@messagebox_callback.call(reply)
end
ensure
@messagebox_callback = nil
end
messageBox(message, title, type) do |reply|
# The code in here runs when a messageBox button is clicked.
# For example...
watch("How kind of you to agree!") if reply == 'ok'
end
RJHollins wrote:It seems I can't select the 2nd menu option
Spogg wrote:This is a great idea!
When I was learning a bit about Ruby I set myself little exercises to make some basic functional modules. So I’ve attached these as my rather sad and weak contribution.
The quality of the coding and the style varies considerably as I made progress.
It might be useful to get comments about how stuff could be done better, or issues that I didn’t spot at the time.
Cheers
Spogg