cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Command icon not found

sgeggie
3-Visitor

Command icon not found

I am writing a plugin for Creo which adds two user-created commands to Creo. I would like to add an icon to these and have run into a number of issues.


First, even though the API flat out says that PTC recommends you use .pngs, only .gifs are accepted. I've simply converted to .gif, but it certainly indicates a general problem with the ProCmdIconSet function.


The REAL problem I'm having is that when I try to add a .gif file as an icon which ISN'T in the Creo directory, the function returns a PRO_TK_GENERAL_ERROR. I simply give the file name, "plugin_icon.gif", as argument and rely on the function to find it. The API claims that it searches for the icon in "Application text dir/resource". In my protk.dat file I set the text dir with the "TEXT_DIR" command. In fact, I know that Creo accepts this, as it loads the text file which I pass to ProMessageDisplay just fine.


The thing is, if I set the text directory to the internal text directory (Common Files/F000/text, for instance), the images load just fine (unless they're a .png).


Does anyone have any experience in using icons external to the Creo directory structure?


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
5 REPLIES 5

Sean,
You should set your text directory to the directory above the text directory. For example:

text_dir c:\myapp

c:\myapp contains the text directory.

The gif files should go to <app>\text\<language>\resource.

C:\myapp\text\usascii\resource

Patrick Williams | Engineering Systems | o: 616.698.3766 | c: 616.947.2110
[cid:image001.jpg@01CC4B8B.26E9B6D0]

The only other issue with TOOLKIT and the menus is this:

Only 1 application that modifies the ribbon UI will work. The subsequent applications menu commands will go to the default Toolkit tab. Fix in M010.


Patrick Williams | Engineering Systems | o: 616.698.3766 | c: 616.947.2110
[cid:image002.jpg@01CC4B8B.C794D920]
sgeggie
3-Visitor
(To:sgeggie)

That solved it. Thanks a lot, Patrick!


So it seems the TEXT_DIR command points to the folder containing the text dir, rather than the text dir itself.

Yes that is correct. Glad you got it working Sean.

Patrick Williams | Engineering Systems | o: 616.698.3766 | c: 616.947.2110
[cid:image001.jpg@01CC510C.405CE930]

I am also trying to use this command - We didn't use icons on our menu buttons previously, but with the Creo 1 ribbon bar we really need to!


However, although I can set an icon to a .gif file, it doesn't appear to take any account of the sizes. - The help suggests that it will 'automatically' use a file named "about_large.gif" for the 32x32 size icon and "about.gif" for the 16x16 icon, if the command is set to use "about.gif".


Has anyone got this to work? - The 16x16 being scaled up looks very poor and the 32x32 scaled down doesn't look any better either!



Thanks,


Chris.

Top Tags