As told in their documentation blocks, the elm_app_compile_*_dir_set() family of functions have to be called before elm_app_info_set():
We are here setting the fallback paths to the compiling time target paths, naturally. If you're building the example out of the project's build system, we're assuming they are the canonical ones.
After the program starts, elm_app_info_set() will actually run and then you'll see an intrincasy: Elementary does the prefix lookup twice. This is so because of the quicklaunch infrastructure in Elementary (Getting Started), which will register a predefined prefix for possible users of the launch schema. We're not hooking into a quick launch, so this first call can't be avoided.
If you ran this example from your "bindir" installation directory, no output will emerge from these both attempts – it will find the "magic" file there registered and set the prefixes silently. Otherwise, you could get something like:
WARNING: Could not determine its installed prefix for 'ELM' so am falling back on the compiled in default: usr implied by the following: bindir = usr/lib libdir = usr/lib datadir = usr/share/elementary localedir = usr/share/locale Try setting the following environment variables: ELM_PREFIX - points to the base prefix of install or the next 4 variables ELM_BIN_DIR - provide a specific binary directory ELM_LIB_DIR - provide a specific library directory ELM_DATA_DIR - provide a specific data directory ELM_LOCALE_DIR - provide a specific locale directory
if you also didn't change those environment variables (remember they are also a valid way of communicating your prefix to the binary) - this is the scenario where it fallbacks to the paths set for compile time.
Then, you can check the prefixes set on the standard output:
In the fragment
What follows is some boilerplate code, creating a frame with a button, our object of interest, and, below, widgets to change the button's behavior and exemplify the group of functions in question.We enabled the focus highlight object for this window, so that you can keep track of the current focused object better:
Following, there are 2 more buttons whose actions are focus/unfocus the top button, respectively:
The first restriction above you'll get by a second checkbox, whose callback is:
Next, there's a slider controlling the button's scale:
Experiment with it, so you understand the effect better. If you change its value, it will mess with the button's original size, naturally.
The full code for this example can be found here.