UI modifications using ApplicationFramework
Posted: 06 Feb 2021, 20:53
Hello.
I am new to NoesisGUI, and taking first steps trying to mate NoesisGUI with RxCpp. I modified Rss example - made a window with ListBox, and trying to insert items based on some data. Actual code is below:
As far as I modified existing example code, I use ApplicationFramework, and from time to time I get application crash in this function:
And also output console full of messages like these:
Obviously I do something wrong with threads, like inserting items from another thread, which is not the way it should be done. Could anyone tell me is it possible to implement UI modifications somewhere in the UI thread loop - using ApplicationFramework, or I need to write my own loop from scratch?
I am new to NoesisGUI, and taking first steps trying to mate NoesisGUI with RxCpp. I modified Rss example - made a window with ListBox, and trying to insert items based on some data. Actual code is below:
Code: Select all
const std::string content = /*some content*/;
if (auto list_box = FindName<ListBox>("listBox")) {
auto item = new ListBoxItem();
item->SetContent(content.c_str());
if (auto items = list_box->GetItems()) {
items->Insert(0, item);
}
}
Code: Select all
void Window::Render(double time)And also output console full of messages like these:
Code: Select all
[NOESIS/E] The calling thread (26264) cannot access this object (RssReader.MainWindow) because a different thread owns it (31924)
[NOESIS/E] The calling thread (26264) cannot access this object (ListBox) because a different thread owns it (31924)