PtScale from Photon 1.12

I’m trying to port my photon code from qnx 4.25 & photon 1.12. I used a
widget, PtScale, which is not in the latest release of PhAB. I wonder if
there is a way to add that widget into the widget library.

thanks

Shouqin Huo
Quantum Magnetics

I did it some time ago. Fortunately I wrote a readme in order to be able to do it again :slight_smile:.

  1. Make shared library:

cc -shared -olibPtScale.so PtScale.c -v -Wl,-libPtScale.so

  1. Copy the library to the /usr/lib, and PtScale.h to the /usr/include/photon

Practicaly, that is all what you need to use the widget from your code. Just remember to explicitly include photon/PtScale.h because it is not referred from Pt.h and it is bad taste to modify somebody’s headers :slight_smile:. When build your program also don’t forget to add -l PtScale to command line.

Next steps explain how to add the widget to AB.

  1. Add the line below to /usr/photon/appbuilder/abpal.def to make the correspondent label appear in the widget list of the Application Builder.

Widgets,Scale,1,PtScale,555,176,187,186

Fields in the line have the following meanings.
(As I understood. I could be wrong).

Widgets - AB window name
Scale - text on the label
1 - ?
PtScale - widget class
555 - ?
176,187,186 - RGB of the button background

  1. These two lines go to the /usr/photon/appbuilder/palette.def

l=PtScale,<photon/PtScale.h>:ph
p=scpalette,Scale Widget

  1. The scpalette.pal, which you can take from “old Photon”, is to be copied to /usr/photon/appbuilder.

  2. PtScale and PtScale.img files are to be copied to
    /usr/photon/appbuilder/templates to show a PtScale button in the AB.

Sincerely,

Serge


I’m trying to port my photon code from qnx 4.25 &
photon 1.12. I used a
widget, PtScale, which is not in the latest release
of PhAB. I wonder if
there is a way to add that widget into the widget
library.

thanks

Shouqin Huo
Quantum Magnetics