windows & gadgets without Repeat : Until

Just starting out? Need help? Post your questions and find answers here.
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

windows & gadgets without Repeat : Until

Post by cybergeek »

just wondering if i could openwindow or add a gadget and keep it displayed without using a Loop of repeat until ?
PUREBASIC is AWSUM
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: windows & gadgets without Repeat : Until

Post by Trond »

Yes, you can use While .. Wend. :)

What do you need this for?
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: windows & gadgets without Repeat : Until

Post by Little John »

Trond wrote:Yes, you can use While .. Wend. :)
:lol:
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: windows & gadgets without Repeat : Until

Post by cybergeek »

without any kin of loop
PUREBASIC is AWSUM
User avatar
TomS
Enthusiast
Enthusiast
Posts: 342
Joined: Sun Mar 18, 2007 2:26 pm
Location: Munich, Germany

Re: windows & gadgets without Repeat : Until

Post by TomS »

Delay()
Note that the user has no chance of interacting with the window or the gadgets. And he can't close the window. :roll:
Trond wrote:What do you need this for?
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: windows & gadgets without Repeat : Until

Post by cybergeek »

TomS wrote:Delay()
Note that the user has no chance of interacting with the window or the gadgets. And he can't close the window. :roll:
then there is no use
PUREBASIC is AWSUM
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: windows & gadgets without Repeat : Until

Post by gnozal »

cybergeek wrote:without any kin of loop
Windows is about events, so you need an event loop.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Re: windows & gadgets without Repeat : Until

Post by Rescator »

Yeah, any GUI program (on any platform/OS) has at the very least a main (or outer) loop.

Maybe if you told us what you are trying to do we could help, but asking for how to make a GUI program without looping makes no sense at all.

What exactly are you trying to do that makes you think you can not use any form of looping?

(PS! A program without any looping would end almost immediately as well)
AndyMK
Enthusiast
Enthusiast
Posts: 582
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

Re: windows & gadgets without Repeat : Until

Post by AndyMK »

WaitWindowEvent(Timeout) without the timeout value is what you might be looking for. It only does a loop when an event happens, no need for a delay() in the loop unless the windows activity is happening thousands of times per second in which case you can use 1 as a timeout value and it would be like doing a Delay(1).
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: windows & gadgets without Repeat : Until

Post by cybergeek »

i create a complex dialog or control in PB to use with another application and embed it in a dll but when that app calls the dll the loop haults the execution!
PUREBASIC is AWSUM
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: windows & gadgets without Repeat : Until

Post by Trond »

cybergeek wrote:i create a complex dialog or control in PB to use with another application and embed it in a dll but when that app calls the dll the loop haults the execution!
Either call the dll in a thread, or have a function in the dll which contains everything inside the loop (use WindowEvent()), then have a loop in the main application, and call the function in the dll several times every second.
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: windows & gadgets without Repeat : Until

Post by cybergeek »

the application is in another language
PUREBASIC is AWSUM
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: windows & gadgets without Repeat : Until

Post by Trond »

cybergeek wrote:the application is in another language
So run the window in a thread in the dll.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: windows & gadgets without Repeat : Until

Post by srod »

If by 'halting execution' you are referring to non-GUI matters, then yes, such a dll will of course halt execution and then Trond's suggestions are the way to go. If, on the other hand, the host is running a GUI of it's own and this appears to freeze, then there is a problem with the host if the dll is running a PB event-loop.

A host written in PB which runs a GUI and which then loads a dll such as the one you are working with will potentially throw up certain problems due to the nature of PB's message retrieval mechanisms. You would generally be safer employing an API message retrieval loop within the dll in such cases.
I may look like a mule, but I'm not a complete ass.
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: windows & gadgets without Repeat : Until

Post by cybergeek »

here is an example that halt a program in Autohotkey

http://www.autohotkey.net/~mohdumar/testdll.zip
PUREBASIC is AWSUM
Post Reply