Page 1 of 1

Label, button and UserButton Hide in runtine

Posted: Tue Dec 20, 2022 9:06 pm
by roberto.gotti
Hi,
is it possible to hide Label, Buttun or UserButton by code during runtime?
Example : Hide a UserButton during Gcode program execution.
Thanks

Re: Label, button and UserButton Hide in runtine

Posted: Tue Dec 20, 2022 9:15 pm
by TomKerekes
Yes if it is a Custom Screen you can send Screen Script to change the Show property from 1 to 0.

Re: Label, button and UserButton Hide in runtine

Posted: Wed Dec 21, 2022 2:04 am
by TomKerekes
Here is an example to hide User Button 10. The first 10 User buttons should be avoided because those buttons can be shown/hidden in the Tool Setup | User Buttons so there can be a conflict when the Tool Setup state is different for the Screen Script for those buttons.

Code: Select all

#include "KMotionDef.h"

#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"

void main()
{
	if (ScreenScript("ID:IDC_But10,Show:0"))
		printf("Screen Script Failed\n");
	else
		printf("Screen Script Success\n");
}