ProToolkit: Add a menu pushbutton
- July 16, 2020
- 2 replies
- 1848 views
Hello,
I wanted to add a menu button for my Toolkit App. Therefore I used the source code of the installation test as a reference. Everything worked well, and I could run my little test program via the pushbutton, but I have problems changing the name of the pushbutton.
Parts of my source code (Layout changed a little somehow…):
static wchar_t MSGFIL[] = {'u','s','e','r','.','t','x','t','\0'};
//Test Access for MenuButton
static uiCmdAccessState TestAccessDefault(uiCmdAccessMode access_mode)
{
return (ACCESS_AVAILABLE);
}
int user_initialize(int argc, char *argv[], char *version, char *build) //argc: number of arguments; *argv[]: arguments passed by Creo Parametric
{
//Add button to menu bar
ProError status;
uiCmdCmdId cmd_id;
ProMessageDisplay( MSGFIL, "USER %0s", "" );
status = ProCmdActionAdd("-TestApp",
(uiCmdCmdActFn)selectSurface,
uiProe2ndImmediate, TestAccessDefault,
PRO_B_TRUE, PRO_B_TRUE, &cmd_id);
status = ProMenubarmenuPushbuttonAdd("File", "-TestApp", "-Install Test Label", "Install Test Help",
"File.psh_rename", PRO_B_TRUE, cmd_id, MSGFIL);
return (0);
}
The problem is, if I change "-Install Test Label" and "Install Test Help" in ProMenubarmenuPushbuttonAdd, the button isn´t being displayed anymore.
Does anyone know how I can change the name of a Pushbutton? I didn´t find the ProMenubarmenuPushbuttonAdd method in the documentation.
Furthermore, how is the MSGFILE connected to all this? This file is the one that should be in the text_dir in my protk.dat file, right?
Thanks in advance

