cracker Posted August 14, 2006 Share Posted August 14, 2006 (edited) hello in my actuall program it would be nice to easylie clear the wohle gui. that means just to del all labels, input boxes etc... that would be a kind of repaint(). Or is there no other way then to destroy gui and to create an new one? thanks for help Edited August 14, 2006 by cracker Link to comment Share on other sites More sharing options...
Fossil Rock Posted August 14, 2006 Share Posted August 14, 2006 GUICtrlSetState Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
Earthquake Posted August 14, 2006 Share Posted August 14, 2006 (edited) Maybe you could create it new. (EDIT: Sorry, I just saw, you wrote it) Thats how I did an identical task in my program... But could you describe, why you want all buttons and so on empty??? As far as I know: In the new beta should be some kind of refresh! Edited August 14, 2006 by Earthquake Yes, I am a noob! But at least I try to learn!Moddingtech.de - Home of the german Modding-Scene! Link to comment Share on other sites More sharing options...
cracker Posted August 14, 2006 Author Share Posted August 14, 2006 @ fossil rock no this dont helps me because the input fields etc are not declared in variables. i dont want it only empty i want that all items go away so guictrlsetsate($all,@sw_hide) is what i want. but i think i will solve this problem other because its not possible (it looks like) thx for your tries Link to comment Share on other sites More sharing options...
MHz Posted August 15, 2006 Share Posted August 15, 2006 i want that all items go away so guictrlsetsate($all,@sw_hide) is what i want. but i think i will solve this problem other because its not possible (it looks like) thx for your triesYou could add your controls into an array, then loop through them to hide them all with GuiCtrlSetState(). To make it easy to address your controls, then consider using Enum on the variables to use for indexing the array. Small example #include <GUIConstants.au3> Global $ctrl[3] Enum $gui, $button1, $button2 $ctrl[$gui] = GUICreate('title') $ctrl[$button1] = GUICtrlCreateButton('text 1', 0, 0) $ctrl[$button2] = GUICtrlCreateButton('text 2', 0, 30) GUISetState() Sleep(3000) For $i = 1 To UBound($ctrl)-1 GUICtrlSetState($ctrl[$i], $GUI_HIDE) Next While WinActive('title') Sleep(1000) WEnd Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 15, 2006 Moderators Share Posted August 15, 2006 Or is there no other way then to destroy gui and to create an new one?That got me thinking... I'd never done this before but works well:#include <guiconstants.au3> Local $Main = _GUI_CreateMain() GUISetState(@SW_SHOW, $Main[1]) While 1 Switch GUIGetMsg() Case -3 Exit Case $Main[3] GUIDelete($Main[1]) $Main = _GUI_CreateMain() GUISetState(@SW_SHOW, $Main[1]) EndSwitch WEnd Func _GUI_CreateMain() Local $aCtrls[4] $aCtrls[1] = GUICreate('Some GUI', 200, 100) $aCtrls[2] = GUICtrlCreateCombo('', 10, 10, 180, 100) $aCtrls[3] = GUICtrlCreateButton('Click Me', 75, 50, 50, 30) Return $aCtrls EndFuncThe same concept of using arrays as MHz. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
cracker Posted August 15, 2006 Author Share Posted August 15, 2006 (edited) thanks a lot you both! I think i will try to use Sm0ke_N ´s version it looks really nice :) :"> :"> Edited August 16, 2006 by cracker Link to comment Share on other sites More sharing options...
cracker Posted August 16, 2006 Author Share Posted August 16, 2006 yeah it works great !!! thx a lot again. but now i have an other problem. I want to make my window scrollable so i created it like this: : AutoIt GUICreate("Delete It",600,500,-1,-1,$WS_VSCROLL+$WS_SIZEBOX+$WS_SYSMENU) but if i scroll now the window doesn´t goes down... iam sure i have to tell the window "how to scroll" but i didn´t found the answer in the help file how to do this can you help me again? Link to comment Share on other sites More sharing options...
cracker Posted August 16, 2006 Author Share Posted August 16, 2006 does nobody understand where my problem is or should i create a new thread for a new quesion???(sorry for double post...) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 16, 2006 Moderators Share Posted August 16, 2006 does nobody understand where my problem is or should i create a new thread for a new quesion???(sorry for double post...) I really didn't know what you were saying, do you have a working example of what it is you'd like to be done and what it is you'd like to change? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
cracker Posted August 16, 2006 Author Share Posted August 16, 2006 oh i will try to explain it more exactly: i have a gui the size is for example 500 x 400 . now i add in a while loop elemts to the gui (labels, checkbox and so on). And its logical that the gui is at any time full and the next elemts would be displayed out of the gui (for example: GUICtrlCreateLabel("test",40,500) oÝ÷ Ù»¡÷(º»§¶Ú,yè²u×jÇ+¢Y[j¶®¶sduT7&VFRgV÷C·FW7BgV÷C²ÃSÃCÂÓÂÓÂb33cµu5õe45$ôÄ now i see the scrollbar on the right side but if i scroll down it "dont moves down" maybe the screenshot in the attachment can help you to understand my problem. Or maybe you just have a example with a gui and $WS_VSCROLL thanks Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 16, 2006 Moderators Share Posted August 16, 2006 No, what I meant was, I don't feel like making my own GUI to try and provide a "working" example for you. Since this is a request, I would suggest making a working GUI, with the example that is not working, so we can debug it for you. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
cracker Posted August 17, 2006 Author Share Posted August 17, 2006 ok here try this out: #include <GUIConstants.au3> GUICreate("test",500,400,-1,-1,$WS_VSCROLL+$WS_SIZEBOX+$WS_SYSMENU) $i=0 While $i < 24 GUICtrlCreateLabel("test"&$i,20,20*$i) $i = $i+1 WEnd GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd i hope this is what you wanted Link to comment Share on other sites More sharing options...
cracker Posted August 17, 2006 Author Share Posted August 17, 2006 it looks like that this hasn´t helped you again... what have i done wrong? pls it is importent for me that this scroll works Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now