Search found 729 matches

by Manolo
Wed Jun 02, 2021 7:42 pm
Forum: C++ Development
Topic: Writing a loop on menu bar
Replies: 4
Views: 1086

Re: Writing a loop on menu bar

If you use static cast, you may hide some issue. Dangerous. If you use 'int' instead of 'size_t' you may get warnings. What I do in a down-loop where i=0 is valid, is add a break condition: for( size_t i = mbar->GetMenuCount(); i >= 0; --i ) { delete mbar->Remove( i ); if (i==0) break; 》 Or replace ...
by Manolo
Thu May 20, 2021 7:32 pm
Forum: Platform Related Issues
Topic: OpenGL | macOS Big Sur
Replies: 8
Views: 3935

Re: OpenGL | macOS Big Sur

This "gl-context vs main thread" is not new. OGL was not designed to work multithreaded externally . Internally it does a lot of multithreading, but you can not control it, unless you leave OGL and use Vulcan (or alike). There is a mayor rule: Only a thread can be set as current to a gl-context. So ...
by Manolo
Wed Apr 21, 2021 7:42 pm
Forum: Platform Related Issues
Topic: Glew init error with GTK3 wx 3.1.5
Replies: 9
Views: 4181

Re: Glew init error with GTK3 wx 3.1.5

Calling glewinit() from a paint-event doesn't seem a good idea. I find two reasons: a) Unless you set some flag, you're calling glewinit() time and time and time... b) In GTK the paint event may be handled before the window is realized . This means you can not set the gl-context as current, which is...
by Manolo
Mon Mar 29, 2021 12:52 pm
Forum: C++ Development
Topic: wxGLCanvas/wxGLContext: How to query pixel format?
Replies: 5
Views: 857

Re: wxGLCanvas/wxGLContext: How to query pixel format?

I guess I could possibly use wxGLAttributes::GetGLAttrs() but documentation doesn't specify the details of what is returned: Oh, yes, I forgot this function. It returns a pointer-to-integer with the list of "ints" that compose the list of parameters needed for OGL. The parameters values are OS-depe...
by Manolo
Sun Mar 28, 2021 8:01 pm
Forum: C++ Development
Topic: wxGLCanvas/wxGLContext: How to query pixel format?
Replies: 5
Views: 857

Re: wxGLCanvas/wxGLContext: How to query pixel format?

No, wxWidgets doesn't provide a function for retrieving the pixel format (PF). Normally, this PF is the same the app asked for (the wxGLCanvas attributes). But you can can use MSW specific function GetPixelFormat , and use it with the HDC returned by wxGLCanvas::GetHDC() so that it works with window...
by Manolo
Thu Jan 07, 2021 6:52 pm
Forum: Compiler / Linking / IDE Related
Topic: Create makefile for wxwidgets project
Replies: 10
Views: 1447

Re: Create makefile for wxwidgets project

Take a look at "minimal" sample (or anyother more complex sample), provided with your wxWidgets sources.
You'll see "makefile.xxx" files used for different compilers. Learn from them.
by Manolo
Thu Jan 07, 2021 6:47 pm
Forum: C++ Development
Topic: leak problem
Replies: 7
Views: 630

Re: leak problem

new whatever[10] This is bad. You're trying to create an array of "whatever" objects, but you don't give a name to that array. How would you delete that array? The best you can hope is that the compiler will dismiss that try. But it's also the worst, because you don't know if the compiler did it or...
by Manolo
Thu Jan 07, 2021 6:38 pm
Forum: C++ Development
Topic: main() start two main() threads, one for a C++ backend and a seconf for the wxWidgets GUI
Replies: 4
Views: 386

Re: main() start two main() threads, one for a C++ backend and a seconf for the wxWidgets GUI

My advise: Use wxWidgets as shown at any of its examples, like "minimal". This will call (internally) the required init-function (similar to main() for a console, WinMain() for GUI at MSWindow, etc). So, the app will start in its own thread, the main thread. Any GUI-call must be done in this main th...
by Manolo
Tue Dec 29, 2020 8:07 pm
Forum: C++ Development
Topic: wxThread and Freeglut
Replies: 12
Views: 745

Re: wxThread and Freeglut

You don't really need Freeglut. Mixing its events&windows handling with the wxWidgets handling is tricky. If you want to use predefined shapes (cylinder, sphere, etc) take a look at "glu" https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/#glu (no glut, without events/windows handling). Bu...
by Manolo
Mon Dec 21, 2020 8:53 pm
Forum: C++ Development
Topic: advice needed: opengl gui library that goes with Wx
Replies: 7
Views: 548

Re: advice needed: opengl gui library that goes with Wx

OpenGL does not provide any control (button, text, whatever). It just draws. wxWidgets asks the OS to draw the controls, and to receive the events they fire (mouse, keyboard, sizing, etc). The OS may draw on top of what OpenGL draws, but that's not a good approach. Some GUI libraries specialized in ...
by Manolo
Sat Dec 19, 2020 6:27 pm
Forum: C++ Development
Topic: Cleanly show/hide tool-tip? (not set tool tip)
Replies: 11
Views: 722

Re: Cleanly show/hide tool-tip? (not set tool tip)

Single window with several areas...
What if you put each area in a wxPanel, layout with sizers, and set a tooltip for each panel?
by Manolo
Fri Dec 18, 2020 8:38 pm
Forum: C++ Development
Topic: Cleanly show/hide tool-tip? (not set tool tip)
Replies: 11
Views: 722

Re: Cleanly show/hide tool-tip? (not set tool tip)

A tool-tip can be only used in a window.
Once wxwidgets sets it, by calling an OS function, its behaviour is that of the OS.

To disable the tool-tip (not showing when mouse hovers on) just call w->SetToolTip(wxEmptyString);
by Manolo
Fri Dec 18, 2020 7:35 pm
Forum: Compiler / Linking / IDE Related
Topic: How to make static compile of wxWidgets work in codeblocks
Replies: 49
Views: 3607

Re: How to make static compile of wxWidgets work in codeblocks

I understand (because I suffered it) that many of the problems come from the fact that there are a lot of concepts to be well understood before starting with wxWIdgets. Normally you learn those concepts in your education. But may many times you are self-tought, the hard way, and miss lots of things....
by Manolo
Fri Dec 11, 2020 6:24 pm
Forum: Compiler / Linking / IDE Related
Topic: Compiling Error
Replies: 5
Views: 638

Re: Compiling Error

When you change the compiler in most cases you must not only recompile your code, but the wx sources too.
by Manolo
Fri Dec 11, 2020 6:21 pm
Forum: C++ Development
Topic: How on keyPress enable national chars?
Replies: 1
Views: 265

Re: How on keyPress enable national chars?

Take a look at the keyboard sample provided with the wx sources.
Pay attention to differences beetween Key events and Char events. See how modifiers and final-composed-char are handled.