Search found 165 matches

by gtafan
Mon Nov 19, 2018 12:37 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

Can you explain in more detail what you want to achieve? Especially: While the background thread is working, can the user continue to use the application in every way? Since the background thread is working all the time the main thread exists, the user should still be able to use the application in...
by gtafan
Fri Nov 16, 2018 4:13 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

Looks like the timer is not a perfect solution. I tried it, but in some situations it seems to behave like unsynchronized thread.
by gtafan
Tue Nov 13, 2018 4:00 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

I am not fearing pointers, but I hate to use them because they can produce memory leaks sometimes and they (memleaks) are really hard to find out. I see your point and I hate memory leaks, too. In this case though, you are quite safe because you delete your pointer only once and only upon ending th...
by gtafan
Tue Nov 13, 2018 1:12 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

Posibly I misunderstood something, I need to wait for the thread only at the end the rest it should run in background parallel to the main thread. Yes, that is what I tried to tell you with the examples I provided for you. You have to wait for your joined thread right after you ran it! (and not at ...
by gtafan
Fri Nov 09, 2018 4:27 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

Hi, So all in all the reason for MT is to not block UI for the time calculation is done? How much time does it take to perform it? Thank you. I have done no performance tests, since it is not limited to some special PC. Also since results from background thread are not used by the main application ...
by gtafan
Fri Nov 09, 2018 4:04 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

Hi, Can you do the calculation on timer? Or this calculation absolutely have to be done in background and your program will use the results of the calculation even in the middle of the processing? Thank you. P.S.: What I mean is this: Let's say you thread will add the number 2 to the parameter, lik...
by gtafan
Fri Nov 09, 2018 1:34 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

If you have only one joinable thread, and you must wait until it finishes, how is this different from not using threads at all? IMHO, joinable threads may be useful if you fire several at once. I consider this case as a way to speed up tasks that can be parallelized, and the app can't continue unti...
by gtafan
Fri Nov 09, 2018 12:59 pm
Forum: C++ Development
Topic: Internationalisation
Replies: 22
Views: 1926

Re: Internationalisation

After hours of reading documentation and triing diferent stuff, looks like I finaly solve the problem: wxTranslations *t=new wxTranslations(); t->SetLanguage(lng); wxLocale::AddCatalogLookupPathPrefix("."); t->AddCatalog("translations"); wxTranslations::Set(t); lng is the int value of the language. ...
by gtafan
Fri Nov 09, 2018 11:50 am
Forum: C++ Development
Topic: wxGetApp eeror
Replies: 6
Views: 844

Re: wxGetApp eeror

Hi, Usually people start with minimal sample. But in general - if you know what you are looking for, you go to the documentation first, then the sample, and only then go to search the web (Google). That should be the standard course of actions for every issue related to wxWidgets. Thank you. I agre...
by gtafan
Fri Nov 09, 2018 11:47 am
Forum: C++ Development
Topic: Internationalisation
Replies: 22
Views: 1926

Re: Internationalisation

ONEEYEMAN wrote:Hi,
Out of curiosity - is you program build in Debug or Release mode?

Thank you.
Release, what else. Always using Release only.
by gtafan
Fri Nov 09, 2018 11:45 am
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

My thread alocates no resorces, that should be freed and it make sence for the frame to wait for the thread to be terminated befor the frame is destoied. I was thinking to have something like that inside MyFrame class: MyThread thread; then in the constructor of MyFrame I have to call: thread.Run();...
by gtafan
Thu Nov 08, 2018 3:08 pm
Forum: C++ Development
Topic: Internationalisation
Replies: 22
Views: 1926

Re: Internationalisation

Hi, This is a complete failure on your side. Especially if you just starting - always start with the debug build. Now you will have to waste extra time and create a debug build of the library. Thank you. Not going to create that debug stuff, as it´s complete useles for me. It´s easier to write my o...
by gtafan
Thu Nov 08, 2018 3:03 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2544

Re: wxThread Kill()

If I understood you correctly, you want to have a second thread running, which should only be closed if your main programm is about to close. So you need a detached wxThread, or else (in the case of joinable) your main thread would wait for your sub thread to complete, which is never going to happe...
by gtafan
Wed Nov 07, 2018 12:56 pm
Forum: C++ Development
Topic: Internationalisation
Replies: 22
Views: 1926

Re: Internationalisation

ONEEYEMAN wrote:Hi,
Run the samplpe thru the debugger and see where it is initialized.

Thank you.
Sory, but this makes everything even more complicated, have no idea about that debugger stuff. I din´t even have the debug version ofwxWidgets.
by gtafan
Wed Nov 07, 2018 12:49 pm
Forum: C++ Development
Topic: wxGetApp eeror
Replies: 6
Views: 844

Re: wxGetApp eeror

ONEEYEMAN wrote:Hi,
Always!! check the sample first, before going to the web to search for the answer.

Thank you.
Which sample? I was tallking about code snipet not related to samples.