Champak Posted May 10, 2006 Author Share Posted May 10, 2006 (edited) That did it for me. .....Sometimes it isn't a matter of not reading the instructions, but rather not truly knowing what controls you need to impliment a specific function....or how. I read about that before, but had no definitive idea of what that was and how to use it. Thanks. But now that leads me to another problem I've been trying to figure out on my own. I thought that this would have been the solution for that, but it isn't...or I may be using it wrong and it is just working for this. On a gui child I have a settings where I indicate which drive I want to check the space of. On the main page is where it is displayed. When I set the drive letter, I have to close the script for it to take effect....much like the default issue. So, I put in the GUICtrlSetData() and that didn't work. expandcollapse popup--------------------Input for the drive letter on the child page $labelSettings7 = GUICtrlCreateLabel("Drive to check space (ex. C:)" , 10, 310, 165, 20) GUICtrlSetBkColor(-1, 0xADC8DD) $settings13=IniRead($Where, 'Settings', 'Settings7', 'no') $settings14=GUICtrlCreateInput($settings13, 237, 310, 36, 19) --------------------Saving function on the child page Case $msg = $SaveSettings GUICtrlSetData($Drive,$settings14) (---I've switched the $Drive and $settings around---) ---------------------Main page where drive space is shown $Drive = IniRead($Where, "Settings", "Settings7", "NotFound") $total = DriveSpaceTotal($Drive) $free = DriveSpaceFree($Drive) $used = $total - $free $progress = GuiCtrlCreateProgress(10, 410, 260, 15, $PBS_SMOOTH) GUICtrlSetBkColor(-1,0x009600) GUICtrlSetColor(-1,0xFF0000) $labe5 = GUICtrlCreateLabel ( "Stats for Drive", 10, 425, 70, 20) GUICtrlSetBkColor(-1,0xADC8DD) $label4 = GUICtrlCreateLabel ( $settings13, 85, 425, 30, 20) GUICtrlSetBkColor(-1,0xADC8DD) GuiCtrlSetData($progress, 100 * $used / DriveSpaceTotal($Drive)) GuiCtrlCreateLabel(Round($used/1024,2) & " GB used ", 115, 425, 80, 20,$ES_CENTER) GUICtrlSetBkColor(-1,0xADC8DD) GuiCtrlCreateLabel(Round($free/1024,2) & " GB free ", 193, 425, 80, 20,$ES_CENTER) GUICtrlSetBkColor(-1,0xADC8DD) So why wont it work for this? Or do I need to include something beyond just the "GUICtrlSetData" in the save function for this? Thanks. Edited May 10, 2006 by Champak Link to comment Share on other sites More sharing options...
JSThePatriot Posted May 10, 2006 Share Posted May 10, 2006 That did it for me. .....Sometimes it isn't a matter of not reading the instructions, but rather not truly knowing what controls you need to impliment a specific function....or how. I read about that before, but had no definitive idea of what that was and how to use it. Thanks. But now that leads me to another problem I've been trying to figure out on my own. I thought that this would have been the solution for that, but it isn't...or I may be using it wrong and it is just working for this. On a gui child I have a settings where I indicate which drive I want to check the space of. On the main page is where it is displayed. When I set the drive letter, I have to close the script for it to take effect....much like the default issue. So, I put in the GUICtrlSetData() and that didn't work. expandcollapse popup--------------------Input for the drive letter on the child page $labelSettings7 = GUICtrlCreateLabel("Drive to check space (ex. C:)" , 10, 310, 165, 20) GUICtrlSetBkColor(-1, 0xADC8DD) $settings13=IniRead($Where, 'Settings', 'Settings7', 'no') $settings14=GUICtrlCreateInput($settings13, 237, 310, 36, 19) --------------------Saving function on the child page Case $msg = $SaveSettings GUICtrlSetData($Drive,$settings14) (---I've switched the $Drive and $settings around---) ---------------------Main page where drive space is shown $Drive = IniRead($Where, "Settings", "Settings7", "NotFound") $total = DriveSpaceTotal($Drive) $free = DriveSpaceFree($Drive) $used = $total - $free $progress = GuiCtrlCreateProgress(10, 410, 260, 15, $PBS_SMOOTH) GUICtrlSetBkColor(-1,0x009600) GUICtrlSetColor(-1,0xFF0000) $labe5 = GUICtrlCreateLabel ( "Stats for Drive", 10, 425, 70, 20) GUICtrlSetBkColor(-1,0xADC8DD) $label4 = GUICtrlCreateLabel ( $settings13, 85, 425, 30, 20) GUICtrlSetBkColor(-1,0xADC8DD) GuiCtrlSetData($progress, 100 * $used / DriveSpaceTotal($Drive)) GuiCtrlCreateLabel(Round($used/1024,2) & " GB used ", 115, 425, 80, 20,$ES_CENTER) GUICtrlSetBkColor(-1,0xADC8DD) GuiCtrlCreateLabel(Round($free/1024,2) & " GB free ", 193, 425, 80, 20,$ES_CENTER) GUICtrlSetBkColor(-1,0xADC8DD) So why wont it work for this? Or do I need to include something beyond just the "GUICtrlSetData" in the save function for this? Thanks. What GUI control are you trying to set data to to with "GUICtrlSetData($Drive,$settings14)"? If you were going to set the InputBox data you would do the following: GUICtrlSetData($settings14, $Drive)...if $Drive contains the info you want in the InputBox. Now if you are wanting to set the $Drive Variable with the data you have in $settings14 InputBox then something more along the lines of $Drive = GUICtrlRead($settings14). Your above code shouldnt work at all. Its not right. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Champak Posted May 10, 2006 Author Share Posted May 10, 2006 OK, the input box data is not what I want to update, so I took that off. It is the variable that I want to set and update when I go back to the parent page, so I changed that to what you said and it still doesn't update until I close and restart. Also, for my knowledge, isn't: $Drive = GUICtrlRead($settings14) Doing the same as $Drive = IniRead($Where, "Settings", "Settings7", "NotFound") Since they are both looking in the same space. Also, I tried changeing all the "$Drive" to "$setting14" and that works as well, and that let me delete the "$Drive = GUICtrlRead($settings14)". It didn't solve the end problem I'm having, but it works as far as it does already. Is this something I shouldn't do because of some procedures or "proper coding"? Or is it alright to keep it? Link to comment Share on other sites More sharing options...
JSThePatriot Posted May 10, 2006 Share Posted May 10, 2006 Can you either post the whole code or send it to me in a PM. The reason it isnt updating is because you arent updating the right field after writing the data to the INI file. After you restart the app though it reads the new data from the INI file. Yes those two lines do the same thing. That is why I was quite confused at what exactly you are trying to do. Your code is alright if it doesnt throw any compiler errors, but there are a few things that would make it better, and if I was able to see the entire file I think I could help you in that matter. Adding code in and just leaving it even though it doesnt fix the problem will just bloat it. Need to fix the entire problem with code, and that is what I would love to help you do. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) 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