Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Progress Dialog for ScriptMaster

Featured Replies

Hello,

 

I really need a progress dialog function for ScriptMaster. Anyone have one? Or can point me in the direction of one?

 

Thanks,

Jeff

A bit of code which works properly under the GroovyConsole, but not fully in SM.
Any clues as to why, and how to make it function 360works gurus??
I presume it is thread related.
 
// progressBar(interval, fm_title)
// 12_11_10 JR
// v1.0

import groovy.swing.SwingBuilder    
import javax.swing.WindowConstants as WC
import java.awt.BorderLayout as BL
import javax.swing.BorderFactory
import java.awt.Toolkit

i = 1

udate = {
	while(i < 101){
		current.setValue(i)
		try{
			sleep(interval.toInteger())
		} catch (e){} //end try
	i++
	} //end while
} // end udate

SwingBuilder.build(){
frame = frame(title:fm_title, size:[300,90], locationRelativeTo: null, show:true, defaultCloseOperation:WC.DISPOSE_ON_CLOSE){
    panel{
        borderLayout()
        current = progressBar(id:'pb', indeterminate:false, value:0, orientation:0, stringPainted:1, maximum:100, constraints:BL.NORTH)
        current.setBorder(BorderFactory.createEmptyBorder(10, 30, 10, 40))
        //textArea()
        label = label(text:'A label goes here', constraints:BL.SOUTH)
        label.setBorder(BorderFactory.createEmptyBorder(20, 30, 10, 12))
    } //end panel
} //end frame
}

udate(current)
label.setText("<html>" + "<font color="#FF0000">" + "<b>" + 
"Done . . . ." + "</b>" + "</font>" + "</html>")
Toolkit.getDefaultToolkit().beep()

//uncomment these lines in console for self closing window
//sleep(1200)
//frame.dispose()

 

 

Answered my own question...

wrap the SwingBuilder to the end in a

 

Thread.start(){ } closure and it displays correctly.

 

So now a better question

How do I return a result from the second thread?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.