Search found 313 matches

by alys666
Fri Jan 24, 2020 10:44 am
Forum: C++ Development
Topic: Showing images from a video stream
Replies: 93
Views: 6127

Re: Showing images from a video stream

I wanted to draw current FPS and I noticed that "gc->SetFont(GetFont(), *wxWHITE);" adds another 20 ms :shock: i never rendered graphics with wxWidgets... but function virtual void wxGraphicsContext::SetFont(const wxGraphicsFont &font); looks closer to hardware, so must be more fast, you just have ...
by alys666
Tue Jan 21, 2020 8:30 am
Forum: C++ Development
Topic: Aui how to change size of a docked pane
Replies: 5
Views: 107

Re: Aui how to change size of a docked pane

I'v made a bottom docked pane for diagnostic messages to a user. And I want it showed up for 1 sec. and then minimized it's height. But I cant change its size what ever I tried. Thank you if i remember, for wxAuiManager, to hide/show docked pane, you just need to call(surprise!) pane.Show(), pane.H...
by alys666
Mon Jan 13, 2020 9:27 pm
Forum: C++ Development
Topic: Calculate the space needed
Replies: 4
Views: 144

Re: Calculate the space needed

read about wxFont and search around <wxFONTFAMILY_TELETYPE>
by alys666
Mon Jan 13, 2020 7:26 am
Forum: C++ Development
Topic: The thread does not want to finish because of the “TestDestroy” always return false.
Replies: 10
Views: 241

Re: The thread does not want to finish because of the “TestDestroy” always return false.

Thank you for your response. Unfortunately, I have seen that documentation link before and still don't understand it well. If you answer my following questions you will facilitate me to understand some things that I don't understand. After I call wxThread::Delete from outside a runtime error occurr...
by alys666
Mon Jan 13, 2020 7:19 am
Forum: C++ Development
Topic: The thread does not want to finish because of the “TestDestroy” always return false.
Replies: 10
Views: 241

Re: The thread does not want to finish because of the “TestDestroy” always return false.

if you want just test how the thread works, do your diagnostics via printf(...), or std::cout<<"text".
as doubleMax said you cannot use visual objects of wxWidgets from secondary threads, you can only send messsges of wxThreadMessage class to main frame(or any window of wxWidgets).
by alys666
Sat Jan 11, 2020 12:35 pm
Forum: C++ Development
Topic: wxwidgets flex bison
Replies: 10
Views: 348

Re: wxwidgets flex bison

the easiest way here -
console app writes to std::cout.
see wxProcess class and wxExecute functions, and how to read output of a secondary app started from wxWIdgets app.
so - you develop wxWIdgets app, which starts your "bison app", reads its console output and analyses it as needed.
by alys666
Fri Jan 10, 2020 9:41 pm
Forum: C++ Development
Topic: wxwidgets flex bison
Replies: 10
Views: 348

Re: wxwidgets flex bison

Anjum, 10-01-2020 With wxExecute we can execute the console application and capture the stdout data. But I would like to access those created arrays directly from a wxWidgets application. How can I do this ? if you already have captured stdout to (for example) wxArrayString... why there is a proble...
by alys666
Thu Jan 09, 2020 11:28 am
Forum: General Development
Topic: reduced version of program using 30% of the code
Replies: 4
Views: 160

Re: reduced version of program using 30% of the code

1.preprocessor
2. void interfaces implementaions.
if you have interfaces and their implementations, then you could define void implementations(which do nothing) and use them in restricted version.
by alys666
Mon Jan 06, 2020 10:14 pm
Forum: wxWidgets Development (Russian)
Topic: cutecode, Ну и где вопрос про треды?
Replies: 4
Views: 539

Re: cutecode, Ну и где вопрос про треды?

про rand ерунда какая-то. в базовой реализации он опасный, и его мьютексом надо защищать. другое дело что без мьютекса там ничего не упадет, просто будут взаимовлияние на генерируемую последовательность от тредов. по хорошему надо инициализировать генератор через srand случайным числом в самом начал...
by alys666
Mon Jan 06, 2020 3:56 pm
Forum: wxWidgets Development (Russian)
Topic: cutecode, Ну и где вопрос про треды?
Replies: 4
Views: 539

Re: cutecode, Ну и где вопрос про треды?

да они там все падать будут, кроме совсем невинных. там большинство можно только из главного треда вызывать. да и не надо на вторичных тредах делать серьезную функциональность. их роль вспомогательна - помочь головному треду в его задачах. нет списка безопасных. считай что опасные все, если явно не ...
by alys666
Mon Jan 06, 2020 12:06 pm
Forum: wxWidgets Development (Russian)
Topic: cutecode, Ну и где вопрос про треды?
Replies: 4
Views: 539

cutecode, Ну и где вопрос про треды?

короче из тела треда ты можешь использовать любую тредсэйв функцию как родную. но функция должна быть таковой обьявлена в доках или комментах к ней. функция что не обращается к глобальным обьектам, или внешним устройствам напрямую, то есть к ресурсам - тредсейф. например сложить два числа и вернуть ...
by alys666
Mon Jan 06, 2020 11:46 am
Forum: C++ Development
Topic: Should I call wxLocal::Init() on every wxThread created?
Replies: 13
Views: 258

Re: Should I call wxLocal::Init() on every wxThread created?

the main problem here is that thread-safety of wsString is not explicitly stated, and could depend on implementation, OS, compiler, etc. So stable code must assume the worst scenario and so, use cloning... this "may be...may be not" just confuses, imho. ps. i do not remember how i had built wxWIdget...
by alys666
Mon Jan 06, 2020 11:03 am
Forum: C++ Development
Topic: Should I call wxLocal::Init() on every wxThread created?
Replies: 13
Views: 258

Re: Should I call wxLocal::Init() on every wxThread created?

Sorry, I do not understand the question. What I wrote in my previous post was that unless you are using a non-default wxWidgets build or an old compiler, the wxString is not reference-counted, i.e., it does not use copy-on-write. from docs - wxString wxString::Clone ()const Returns a deep copy of t...
by alys666
Mon Jan 06, 2020 10:45 am
Forum: C++ Development
Topic: Should I call wxLocal::Init() on every wxThread created?
Replies: 13
Views: 258

Re: Should I call wxLocal::Init() on every wxThread created?

giving wxString by value to a thread doesnot help you, because two wxString instances will refer to the same buffer with string data. every string you gave to a thread must be cloned by string.Clone(); The default wxString implementation uses std::(w)string which AFAIK does not use reference-counti...
by alys666
Mon Jan 06, 2020 10:16 am
Forum: C++ Development
Topic: Should I call wxLocal::Init() on every wxThread created?
Replies: 13
Views: 258

Re: Should I call wxLocal::Init() on every wxThread created?

Спасибо, братан. Получается если я из потока вызываю какую либо глобальную функцию, то я также должен делать копию строки? bool sum_global_dll_func(wxString& sz) { ... } wxMyThread::func() { wxString sz; sum_global_dll_func(sz.clone()); } Очень интересно, щас попробую. thx hey, it's wrong. i said a...