PureBasic 5.70 LTS is out !

Developed or developing a new product in PureBasic? Tell the world about it.
Karellen
User
User
Posts: 82
Joined: Fri Aug 16, 2013 2:52 pm
Location: Germany

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Karellen »

Thanks to Fred and Team for the new version! Qt support for Linux is the way to go, I'm very happy about it and can't wait to start testing.

Oh, and by the way: Stay cool about the tone of some people here. Don't need to tell you anything about developing and releasing software, just wanted to let you know that I've been through this for decades by myself. Even if you release a program that calculates next week's lottery numbers, some unhappy ones will complain immediately about any crappy detail you never had in mind. That's just how it is!

I love PB the way it is and it's developing. When the new LTS is ready it's time for another donation!
Stanley decided to go to the meeting room...
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: PureBasic 5.70 LTS beta 1 is out !

Post by freak »

Here is some more info regarding the Qt subsystem:

We have introduced this subsystem because there are a number of problems with the Gtk3 subsystem which are rooted in deep differences between the PB and Gtk philosophy and therefore cannot be fixed easily. Qt is much more "PB friendly" as it turns out. Since Qt is also available under the LGPL since some time, there is also no license issue in the way anymore. We are hoping that this new subsystem becomes stable enough to be the new default on Linux at some point in the future. Don't worry if you still want to use Gtk: We do not plan to remove support for it, it just might stop being the default sometime.

License:
The license is LGPL and we are not statically linking (the binaries provided with the Linux distribution are used). So the license situation is the same as with Gtk. Commercial use should be no problem.

Dependencies:
The minimum Qt version is 5.5.
The following should install everything you need to compile (Ubuntu). The runtime dependencies should be available on any recent Linux distribution already:

Code: Select all

apt-get install qtbase5-dev qttools5-dev qtmultimedia5-dev qtdeclarative5-dev libqt5svg5-dev libqt5webkit5-dev libqt5multimedia5-plugins
Usage:
Just set "qt" as the used subsystem and all related libraries will switch to Qt (there should be no Gtk dependency anymore then). Of course this also means you cannot use any Gtk functions anymore to manipulate the GUI.

Scripting:
Since Qt is a C++ framework we cannot provide simple library imports to allow manipulating PB objects directly via API like it is possible with Gtk (or the Windows API). To allow at least some measure of API access, there is a new QtScript() command available which allows executing JavaScript code in the Qt QML engine and allows access to the PB GUI objects that inherit from QObject. It also allows interaction with the PB runtime library.

The command is simple:

Code: Select all

Result$ = QtScript(Script$)
If you have the PB debugger enabled, then errors in the JavaScript code will be reported through the PB debugger.

The following functions are available inside the script:

Code: Select all

PB object access. Returns the JS object representing the given PB object id.
  gadget(id)
  menu(id)
  statusbar(id)
  systray(id)
  toolbar(id)
  window(id)

Misc functions:
  debug(message)          - send a message to the PB debugger. Does nothing if debugger is off
  dump(object)            - dump a Qt object to a string. Useful for debugging or to discover what members are available in an object

PB Runtime integration:
  runtime.get(key)        - read a PB runtime value (variable, constant)
  runtime.set(key, value) - set a PB runtime variable
  runtime.call(key)       - call a PB runtime procedure. The procedure must have 0 arguments! If you want to pass a value, use runtime.set() on a global variable
More functions may be added later.

An example:

