GUI loop problem...Control freezing
#1
Posted 06 March 2009 - 08:16 AM
When you run the script after it creates the GUI, the socket is created and a While loop receives the messages if $connected = 1, $connected is 0 until you press "Sign IN" and it returns to that state after you press "sign out".
What I want to do is, open the socket when you press sign in and close it when you press sign out, to do that, I have the messenger function that does all that being called when you press "sign in", so the While loop starts there. If I leave it like that the GUI closes after it starts because there is no loop to keep it open, so I add another loop to only sleep while $connected = 0.So the GUI stays open by that loop and when you press sign in it stays open by the other loop but all the controls stop working after you press "sign in", except from the Treeview that responds..
I can make an example but I would prefer to PM my source code to members interested in helping...
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#2
Posted 06 March 2009 - 09:06 AM
Your doing the loop wrong somehow, the loop must include reactions for all controls, if they aren't in the loop... More specifically the loop your program is currently running through, your control will not react to input or any kind of alteration.
#3
Posted 06 March 2009 - 09:27 AM
;code posted is just an example not a working one, there is no GUI
This works:
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#4
Posted 06 March 2009 - 02:40 PM
The code you say works looks to me like it can't.it's like:
;code posted is just an example not a working one, there is no GUI
This works:AutoIt$connected = 0 somefunction() ; creates GUI with button SIGN IN that sets $connected = 1 and SIGN OUT to set $connected = 0 Messenger() Func Messenger $chatserver = UDPBind.... If @error <> 0 Then SocketBindError(1) Else While 1 If $Connected = 1 Then ............. Sleep(10) WEnd EndIf EndFuncoÝ÷ ÛZµÚ²}ý· ++ºÚ"µÍÌÍØÛÛXÝYHÛÛYY[Ý[Û HÈÜX]ÈÕRHÚ]]ÛÒQÓS]Ø[ÈÚ[Ú[[ÒQÓÕU]Ø[ÈÚYÛÝ]ÚYÛ[ BÚYÛÝ] BÚ[H ÌÍØÛÛXÝYHÛY L BÙ[[Ý[ÛÚYÛ[ B ÌÍØÚ]ÙHQ[YÜ ÉÝÈ[ÛØÚÙ][ÜJB[ÙB ÌÍØÛÛXÝYHBYÜÙ[Ù B[Y[[Â[ÈÚYÛÝ] BÛÜÙÈÛØÚÙ] ÌÍØÛÛXÝYH[[Â[ÈYÜÙ[ÙÚ[HBY ÌÍÐÛÛXÝYHH[ÛY L BÑ[[[
In the code that doesn't work how does the function Messenger() ever get finished? So how does singin() return?
Are you using message loop or event mode and have you set any hotkeys?
#5
Posted 07 March 2009 - 02:52 AM
You will have to build your code around a better concept of loops. Again, without the source... It's hard to know exactly what your doing wrong...
I'm not trying to ride you out about the source thing, but it's like trying to explain to someone why your brand-new Secret0 car is not running right, but you won't let anyone see it, instead you try and explain what noises it's making...
I'm terrible at metaphors, but still... PM me the source, and I'll try and give a better answer...
#6
Posted 08 March 2009 - 12:49 PM
Would you like to see my code martin and let me know?
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#7
Posted 08 March 2009 - 02:45 PM
#8
Posted 08 March 2009 - 04:29 PM
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
#9
Posted 10 March 2009 - 12:55 PM
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





