Label, button and UserButton Hide in runtine

Moderators: TomKerekes, dynomotion

Post Reply
roberto.gotti
Posts: 1
Joined: Tue Dec 20, 2022 8:57 pm

Label, button and UserButton Hide in runtine

Post by roberto.gotti » Tue Dec 20, 2022 9:06 pm

Hi,
is it possible to hide Label, Buttun or UserButton by code during runtime?
Example : Hide a UserButton during Gcode program execution.
Thanks

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Label, button and UserButton Hide in runtine

Post by TomKerekes » Tue Dec 20, 2022 9:15 pm

Yes if it is a Custom Screen you can send Screen Script to change the Show property from 1 to 0.
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Label, button and UserButton Hide in runtine

Post by TomKerekes » Wed Dec 21, 2022 2:04 am

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");
}
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply