ofxGuiExtended Examples

hi,

i am having problems with ofJson for the ofxGuiExtended examples. has anyone successfully run these examples on a mac with oF 9?

thanks in advance,

robot

Yep. All good here with ofxGuiExtended and ofJson though I haven’t tried out the examples. I’m using both inline json and an external json file for my theming and both seem to be working though I’m still testing everything. What issues are you having? I know that @frauzufall is updating the code regularly and that some files were missing from the bin/data folder yesterday (but fixed now).

Hey @robotPatrol,

can you check if your OF version contains a folder /libs/json ? There is no OF release containing ofJson yet (also 0.9.3 does not include it) so you need the current master branch in order for it to work.

Thanks for trying, please let me know how it goes!

Deborah

i think i misunderstood about the current master branch. i thought the reference to the current master branch was for the addon, not oF. i will upgrade my version and try the xamples again.

cheers,

robot

hi frauzufall,

i have downloaded the master branch of oF, but i receive a clang error because i don’t have openframeworksDebug.a and it doesn’t make it after trying to compile and example. trying to circumvent that, i copied libs/json into oF 9.3, but the examples still can’t find ofJson. here is the error readout:

CompileC /Users/thinctank/Library/Developer/Xcode/DerivedData/ofxGuiExtendedExample-aoszspmcqvtamxfigqkjlldnzqer/Build/Intermediates/ofxGuiExtendedExample.build/Debug/ofxGuiExtendedExample.build/Objects-normal/x86_64/ofxDOMBoxLayout.o /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/ofxDOMBoxLayout.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/examples/addons/ofxGuiExtendedExample
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Wno-invalid-offsetof -mmacosx-version-min=10.10 -g -mssse3 -Wno-sign-conversion -I/Users/thinctank/Library/Developer/Xcode/DerivedData/ofxGuiExtendedExample-aoszspmcqvtamxfigqkjlldnzqer/Build/Intermediates/ofxGuiExtendedExample.build/Debug/ofxGuiExtendedExample.build/ofxGuiExtendedExampleDebug.hmap -I/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/examples/addons/ofxGuiExtendedExample/bin/include -I…/…/…/libs/openFrameworks -I…/…/…/libs/openFrameworks/.settings -I…/…/…/libs/openFrameworks/3d -I…/…/…/libs/openFrameworks/app -I…/…/…/libs/openFrameworks/communication -I…/…/…/libs/openFrameworks/events -I…/…/…/libs/openFrameworks/gl -I…/…/…/libs/openFrameworks/graphics -I…/…/…/libs/openFrameworks/math -I…/…/…/libs/openFrameworks/sound -I…/…/…/libs/openFrameworks/types -I…/…/…/libs/openFrameworks/utils -I…/…/…/libs/openFrameworks/video -I…/…/…/libs/poco/include -I…/…/…/libs/freetype/include -I…/…/…/libs/freetype/include/freetype2 -I…/…/…/libs/fmodex/include -I…/…/…/libs/glew/include -I…/…/…/libs/FreeImage/include -I…/…/…/libs/tess2/include -I…/…/…/libs/cairo/include/cairo -I…/…/…/libs/rtAudio/include -I…/…/…/libs/glfw/include -I…/…/…/libs/boost/include -I…/…/…/libs/utf8cpp/include -I…/…/…/libs/openssl/include -Isrc -I/Users/thinctank/Library/Developer/Xcode/DerivedData/ofxGuiExtendedExample-aoszspmcqvtamxfigqkjlldnzqer/Build/Intermediates/ofxGuiExtendedExample.build/Debug/ofxGuiExtendedExample.build/DerivedSources/x86_64 -I/Users/thinctank/Library/Developer/Xcode/DerivedData/ofxGuiExtendedExample-aoszspmcqvtamxfigqkjlldnzqer/Build/Intermediates/ofxGuiExtendedExample.build/Debug/ofxGuiExtendedExample.build/DerivedSources -F/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/examples/addons/ofxGuiExtendedExample/bin -F/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/examples/addons/ofxGuiExtendedExample/…/…/…/libs/glut/lib/osx -D__MACOSX_CORE__ -mtune=native -MMD -MT dependencies -MF /Users/thinctank/Library/Developer/Xcode/DerivedData/ofxGuiExtendedExample-aoszspmcqvtamxfigqkjlldnzqer/Build/Intermediates/ofxGuiExtendedExample.build/Debug/ofxGuiExtendedExample.build/Objects-normal/x86_64/ofxDOMBoxLayout.d --serialize-diagnostics /Users/thinctank/Library/Developer/Xcode/DerivedData/ofxGuiExtendedExample-aoszspmcqvtamxfigqkjlldnzqer/Build/Intermediates/ofxGuiExtendedExample.build/Debug/ofxGuiExtendedExample.build/Objects-normal/x86_64/ofxDOMBoxLayout.dia -c /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/ofxDOMBoxLayout.cpp -o /Users/thinctank/Library/Developer/Xcode/DerivedData/ofxGuiExtendedExample-aoszspmcqvtamxfigqkjlldnzqer/Build/Intermediates/ofxGuiExtendedExample.build/Debug/ofxGuiExtendedExample.build/Objects-normal/x86_64/ofxDOMBoxLayout.o

In file included from /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/ofxDOMBoxLayout.cpp:28:
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:21:23: error: unknown type name ‘ofJson’
ofxGuiElement(const ofJson &config);
^
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:29:24: error: unknown type name ‘ofJson’
void setConfig(const ofJson &config, bool recursive = false);
^
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:31:23: error: unknown type name ‘ofJson’
void setTheme(const ofJson &config);
^
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:104:3: error: unknown type name ‘ofJson’
ofJson getTheme();
^
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:105:3: error: unknown type name ‘ofJson’
ofJson getGlobalConfigTheme();
^
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:116:33: error: unknown type name ‘ofJson’
virtual void _setConfig(const ofJson & config);
^
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:117:41: error: unknown type name ‘ofJson’
void _setConfigUsingClassifiers(const ofJson &config, bool recursive = false);
^
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:170:3: error: unknown type name ‘ofJson’
ofJson theme, individualConfig;
^
In file included from /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/ofxDOMBoxLayout.cpp:28:
In file included from /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:5:
…/…/…/libs/openFrameworks/types/ofParameter.h:404:34: error: cannot form a reference to ‘void’
ofParameter(const ParameterType & v);
^
In file included from /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/ofxDOMBoxLayout.cpp:28:
/Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:172:21: note: in instantiation of template class ‘ofParameter’ requested here
ofParameter parameter;
^
In file included from /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/ofxDOMBoxLayout.cpp:28:
In file included from /Users/thinctank/Documents/programming/openFrameworks/of_v0.9.3_osx_release/addons/ofxGuiExtended/src/view/…/ofxGuiElement.h:5:
…/…/…/libs/openFrameworks/types/ofParameter.h:405:54: error: cannot form a reference to ‘void’
ofParameter(const string& name, const ParameterType & v);
^
…/…/…/libs/openFrameworks/types/ofParameter.h:406:54: error: cannot form a reference to ‘void’
ofParameter(const string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max);
^
…/…/…/libs/openFrameworks/types/ofParameter.h:408:22: error: cannot form a reference to ‘void’
const ParameterType & get() const;
^
…/…/…/libs/openFrameworks/types/ofParameter.h:410:31: error: cannot form a reference to ‘void’
operator const ParameterType & () const;
^
…/…/…/libs/openFrameworks/types/ofParameter.h:441:22: error: cannot form a reference to ‘void’
const ParameterType & operator=(const ParameterType & v);
^
…/…/…/libs/openFrameworks/types/ofParameter.h:471:55: error: cannot form a reference to ‘void’
ofParameter & set(const ParameterType & v);
^
…/…/…/libs/openFrameworks/types/ofParameter.h:472:75: error: cannot form a reference to ‘void’
ofParameter & set(const string& name, const ParameterType & v);
^
…/…/…/libs/openFrameworks/types/ofParameter.h:473:75: error: cannot form a reference to ‘void’
ofParameter & set(const string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max);
^
…/…/…/libs/openFrameworks/types/ofParameter.h:475:83: error: cannot form a reference to ‘void’
ofParameter & setWithoutEventNotifications(const ParameterType & v);
^
…/…/…/libs/openFrameworks/types/ofParameter.h:477:34: error: cannot form a reference to ‘void’
void setMin(const ParameterType & min);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

