Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi,
can any one tell me if creo parametric toolkit and creo object toolkit are different ? I am not able to load the .res file using ProUiDialogcreate function.
Can uifcCreateDialog() function be used along with creo parametric toolkit application ?
or any other libraries to be added ?
Thanks
Hello!
I did not try with Creo Toolkit, but with OTK Java did.
Here is a snippet of my code:
public class Dialog extends DefaultUICommandActionListener
{
public static String OTK_SERVER_DIALOG = "TrainingUI";
public static String OTK_CLOSE_BUTTON = "CommitCancel";
public static String OTK_OK_BUTTON = "CommitOK";
@Override
public void OnCommand() throws jxthrowable
{
showDialog();
}
public void showDialog()
{
try
{
/*
* Create a dialog from resource file and fill deatils of the Server , Workspaces and Cache
*/
uifcComponent.CreateDialog(OTK_SERVER_DIALOG,OTK_SERVER_DIALOG);
uifcPushButton.PushButtonFind(OTK_SERVER_DIALOG, OTK_CLOSE_BUTTON).AddActionListener(new Close_listener());
uifcPushButton.PushButtonFind(OTK_SERVER_DIALOG, OTK_OK_BUTTON).AddActionListener(new OK_listener());
/*
* Display and Activate Dialog.
* Please note that ActivateDialog() is a BLOCKING call here.
* uifcCoponent.ExitDialog() will unblock this
*/
uifcComponent.ActivateDialog(OTK_SERVER_DIALOG);
uifcComponent.DestroyDialog(OTK_SERVER_DIALOG);
}
catch (jxthrowable e)
{
e.printStackTrace();
}
}
}
hi,
thank you so much. did you refere 'otk_java' file in otk folder for reference ?
Yes, I watched that example.
Also read this manual for Creo UI.
Best Regards!
Hi
Also in Creo TK it's possible to mix TK and OTK functions. We often use the TK functions to create a dialog, activate it and destroy it. We use the OTK functions for all connections and callbacks (be aware that not all destructors get called). So it's a matter of what you want to do.
Br,
Eike
Hi,
Is it like we need to use OTK functions for call back or can we use toolkit functions ?
Thanks
You can use also ProToolkit call back functions for PushButtons e.g.. But remember, if you want to programm structured code the callback adress need to be in global space and not inside your instance. From the callback function you can then go back inside your instance by a pointer that is transfered over ProAppData.
e.g.
void callback {char * dialog, char * command, ProAppData data) {
meow * cp = (meow *)data;
cp->buttonCallback();
}
class meow {
public:
meow () {
//create Dialog
// connect everything
ProUIPushButtonActivateActionSet(dialogname, buttonname, callback, &this);
ProDialogActivate(...);
}
void buttonCallback() {
}
}
I haven't tested these ... just as an idea.
Br,
Eike