Jump to content

system hang


PhilipG
 Share

Recommended Posts

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

I've encountered something I don't really understand my self.

i have a function to create a new gui

Func edit()
$winopen= GUICreate("Redigera text", 145, 173, -1, -1, BitOR ($WS_POPUP, $WS_BORDER), -1) 
 GUISetState(@sw_show, $winopen)
    $myedit = GUICtrlCreateEdit("Text", 5, 5, 135, 135)
$save = GUICtrlCreateButton("Spara", 5, 145)
$abort = GUICtrlCreateButton("Avbryt", 50, 145)
;//put the $sExit =  GUICtrlCreateButton("Exit", nn, nn) here
   
    
    While 1
 $msg2 = GUIGetMsg()
        
If $msg2 = $GUI_EVENT_CLOSE Or $msg2 = $abort Then 
            GUIdelete($winopen)
            ;GUISwitch ($main)
            $msg2 = 0
            ExitLoop
        EndIf
        
    wend
EndFunc

before I added the while 1 loop the gui where written as it should but now it stops right after it has created the gui window. the controls in the window are never written!

Have a look at this code

Func _Edit()
    While 1
        $GUICreate("Redigera text", 145, 173, -1, -1, BitOR ($WS_POPUP, $WS_BORDER), -1) 
        GUISetState()
        $myedit = GUICtrlCreateEdit("Text", 5, 5, 135, 135)
        $save = GUICtrlCreateButton("Spara", 5, 145)
        $abort = GUICtrlCreateButton("Avbryt", 50, 145)         
        While 1         
            $msg2 = GUIGetMsg()         
            Select
                Case $msg = $GUI_EVENT_CLOSE Or $msg = $sExit
                    GUIDelete()
                    ExitLoop (2)
                Case $msg = $save
                    GUIDelete()
                    ;//Your Code for Save
                    ExitLoop
                Case $msg = $myEdit
                    GUIDelete()
                    ;//Your Code for Edit
                    ExitLoop                    
            EndSelect
        WEnd
    WEnd
EndFunc
Edited by anixon
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...