Jump to content

GOM scripting - User dialog - Button


---
 Share

Recommended Posts

Hello GOM users,

I was wondering if somebody could help me with understanding of user dialog input features?

I know how to operate with the value which is called from User Dialog.

image.png.b022476616dc4faaf921bb4aabeb1808.png

below attached is a way how i am using the user input from the User dialog

image.png.d94158437139b62734fade98a9b1ea0a.png

I was wondering if somebody could help me with Button set-up?

The idea is, that operator will select Dome or Panel button (it is Toggle Button Type) and i would like to work with this feature. I would like to make a decision IF Dome is selected, certain TXT file is loaded, else it would read a different file.

 

I tried to print the button value (i assume YES/NO or 1 or 0) but it did not work

image.png.25839c507906b46a6e4f165b2c18ab86.png

thank you for any help!

 

Regards

 

Dusan

 

 

Link to comment
Share on other sites

Hey Dusan,

Activities inside the dialog will be noticed inside the dialog event handler.

Whenever an action is run inside the dialog the 'widget' represents this action (eg the user is clicking the button).

If you then analyse the widget (eg is the widget name equal to the button name) you can take further steps.

def dialog_event_handler (widget):
	try:
		if widget.name==DIALOG.button.name:
			print (DIALOG.button.value)
	except:
		pass

Hope this helps!

Gruß, Jens

Link to comment
Share on other sites

 Share

×
×
  • Create New...