12/23/2023 0 Comments Purebasic whileCreate Window: OpenWindow ( 0, # PB_Ignore, # PB_Ignore, 800, 600, "Simple Text Editor", # PB_Window_SystemMenu | # PB_Window_MinimizeGadget | # PB_Window_MaximizeGadget | # PB_Window_SizeGadget ) Add 2 menus: CreateMenu ( 0, WindowID ( 0 )) MenuItem ( 1, "&OK" ) MenuItem ( 2, "&Cancel" ) Add Editor: EditorGadget ( 0, 0, 0, 0, 0 ) SetGadgetFont ( 0, LoadFont ( 0, "Courier New", 10 )) Process window messages until closed: Repeat Select WaitWindowEvent () Case # PB_Event_Menu Select EventMenu () Case 1 : MessageRequester ( "OK clicked directly or with '&' mnemonic.", GetGadgetText ( 0 )) Case 2 : Break EndSelect Case # PB_Event_SizeWindow : ResizeGadget ( 0, 0, 0, WindowWidth ( 0, # PB_Window_InnerCoordinate ), WindowHeight ( 0, # PB_Window_InnerCoordinate )) Case # PB_Event_CloseWindow : Break EndSelect ForEver The following single line of PureBasic code will create a standalone x86 executable (4.5 KiB (4,608 bytes) on Windows version) that displays a message box with the text " Hello World". It can compile console applications, GUI applications, and DLL files. The compiler produces native executables and the syntax of PureBasic is simple and straightforward, comparable to plain C without the brackets and with native unicode string handling and a large library of built-in support functions. The AmigaOS version is legacy and open-source. Currently supported systems are Windows, Linux, macOS. PureBasic is a native cross platform 32 bit and 64 bit BASIC compiler. Other 3D environments such as the Irrlicht Engine are unofficially supported. PureBasic supports and has integrated the OGRE 3D Environment. PureBasic supports inline assembly, allowing the developer to include FASM assembler commands within PureBasic source code, while using the variables declared in PureBasic source code, enabling experienced programmers to improve the speed of speed-critical sections of code. Programs developed without using the platform-specific application programming interfaces (APIs) can be built easily from the same source file with little or no modification. PureBasic compiles directly to IA-32, x86-64, PowerPC or 680x0 instruction sets, generating small standalone executables and DLLs which need no runtime libraries beyond the standard system libraries. As cited on the website, the first PureBasic user (who registered in 1998) still has free access to new updates and this is not going to change. PureBasic has a "lifetime license model". It has been continually updated ever since. The first public release of PureBasic for Windows was on 17 December 2000. An Amiga version is available, although it has been discontinued and some parts of it are released as open-source. Just press F1 to open it while you're running the PureBasic IDE.PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows, Linux, and macOS. The help file is included with PureBasic. Until WindowEvent = #PB_Event_CloseWindow MessageRequester("Message","You clicked button 2") MessageRequester("Message","You clicked button 1") OpenWindow(#wnd_Main,0,0,200,100,#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered,"Test")īuttonGadget(#Main_Button1,10,10,50,20,"Button 1")īuttonGadget(#Main_Button2,10,40,50,20,"Button 2")Ĭase #Main_Menu_Hello: MessageRequester("Message","Hello World")Ĭase #Main_Menu_Exit: CloseWindow(#wnd_Main) I feel that there's got to be a better solution. I came from PowerBasic, and I'm pretty good in DOS. I've got to say that I know next to nothing about Windows programming. I still have to use a While WindowEvent(): Wend. Viewtopic.php?t=16449&highlight=while+windowevent+wendįreak mentions enhancing the While Wend loop to check for events that should not be lost (That sounds like all events to me Maybe I'm having a mental block, but I'm not figuring out how to do this. Looking around on the forum, I found this thread: However, I have this suspicion that if I change anything, I'll have more problems. I've moved the statement around, and finally got my program to behave. After scratching my head for way too long, I found out it was related to this statement: While WindowEvent(): Wend. I've been having problem after problem with my window freezing, and just acting odd.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |