This is ‘planing’ preview release, so if you find my ideas intersting (bringed by gtkmm interface for GTK+) let me know here or email at iakovz@gmail.com
It is assumed that you coded Photon in C, because of the lack of any documentation in the package (im working on it).
phab now can’t use the language of C++ ? oh my god . I have created a phab project from IDE. can I use the c++ , because now I have serval c++ files (which contain class and exception). and I want to use them in ths phab project .
I have downloaded the interface you provided , and I have a try .still not solve my problem . In proto.h ,may errors occur. such as :
void A::b() ;// error: parse error before ‘:’
any advice will be appreciated .Thanks!
I have downloaded the interface you provided , and I have a try .still not solve my problem . In proto.h ,may errors occur. such as :
void A::b() ;// error: parse error before ‘:’
who can help me .Thanks!
There several ways to use C++ with PhAB projects. One of them if doing like this. You create project, setup to use C++ source, make callbacks static AND DO NOT generate proto.h (there was option in PhAB, you should check it out). This is a rather nasty way…
The second way is to use my interface. Like this
create dummy project
draw you GUI modules in PhAB in this dummy Project
save all changes
extract *.wgt? files from project (you’ll need them only)
write code using my interface:
5a. when you want to realize GUI module from your code you write
Wgt* myModule = Wgt::create ("path to the module .wgt? file", “root container widget name”);
Here you’v created copy of widget from your module. Now you can extract widgets and realize/reparent them where you want:
like so:
Window main_window;
myModule->get_widget (“base”, main_window);
… / arrange main_window – bear in mind that all design from PhAB is already in main_window widget hierarchy /
…
main_window->realize ();
You can access properties of widgets (see: headers).
There also compatible interface to load PtWidget_t* from files: see Wgt.h
hi yakov , firstly very Thanks for your help! But I still can’t understand fully. I am a little beef-witted,
I will express the structure of my program clearly now. I have created a phab project from IDE. the question is I have some classes with exception in my.h and my.cpp. now I still not use these classes. just import them. then I try to compile the project. but in proto.h. some errors like int A:b() occur. the next step is that I will use these classes in some callback function.
the second method I am very confused . can you give me a example code . Thanks my email is: dxwang@mail.ustc.edu.cn
I have put libphotonmm.so.0.1.0 under the directory /usr/local/lib .
and put proc prop.h photonmm photomm.h under the /usr/local/include which directory I created.
In IDE,I have added the extra libs path and include path.
[quote=“dxwang”]
hi yakov , firstly very Thanks for your help! But I still can’t understand fully. I am a little beef-witted, :lol:
I will express the structure of my program clearly now. I have created a phab project from IDE. the question is I have some classes with exception in my.h and my.cpp. now I still not use these classes. just import them. then I try to compile the project. but in proto.h. some errors like int A:b() occur. the next step is that I will use these classes in some callback function.
[quote=“yakov”]
Proto.h is included by all .c and .cc file. Obviously if you have C++ code included from proto.h it will create problem when proto.h is included from a C file.
Maybe the solution would be to wrap the C++ code in #if __cplusplus / #endif.
Then make sure the callback that will call C++ object are .cc files
Proto.h is included by all .c and .cc file. .cc also a c++ file . can I change the .cpp to .cc . if do this, it’s necessary to add#if __cplusplus / #endif.
if not, the whole .h .cpp are all c++ code . where to add #if __cplusplus / #endif is reasonable ? Thanks