scraptore.blogg.se

Purebasic openwindow example
Purebasic openwindow example











purebasic openwindow example
  1. #PUREBASIC OPENWINDOW EXAMPLE INSTALL#
  2. #PUREBASIC OPENWINDOW EXAMPLE CODE#
  3. #PUREBASIC OPENWINDOW EXAMPLE LICENSE#
  4. #PUREBASIC OPENWINDOW EXAMPLE WINDOWS#

Then the loop resumes, and pauses again at the WaitWindowEvent() function to await the next event. The WaitWindowEvent() function actually pauses program execution until it receives an event, at which time the event is passed into the loop to be processed. It should be noted that the event loop is not running in a mad frenzy, like a normal endless loop.

purebasic openwindow example

This is known as an event-driven paradigm, and is the architecture that PureBasic is built upon.

#PUREBASIC OPENWINDOW EXAMPLE CODE#

The ultimate purpose is to listen for events that the operating system passes to the program, using the WaitWindowEvent() function, and to process those received events by executing any relevant code associated with the said event. Although the example uses a Repeat-Until loop, any type of loop could be used in its place. The second part is known as the event loop, and is the backbone of any window-based PureBasic program. In order to be referenced later, PureBasic also assigns the window an identifier of 0 - the first parameter. The first part builds the interface, and simply instantiates a 300-pixel wide by 200-pixel high window at position 100, 100 on the screen, and gives it a title of My Window. Until event = #PB_Event_CloseWindowThere are two parts to this code. Now if you click the gadget, the procedure is called Connect a function to the "clicked" signal and call back into PB code QtScript (~ "gadget(0).text = \"Modified Text\ "" )

purebasic openwindow example

If OpenWindow ( 0, 0, 0, 320, 250, "FrameGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered )īuttonGadget ( 0, 10, 10, 300, 50, "Original Text" ) MessageRequester ( "", "Signal received!" ) The runtime dependencies should be available on any recent Linux distribution already:

#PUREBASIC OPENWINDOW EXAMPLE INSTALL#

The following should install everything you need to compile (Ubuntu).

#PUREBASIC OPENWINDOW EXAMPLE LICENSE#

So the license situation is the same as with Gtk. The license is LGPL and we are not statically linking (the binaries provided with the Linux distribution are used). 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. We are hoping that this new subsystem becomes stable enough to be the new default on Linux at some point in the future. Since Qt is also available under the LGPL since some time, there is also no license issue in the way anymore. Qt is much more "PB friendly" as it turns out. 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. Here is some more info regarding the Qt subsystem:

purebasic openwindow example

Have fun and don't hesitate to reports any found issues ! Added: #PB_Local/#PB_Parent/#PB_World support for ApplyEntityForce(), ApplyEntityImpulse(), ApplyEntityTorque() and ApplyEntityTorqueImpulse() Added: EntityDirection(), EntityDirectionX(), EntityDirectionY(), EntityDirectionZ() Added: BuildMeshManualLod(), BuildMeshLod(), MeshVertex(), CreateDataMesh() Added: ParticleScaleRate(), ParticleAngle(), CameraReflection() Added: #PB_Material_ProjectiveTexturing for SetMaterialAttribute() Added: #PB_Vehicle_ContactPointNormalX/Y/Z, #PB_Vehicle_ContactPointNormalY/Z, #PB_Vehicle_CurrentSpeedKmHour, #PB_Vehicle_ForwardVectorX/Y/Z Added: #PB_Vehicle_IsInContact, #PB_Vehicle_ContactPointX/Y/Z, #PB_Vehicle_ContactPointY/Z for GetVehicleAttribute() Added: an optional 'Mode' parameter for OpenConsole() to specify the string format to use Added: DesktopResolutionX(), DesktopResolutionY(), DesktopScaleX(), DesktopScaleY(), DesktopUnscaleX(), DesktopUnscaleY() Added: #PB_Path_Winding filling mode for VectorDrawing Added: #PB_JSON_NoClear support to ExtractJSONStructure Added: #PS, #NPS, #PS$ and #NPS$ constants (Path seperator character depending of the OS)

#PUREBASIC OPENWINDOW EXAMPLE WINDOWS#

Added: DPI aware support for Windows app (/DPIAWARE compiler switch and DPI Aware check in IDE) Added: Brand new QT subsystem for Linux Thanks to Guillot and Comtois for the new 3D functions ! Other cool stuffs are available, for example DPI support for Windows (the IDE is compiled with this switch on so you can test). After a long delay (currently due to lack of time in my personal life, which I hope will get better soon), here is the first beta of the 5.70 LTS version which brings a bunch of new things ! First, a big thanks to Timo (Fr34k) who did a brand new subsystem for Linux: QT.













Purebasic openwindow example