I am attempting to follow the “Getting started” example listed in the JIVE repository, and I’m running into some issues with using the selectors. Neither selecting the “greeting” message nor the button seems to work for changing their appearance.
static juce::ValueTree topLevel(const juce::String &greeting)
{
static constexpr auto style = [] {
return new jive::Object{
{"background", "#14181D"},
{"foreground", "#CDD9E5"},
{"font-family", "Verdana"},
{"font-size", 15},
// GREETING SELECTOR HERE
{
"#greeting",
new jive::Object{
{"font-size", 25},
},
},
// BUTTON SELECTOR HERE
{
"Button",
new jive::Object{
{"background", "#255AB2"},
{"border-radius", 10},
{
"hover",
new jive::Object{
{"background", "#316DCA"},
},
},
},
},
};
};
return juce::ValueTree{
"Window",
{
{"style", style()},
{"width", 640},
{"height", 400},
{"justify-content", "centre"},
{"align-items", "centre"},
},
{
juce::ValueTree{
"Text",
{
{"id", "greeting"},
{"text", greeting},
{"margin", "0 0 20 0"},
},
},
},
};
}
// ------------------------ //
// inside of initialise //
juce::Timer::callAfterDelay(2000, [this]() mutable {
view.appendChild(juce::ValueTree{
"Button",
{
{"padding", "7 20"},
},
{
juce::ValueTree {
"Text",
{
{ "text", "Click me!" },
},
},
},
}, nullptr);
});
All of this code is actually inside of Main.cpp right now. From comparing my code to the example, I don’t see anything different between the two. Is there something I’m missing here, or is there some bug with the code currently?