Page 1 of 1

Don't understand warning

Posted: Tue Oct 09, 2018 5:40 pm
by Tony0945
Linux wxwidgets 3.0.4 compiled without gtk and with universal and X11
gcc 7.3.0

My application compiles but the screen is full of these messages while compiling. They don't occur when wxwidgets is compiled with gtk.
/usr/include/wx-3.0-X11/wx/univ/window.h:18:28: warning: attribute ignored in declaration of 'class wxControlRenderer' [-Wattributes]
class WXDLLIMPEXP_FWD_CORE wxControlRenderer;
Googling about it seems that there are harmless but annoying. Is there a compiler option to stop this? I thought of patching WXDLLIMPEXP_FWD_CORE out but it seemed risky. I've got to say that everytime I look at the source code I feel like I'm descending into macro hell.

Re: Don't understand warning

Posted: Tue Oct 09, 2018 6:24 pm
by DavidHart
Hi,

You can probably turn off those warning with something from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html. But wxX11 is undermaintained and little-used, and so is far from bug-free. If at all possible I suggest using wxGTK instead.

If for some reason you really can't, I'm afraid that you have to expect issues.

Regards,

David

Re: Don't understand warning

Posted: Tue Oct 09, 2018 6:34 pm
by Tony0945
I'll try -Wno-attributes.

The problem with wxGTK is that it behaves differently from wxMSW. I want the same behavior and look on both platforms. I don't really care if my application looks and behaves like other gtk applications, I want it to be the same on all platforms.

In regard to your warning, I first built wxwidgets-3.1.1 but, as you say, it is missing a lot.

Re: Don't understand warning

Posted: Tue Oct 09, 2018 8:49 pm
by ONEEYEMAN
Hi,
1. What differences did you encounter? Just name a few.
Is the sample(s) behave the same or different?
How can we see that?
What Windows version did you try the samples on? Which exact GTK+ one?

2. As you already found wxX11 is seriously un-maintained.
If you want to use it - you are on your own.

Now while Vadim and all other core-devs won't mind patches to wxX11 port they won't spend time on it.
That port was made as a placeholder for a possibility to a new (future) port of wxWidgets - think about it as wxUniversal on *nix.

On top of that with X server going away and being replaced with Wayland the port will become obsolete pretty soon.

Thank you.

Re: Don't understand warning

Posted: Tue Oct 09, 2018 9:49 pm
by Tony0945
Hi. One difference was that on wxGTK you can't override erasing the background for transparency, gtk will always erase it.

IIRC with the file dialog there was a problem when expanding and another when selecting. Doublemax suggested using the universal file dialog and that worked. I've been looking for a link but whenever I add the word "universal", google gives me a ton of links to Universal Studios.

More than that I am disenchanted generally with gtk and RedHat's opaque interfaces. I considered switching to qt but after years of working with wxwidgets it would be a steep re-learning curve.

Are you the ONEYEMAN from Gentoo?

P.S. Yes adding -Wno-attributes to CXXFLAGS makes the warning go away.

Re: Don't understand warning

Posted: Tue Oct 09, 2018 9:59 pm
by ONEEYEMAN
Hi,
Yes, I am. "One" and only. ;-)
In terms of erasing background - did you try to catch the EVT_ERASEBACKGROUND?

About the file dialog - I was looking at that discussion with doublemax, but didn't want to interfere. What was the problem? Can you dig it up?

My suggestion - don't go to Qt.
They are too far from C++ standards and still encourage people to use their container classes.

BTW, do you know that there is a very childish port of wxQt? It is absolutely not ready for production yet, but it starts getting patches on github and hopefully will become a full blown port soon.

I just don't know whether its worth it considering that Qt itself is not C++ standard-complaint... ;-)

Thank you.

P.S.: I'm interested in wxQt, because my current company re-wrote a huge product that was written with wx in Qt (because users wanted a cute interface).
Ugly decision, but now it just would be interesting if everything can be ported in wxQt.

Re: Don't understand warning

Posted: Tue Oct 09, 2018 11:38 pm
by Tony0945
Found that link: viewtopic.php?f=1&t=44230

Re EVT_ERASEBACKGROUND, apparently not, at least in this incarnation

Code: Select all

tony@MSI src $ grep EVT_ERASEBACKGROUND *.cpp
tony@MSI src $ 
I do have:

Code: Select all

wxEVT_ERASE_BACKGROUND
The code here http://dpaste.com/3XASJTT is a workaround that works if the parent has a plain colored background.
Now I want to have it work for a background that is a bitmap, too.
The header file is: http://dpaste.com/0M4MVXA

If I can kludge around this, I'll abandon wxX11 for another day (famous last words).

The application is a desktop like i3, Mate, XP, but without Mate's binary data and need for dbus. All configuration data in plain text ala the old .ini files (and i3).

Re: Don't understand warning

Posted: Sat Oct 13, 2018 5:39 am
by stahta01
Tony0945 wrote:Linux wxwidgets 3.0.4 compiled without gtk and with universal and X11
gcc 7.3.0

My application compiles but the screen is full of these messages while compiling. They don't occur when wxwidgets is compiled with gtk.
/usr/include/wx-3.0-X11/wx/univ/window.h:18:28: warning: attribute ignored in declaration of 'class wxControlRenderer' [-Wattributes]
class WXDLLIMPEXP_FWD_CORE wxControlRenderer;
Googling about it seems that there are harmless but annoying. Is there a compiler option to stop this? I thought of patching WXDLLIMPEXP_FWD_CORE out but it seemed risky. I've got to say that everytime I look at the source code I feel like I'm descending into macro hell.
If I remember, I will see if I can find the simple and correct fix for this when I have time.

Tim S.

Re: Don't understand warning

Posted: Sat Oct 13, 2018 4:48 pm
by stahta01
stahta01 wrote:
Tony0945 wrote:Linux wxwidgets 3.0.4 compiled without gtk and with universal and X11
gcc 7.3.0

My application compiles but the screen is full of these messages while compiling. They don't occur when wxwidgets is compiled with gtk.
/usr/include/wx-3.0-X11/wx/univ/window.h:18:28: warning: attribute ignored in declaration of 'class wxControlRenderer' [-Wattributes]
class WXDLLIMPEXP_FWD_CORE wxControlRenderer;
Googling about it seems that there are harmless but annoying. Is there a compiler option to stop this? I thought of patching WXDLLIMPEXP_FWD_CORE out but it seemed risky. I've got to say that everytime I look at the source code I feel like I'm descending into macro hell.
If I remember, I will see if I can find the simple and correct fix for this when I have time.

Tim S.
A possible workaround is including "wx/defs.h" before including the wx headers that have the problem.

Tim S.

Re: Don't understand warning

Posted: Sat Oct 13, 2018 9:54 pm
by Tony0945
Sorry, that didn't make any difference

Re: Don't understand warning

Posted: Sat Oct 20, 2018 12:13 pm
by stahta01
Tony0945 wrote:I'll try -Wno-attributes.

The problem with wxGTK is that it behaves differently from wxMSW. I want the same behavior and look on both platforms. I don't really care if my application looks and behaves like other gtk applications, I want it to be the same on all platforms.

In regard to your warning, I first built wxwidgets-3.1.1 but, as you say, it is missing a lot.
I would try using wxGTK on Windows and see how it works and looks for you.

Since your post, I have gotten wxGTK/Univ to build on Linux and Windows and you might try that if plain wxGTK is not good enough.

The fixes are only to wxWidgets git master branch.

Tim S.