thanks,

robot

Your output suggests that you still use the release version, I think. If you don’t, try to clean or recompile the example?

hi,

i did use the released version because i am missing the openframeworksDebug.a in the master branch version and it won’t compile. i was also missing the openframeworksDebug.a file when i downloaded the released vesrion, but it was generated after i tried to compile an example. no so for the branch version. so, i thought if i copied the json folder into the relased version, it may work, but it didn’t.

i have just cleaned and recompiled, but json is still unrecognized.

hi,

i made another attempt; it’s working. this time, i tried an example from the devApps examples folder (instead of the normal examples folder) and the Debug.a file was generated. out of curiosity, Is there something other than the json folder that allows your addon to work? why doesn’t copying the json foldr into the oF 9.3 build work?

robot

Did you include the header?

if the example works as is in one build of oF, wouldn’t that signify that it should in another? or do the includes needed depend upon the build?

i just tried to include json to run the example in oF 9.3 (not the working master branch version), but the build still failed with the same errors as posted above. it also fails with the namespace code.

I think there are more things missing in the release version like ofParameter<void>.

Glad to hear that it runs now!

I will later update the computation of the layout one more time though - found some bugs.

i see.

well, thanks for the addon in any case.

one thing i just noticed is that if i add the namespace code to ofxGuiElement.h:

/#include “json.hpp”
using ofJson = nlohmann::json;

in the header file, the ofJson flags dissapear, but they remain in the .cpp file. not sure if that means anything …

thanks for your help.

cheers,

01

@frauzufall, is there an easy way to show/hide individual panels?

hi frauzufall,

i have my gui setup using ofxGui, but wanted to change a few objects using ofxGuiExtended, however, there is a conflict betwen the 2 addons. do i have to use one or the other? can i use ofxGui:: and ofxGuiExtended:: to differentiate between the addons?

@robotPatrol, I think that ofxGui is pretty much built in to ofxGuiExtended so you should only need this in your header:

#include "ofxGuiExtended.h".

And your ofxGui code should still work.

A getVisibility() and setVisibility() for each element or at least for the panels would be great!

@robotPatrol Actually you might need to rename a few things for it to work: ofxPanel becomes ofxGuiPanel, ofxButton becomes ofxGuiButton, etc.

that’s the approach i used, but every time i included ofxguiextended, i had conflicts with ofxgui objects i had already used and my code no longer compiled. i wanted to use the functionality to have horizontally distributed toggle boxes, but i just did it with ofxgui since i didn’t want to redo my entire gui. i made panels for each toggle box and overlapped their headers so it looks like a cohesive grid.

@clem You can get an ofParameter controlling the visibility of any element with this function: getVisible()
Add it to your gui and set a name you like:

panel1->add(panel2->getVisible().set("show panel2", true));

No need to set any listeners. Tell me if it doesn’t work.

1 Like

@robotPatrol Yes ofxGuiExtended and ofxGui will not work together. I originally wanted to redo ofxGui so I used the same class names etc. I don’t really want to change that now. You could add namespaces around the classes in your local version but it’s probably all quite some work. Sorry.