Code: Select all

  Runtime Procedure QtSignalHandler()
    MessageRequester("", "Signal received!")
  EndProcedure  
  
  If OpenWindow(0, 0, 0, 320, 250, "FrameGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ButtonGadget(0, 10,  10, 300, 50, "Original Text")

    ; show the ButtonGadget object's content
    Debug QtScript("dump(gadget(0))")
    
    ; modify the gadget text   
    QtScript(~"gadget(0).text = \"Modified Text\"")
    
    ; Connect a function to the "clicked" signal and call back into PB code
    ; Now if you click the gadget, the procedure is called
    QtScript(~"gadget(0).clicked.connect(function() { runtime.call(\"QtSignalHandler()\"); })")    

    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Other OS:
I know some of you are hoping for Qt on all OS, but I don't think this will be happening for various reasons:
  • Even though Qt is cross-platform, there are still a number of OS-specifics that are visible, especially in the details. So we would have to support and bugfix a "different" Qt subsystem for each OS. This is more work than you probably think, even if most of the code is shared.
  • On the other OS we already have a quite good integration with the native API, so we want to focus on that and not spend work on an "alternative" GUI subsystem that most people will not have any use for.
  • To me, having the same underlying framework on all OS only brings a benefit if you have full access to the framework in a cross-platform way as well. If you are limited to only what PB offers through its libraries, then what does it matter if it is Qt or Windows API below? (except that Qt would bring a ton of Dll dependencies on Windows)
  • As I said above, we developed this subsystem to solve a specific problem on Linux. The benefit of having it available on all OS simply do not justify the cost in my opinion.
quidquid Latine dictum sit altum videtur
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Kurzer »

Thank you very much Fred and Team for the brand new version.
I love the DPI aware feature! Great Job! Image
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Dude »

kurzer wrote:I love the DPI aware feature!
I have no idea how it works. Can someone explain?
User avatar
Teddy Rogers
User
User
Posts: 92
Joined: Sun Feb 23, 2014 2:05 am
Location: Australia
Contact:

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Teddy Rogers »

fryquez wrote:Thanks for the DPI Aware feature.
Any thoughts about PerMonitor Awareness? It can be set in the manifest, too.

Code: Select all

<dpiAware>True/PM</dpiAware>
<dpiAwareness>PerMonitorV2, PerMonitor</dpiAwareness>
High-DPI Scaling Improvements for Desktop Applications in the Windows 10 Creators Update (1703)
I'm going to have to quote this post and add a big +1 to it. This is definitely something much needed on Windows 10 for multi-monitor setups with different scaling...

Ted.
User avatar
Ajm
Enthusiast
Enthusiast
Posts: 234
Joined: Fri Apr 25, 2003 9:27 pm
Location: Kent, UK

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Ajm »

freak wrote:Here is some more info regarding the Qt subsystem:

We have introduced this subsystem because there are a number of problems with the Gtk3 subsystem which are rooted in deep differences between the PB and Gtk philosophy and therefore cannot be fixed easily. Qt is much more "PB friendly" as it turns out. Since Qt is also available under the LGPL since some time, there is also no license issue in the way anymore. We are hoping that this new subsystem becomes stable enough to be the new default on Linux at some point in the future. Don't worry if you still want to use Gtk: We do not plan to remove support for it, it just might stop being the default sometime.

License:
The license is LGPL and we are not statically linking (the binaries provided with the Linux distribution are used). So the license situation is the same as with Gtk. Commercial use should be no problem.

Dependencies:
The minimum Qt version is 5.5.
The following should install everything you need to compile (Ubuntu). The runtime dependencies should be available on any recent Linux distribution already:

Code: Select all

apt-get install qtbase5-dev qttools5-dev qtmultimedia5-dev qtdeclarative5-dev libqt5svg5-dev libqt5webkit5-dev libqt5multimedia5-plugins
Usage:
Just set "qt" as the used subsystem and all related libraries will switch to Qt (there should be no Gtk dependency anymore then). Of course this also means you cannot use any Gtk functions anymore to manipulate the GUI.

Scripting:
Since Qt is a C++ framework we cannot provide simple library imports to allow manipulating PB objects directly via API like it is possible with Gtk (or the Windows API). To allow at least some measure of API access, there is a new QtScript() command available which allows executing JavaScript code in the Qt QML engine and allows access to the PB GUI objects that inherit from QObject. It also allows interaction with the PB runtime library.

The command is simple:

Code: Select all

Result$ = QtScript(Script$)
If you have the PB debugger enabled, then errors in the JavaScript code will be reported through the PB debugger.

The following functions are available inside the script:

Code: Select all

PB object access. Returns the JS object representing the given PB object id.
  gadget(id)
  menu(id)
  statusbar(id)
  systray(id)
  toolbar(id)
  window(id)

Misc functions:
  debug(message)          - send a message to the PB debugger. Does nothing if debugger is off
  dump(object)            - dump a Qt object to a string. Useful for debugging or to discover what members are available in an object

PB Runtime integration:
  runtime.get(key)        - read a PB runtime value (variable, constant)
  runtime.set(key, value) - set a PB runtime variable
  runtime.call(key)       - call a PB runtime procedure. The procedure must have 0 arguments! If you want to pass a value, use runtime.set() on a global variable
More functions may be added later.

An example:

Code: Select all

  Runtime Procedure QtSignalHandler()
    MessageRequester("", "Signal received!")
  EndProcedure  
  
  If OpenWindow(0, 0, 0, 320, 250, "FrameGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ButtonGadget(0, 10,  10, 300, 50, "Original Text")

    ; show the ButtonGadget object's content
    Debug QtScript("dump(gadget(0))")
    
    ; modify the gadget text   
    QtScript(~"gadget(0).text = \"Modified Text\"")
    
    ; Connect a function to the "clicked" signal and call back into PB code
    ; Now if you click the gadget, the procedure is called
    QtScript(~"gadget(0).clicked.connect(function() { runtime.call(\"QtSignalHandler()\"); })")    

    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Other OS:
I know some of you are hoping for Qt on all OS, but I don't think this will be happening for various reasons:
  • Even though Qt is cross-platform, there are still a number of OS-specifics that are visible, especially in the details. So we would have to support and bugfix a "different" Qt subsystem for each OS. This is more work than you probably think, even if most of the code is shared.
  • On the other OS we already have a quite good integration with the native API, so we want to focus on that and not spend work on an "alternative" GUI subsystem that most people will not have any use for.
  • To me, having the same underlying framework on all OS only brings a benefit if you have full access to the framework in a cross-platform way as well. If you are limited to only what PB offers through its libraries, then what does it matter if it is Qt or Windows API below? (except that Qt would bring a ton of Dll dependencies on Windows)
  • As I said above, we developed this subsystem to solve a specific problem on Linux. The benefit of having it available on all OS simply do not justify the cost in my opinion.
Thank you for the detailed information freak. Keep up the great work Team PB. Things just keep on improving with every release.


Regards

Andy
Regards

Andy

Image
Registered PB & PureVision User
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Dude »

freak wrote:Qt would bring a ton of Dll dependencies on Windows
No, thanks. :) One of the main advantages of PureBasic is that it creates standalone exes without the need for DLLs and/or runtime files on Windows.
User avatar
useful
Enthusiast
Enthusiast
Posts: 367
Joined: Fri Jul 19, 2013 7:36 am

Re: PureBasic 5.70 LTS beta 1 is out !

Post by useful »

Freak, what Linux distribution are you using for debugging at this stage?

p.s. I already wrote about this.
I suggest in the first stage to test everything in one environment and after achieving stable work,
to gradually look at the possible regress in other distributions.
Dawn will come inevitably.
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: PureBasic 5.70 LTS beta 1 is out !

Post by DontTalkToMe »

https://msdn.microsoft.com/library/windows/desktop/mt843498(v=vs.85).aspx(d=robot)

1. What kind of level of DPI Awareness this new PB version is aiming for on Windows ?

System, Per-Monitor V1, V2, something else ?

2. Are the new DPI related commands

DesktopResolutionX(), DesktopResolutionY(), DesktopScaleX(), DesktopScaleY(), DesktopUnscaleX(), DesktopUnscaleY()

working even if the DPI Aware check in the compiler's options is disabled ?

3. Do those commands reflect dynamic changes in the DPI settings after the process has been started and if queried report the new values ?

4. Do those commands report updated values if the process window is moved to another screen or are tied to the main screen only ?
User avatar
tj1010
Enthusiast
Enthusiast
Posts: 621
Joined: Mon Feb 25, 2013 5:51 pm
Location: US or Estonia
Contact:

Re: PureBasic 5.70 LTS beta 1 is out !

Post by tj1010 »

QT over GTK is a much welcome change
The truth hurts.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Marc56us »

DontTalkToMe wrote:https://msdn.microsoft.com/library/wind ... x(d=robot)
1. What kind of level of DPI Awareness this new PB version is aiming for on Windows ?
System, Per-Monitor V1, V2, something else ?
2. Are the new DPI related commands
DesktopResolutionX(), DesktopResolutionY(), DesktopScaleX(), DesktopScaleY(), DesktopUnscaleX(), DesktopUnscaleY()
working even if the DPI Aware check in the compiler's options is disabled ?
3. Do those commands reflect dynamic changes in the DPI settings after the process has been started and if queried report the new values ?
4. Do those commands report updated values if the process window is moved to another screen or are tied to the main screen only ?
0. Thanks for the link :wink:
1. I don't know
2. No (in my test)
3. No (in my test) but when changing scale Windows ask to rebbot to complete (sometime), so can't test running program.
4. No (in my test)

Test:

Code: Select all

; ! Enable DPIaware in compile

; Config Test: Windows 10 x64 v1803 2 screens
; Screen 1 (right): 20" 1920 x 1080 zoom @ 100%
; Screen 2 (left) : 17" 1280 x 1024 zoom @ 150%

ExamineDesktops()

OpenWindow(0, 0, 0, 500, 300, "", #PB_Window_SystemMenu)

Debug "Screen 1 : " + RSet(Str(DesktopX(0)), 5, " ") + " DesktopResolutionX: " + DesktopResolutionX()
Debug "Screen 2 : " + RSet(Str(DesktopX(1)), 5, " ") + " DesktopResolutionX: " + DesktopResolutionX()

; Move screen from screen 1 to 2 

While WaitWindowEvent() <> #PB_Event_CloseWindow 
    Debug DesktopResolutionX()
Wend
It also seems that wherever window opens, it is the zoom of the main window that is tested

Code: Select all

OpenWindow(0, 0, -1500, 500, 300, "", #PB_Window_SystemMenu)

Debug "Screen 1 : " + RSet(Str(DesktopX(0)), 5, " ") + " DesktopResolutionX: " + DesktopResolutionX()
Debug "Screen 2 : " + RSet(Str(DesktopX(1)), 5, " ") + " DesktopResolutionX: " + DesktopResolutionX()

Code: Select all

Screen 1 :     0 DesktopResolutionX: 1
Screen 2 : -1280 DesktopResolutionX: 1
But maybe I'm misusing the new features?
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: PureBasic 5.70 LTS beta 1 is out !

Post by DontTalkToMe »

Marc56us wrote: 0. Thanks for the link :wink:
It's a nice one !
Marc56us wrote: 1. I don't know
2. No (in my test)
3. No (in my test) but when changing scale Windows ask to rebbot to complete (sometime), so can't test running program.
4. No (in my test)
Thanks for the tests, I can't do them myself at the moment so I had to ask.
So it seems it's a System DPI awareness kind of thing, done once at startup.

Anyway it would be nice to have some confirmation from Fred
Last edited by DontTalkToMe on Thu Jun 07, 2018 10:40 am, edited 1 time in total.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Marc56us »

useful wrote:Ubuntu 18.04(64) start IDE = segmentation fault
XUbuntu 16.04(64) start IDE = segmentation fault
Lubuntu 18.04(32) start IDE = segmentation fault
Debian 9.4 x64 / xfce

Code: Select all

sh checkinstall.sh 

This script try to detect if all developments packages are correctly installed. If you are using a Debian or Ubuntu like distribution, you can use the following line to install all needed packages: 

$ sudo apt-get install gcc g++ libc6-dev libsdl1.2-dev libgtk-3-dev unixodbc-dev libgnome2-dev libxine2-dev libwebkitgtk-3.0-dev libxxf86vm-dev libwebkitgtk-dev libwebkitgtk-3.0-dev

Everything seems correctly setup for PureBasic !

$ cd purebasic
$ ./purebasic
segmentation fault :(

(5.62 works fine) :wink:
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Trond »

I only get an error message.

Code: Select all

./purebasic: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./purebasic)
./purebasic: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./purebasic)
./purebasic: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./purebasic)
On Ubuntu 14.04.
Last edited by Trond on Sun Jun 03, 2018 6:13 pm, edited 1 time in total.
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: PureBasic 5.70 LTS beta 1 is out !

Post by Kurzer »

Dude wrote:
kurzer wrote:I love the DPI aware feature!
I have no idea how it works. Can someone explain?
Simply activate "create DPI aware executable" in the compiler settings and your GUI will be automatically scaled on machines with different monitor DPI settings.

Take the ButtonGadget() example from the help file and compile it with and without the DPI aware checkbox.
If you have changed your desktop scaling to 125%, it should then look like this.

Image

I use a high DPI monitor on my system, so I set the Windows desktop scaling to 125%. Otherwise the font on the desktop would be too small for me.

Non-DPI-aware programs look very small on my screen (like the example on the right). But DPI-aware programs scale their GUI to 125% (in my case) and the ratio "GUI size" to "monitor size" is the same, even if the program runs on a high DPI monitor or on an old 1024-pixel monitor (only if the user has set the desktop scaling to his liking).
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
Post Reply