PtScale from Photon 1.12

bridged with qdn.public.porting
Post Reply
Shouqin Huo

PtScale from Photon 1.12

Post by Shouqin Huo » Sat Jan 18, 2003 1:22 am

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

Serge Yuschenko

Re: PtScale from Photon 1.12

Post by Serge Yuschenko » Tue Jan 28, 2003 10:56 pm

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

1) Make shared library:

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

2) 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 :-). 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.

3) 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

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

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

5) The scpalette.pal, which you can take from "old Photon", is to be copied to /usr/photon/appbuilder.

6) 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

Post Reply

Return to “qdn.public.porting”