Firstly, may i request a way to create a Slider without a text box (or is there a way i’ve missed!). Currently you create the text box and then `setTexTboxStyle(Slider::NoTextBox …). This has the effect of deleting the default one.
Why does this matter?
Because setting things up and changing things are two different situations. When you create things, you’re just initialising but when you change, you’re sending out change notifications, repaints, etc.
threading problem?
Ok, in order to assist app start up, i do much of my initialisation in a background thread. I’ve discovered that i can create almost all my UI in a background thread on startup providing none of it is attached to the main window during this time.
so, thread creates everything. thread posts “i’m done”, main UI performs `MainWindow::setContentOwned’. works a treat! While this thread is in progress, the main UI can show a splash screen or even make a very simple UI to entertain the user.
Everything works fab except the Slider. changing the style to “NoTextBox” causes a the old Label to be deleted and ~AsyncUpdater gets upset:
AsyncUpdater::~AsyncUpdater()
{
// You're deleting this object with a background thread while there's an update
// pending on the main event thread - that's pretty dodgy threading, as the callback could
// happen after this destructor has finished. You should either use a MessageManagerLock while
// deleting this object, or find some other way to avoid such a race condition.
jassert ((! isUpdatePending()) || MessageManager::getInstance()->currentThreadHasLockedMessageManager());
...
}
It’s correct actually. i don’t want to be going around updating things not on the main UI. However, this is not what i’m really doing here. ie changing. it’d prefer a way to simply create once as i want it.
what do you think?
– hugh.