Wxwidgets looks old in Linux

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Wxwidgets looks old in Linux

Post by Mamo_Grag17 »

Hello,
I started with wxwidgets programming, so i made a simple app but my problem is that the look is too old, i don't know where is the problem,
Can ang one please help me.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Wxwidgets looks old in Linux

Post by doublemax »

That's very vague, can you show a screenshot?

If i had to guess, you've probably used the X11 port rather than the GTK port.

How did you install wxWidgets?
If you built it yourself, which configure line did you use, and which command did you use to build?
Use the source, Luke!
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: Wxwidgets looks old in Linux

Post by Mamo_Grag17 »

Hello,
Thanks for reply,
First of all, i built wxwidgets as static library,
Second, i don't know exactly wich port i used because i don't even know what's the difference between them.
Last edited by Mamo_Grag17 on Thu Mar 31, 2022 9:22 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Wxwidgets looks old in Linux

Post by doublemax »

Mamo_Grag17 wrote: Thu Mar 31, 2022 8:35 pm First of all, i built wxwidgets as static library
That's very unusual under Linux and not recommended.
Second, i don't know exactly wich port i used because i don't even know what's the difference between them.
How exactly did you build wxWidgets? Which configure command and build command did you use?

https://wiki.wxwidgets.org/Compiling_an ... he_library
Use the source, Luke!
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: Wxwidgets looks old in Linux

Post by Mamo_Grag17 »

Sorry actually i built it as shared library using :

Code: Select all

../configure --disable-shared --enable-unicode

Code: Select all

make
So how do i need to build it, wich command should i use ?
This is how it looks :
https://ibb.co/KyRbtdd
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: Wxwidgets looks old in Linux

Post by Mamo_Grag17 »

I am using CMakeFiles to build the project, does it have any relationship with this problem?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Wxwidgets looks old in Linux

Post by ONEEYEMAN »

Hi,
What distro do you use?
You should have GTK-development package installed and all of its dependencies.

And then re-run "configure &make" as follows:

Code: Select all

make distclean
../configure --enable-debug --with-gtk=3 && make -j4
cd samples/minimal
make
Thank you.

P.S.: And yes - building STATIC library on *nix is STRONGLY DISCOURAGED. You are opening yourself for the possibility of the lawsuit if the underlying toolkit either GTK, Qt or Cocoa will change the license to prohibit static linking altogether.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Wxwidgets looks old in Linux

Post by doublemax »

Mamo_Grag17 wrote: Thu Mar 31, 2022 9:25 pm I am using CMakeFiles to build the project, does it have any relationship with this problem?
wxWidgets already comes with makefiles for Linux, these should work out of the box.

Can you show the last part of the "configure" output, the part that looks like this:

Code: Select all

Configured wxWidgets 3.1.6 for `x86_64-pc-linux-gnu'

  Which GUI toolkit should wxWidgets use?                 GTK+ 3 with support for GTK+ printing
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.8      no
                                       wxWidgets 3.0      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               builtin
                                       png                sys
                                       regex              builtin
                                       tiff               builtin
                                       lzma               no
                                       zlib               sys
                                       expat              sys
                                       libmspack          no
                                       sdl                no
After you build wxWidgets, build and run the "minimal" sample that comes with wxWidgets using the same command line. Check how that looks.
Use the source, Luke!
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: Wxwidgets looks old in Linux

Post by Mamo_Grag17 »

Thanks for replying,
I am using Arch Linux, i don't know wich package should i install exactly, do you mean these :
Gtk4 and gtk3 and gtkmm4 and gtkmm3 ?

If yes i already have them installed.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Wxwidgets looks old in Linux

Post by doublemax »

Code: Select all

Which GUI toolkit should wxWidgets use?                 GTK+ 3 with support for GTK+ printing
Please check this line of the configure output to confirm that you're really using the GTK build.
Use the source, Luke!
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: Wxwidgets looks old in Linux

Post by Mamo_Grag17 »

I built it using the command thag you gave me, so when i ran the minimal example, the look is good, but when i ran mine, it's still the same old look, does how i included the library effects,
I am doing this to include it(the version that i built just now :

Code: Select all

#include <wx-3.1/wx/wx.h>
I also tried :

Code: Select all

#include <wx-3.0/wx/wx.h>
And :

Code: Select all

#include <wx/wx.h>
But the same problem !!
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Wxwidgets looks old in Linux

Post by DavidHart »

Hi,

Various points:

You can find which wx version your program is using by doing Ctl-Shift-MiddleClick over a running instance.
wxWidgetsVersion.png
wxWidgetsVersion.png (19.49 KiB) Viewed 802 times
I am doing this to include it
#include <wx-3.1/wx/wx.h>...
It's usually not necessary to point to a particular wx version in that way; it should be found automatically.

According to google, Arch uses 'update-alternatives'. If so, you should be able to select which wx install is the default:

Code: Select all

#> update-alternatives --config wx-config
and follow the instructions.

Alternatively, point to a particular wx-config in your terminal's PATH:

Code: Select all

PATH=/full/path/to/that/wx-config:$PATH
If you want several wx versions to co-exist, the easiest way is to 'install' each in a separate subdir of the source dir. e.g.:

Code: Select all

mkdir wx3.1.6 && cd wx3.1.6 && ../configure --enable-debug --with-gtk=3 && make -j$(nproc)
You don't need to do 'make install'. Instead you point to the resulting wx-config e.g.

Code: Select all

PATH=/full/path/to/sourcedir/wx3.1.6/wx-config:$PATH
Regards,

David
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Wxwidgets looks old in Linux

Post by ONEEYEMAN »

Hi,
Moe than likely you need to fix you Makefile/CMake files to point to the appropriate configuration.
At this point I'd delete everything wx related unpack a new wx folder , build the debug version with the command I provided (make sure to note configure output per doublemax reply above), build and run minimal sample and then try to build you project.

Thank you.
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: Wxwidgets looks old in Linux

Post by Mamo_Grag17 »

Hello,
So when i ran :

Code: Select all

../configure --enable-debug --with-gtk=3
I got :

Code: Select all

which GUI toolkit should wxWidgets use? 
          GTK+ 3 with support for GTK+ printing libnotify
Then when i tried :

Code: Select all

su
make install
I got some errors :

Code: Select all

/bin/sh: line 1: cd: ../build/ bakefiles/wxpresets/presets: No such file or directory

/usr/bin/install: cannot stat 'wx.bkl': No such file or directory 
/usr/bin/install: cannot stat 'wx_unix.bkl': No such file or directory 
/usr/bin/install: cannot stat 'wx win32.bkl": No such file or directory 
/usr/bin/install: cannot stat 'wx_xrc.bkl': No such file or directory

/usr/bin/install: cannot stat 'wx_presets.py': No such file or directory
make: *** [Makefile: 13884: install] Error 1
Does these errors have any relationship with my problem ?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Wxwidgets looks old in Linux

Post by ONEEYEMAN »

Hi,
I presume you started a fresh...
Please post a complete configure result output
Did you run "make" after running configure?

Thank you.
Post Reply