Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

GUI how to refresh - repaint it


  • Please log in to reply
4 replies to this topic

#1 Juvigy

Juvigy

    Experimental Drugs Abuser

  • Active Members
  • PipPipPipPipPipPip
  • 1,282 posts

Posted 21 August 2008 - 02:55 PM

I have a GUI and a EDIT and a Button controls in it. There is some text in the edit control and the GUI is closed when pressing the button. The issue is that if i leave the GUI and change the focus to another window(click another window) and then go back to the GUI the text is not visible as well as the custom color of the EDIT background. If i click inside the Edit and try to select. It is back to normal again.I am beginner in GUIs so lease help.







#2 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,795 posts

Posted 21 August 2008 - 03:43 PM

Post your code (as small as possible reproducing script).

#3 Juvigy

Juvigy

    Experimental Drugs Abuser

  • Active Members
  • PipPipPipPipPipPip
  • 1,282 posts

Posted 22 August 2008 - 06:05 AM

Global $hGui, $but,$Label, $iW = 500, $iH = 230, $Last ,$msg $hGui=GUICreate('', $iW, $iH, $WS_POPUP) GUISetBkColor(0xff0001, $hGui) $Label = GUICtrlCreateEdit("", 0, 0, $iW, $iH-50) GUICtrlSetFont($Label, 10, 700) $but = GUICtrlCreateButton ('OK',0, 0,500,380) GUICtrlSetColor(-1, 0x000000) GUICtrlSetFont(-1, 14, 700) GUISetState(@SW_SHOWNA, $hGui) GUICtrlSetBkColor($Label,0xBFCFFF) GUICtrlSetData ($Label,"System information : "&@CRLF&@CRLF&$strData1[0][0]&": "&$arrResults2[0][1]&@CRLF&$strData[0][0]&": "&$arrResults[0][1]&@CRLF&$strData[1][0]&": "&$arrResults[1][1]&@CRLF&$strData[2][0]&": "&$arrResults[2][1]&@CRLF&$strData[3][0]&": "&$arrResults[3][1]&@CRLF)  While 1         $msg = GUIGetMsg()         If $msg = $GUI_EVENT_CLOSE Then ExitLoop         If $msg = $but Then ExitLoop     WEnd     GUIDelete()


#4 rasim

rasim

    Gray Scripter

  • Active Members
  • PipPipPipPipPipPip
  • 1,708 posts

Posted 22 August 2008 - 07:09 AM

Mayb so?
AutoIt         
#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Global $hGui, $but,$Label, $iW = 500, $iH = 230, $Last ,$msg $hGui = GUICreate('', $iW, $iH, $WS_POPUP) GUISetBkColor(0xff0001, $hGui) $Label = GUICtrlCreateEdit("", 0, 0, $iW, $iH-50) GUICtrlSetFont($Label, 10, 700) GUICtrlSetBkColor($Label,0xBFCFFF) $but = GUICtrlCreateButton ('OK', 0, 180, 500, 50) GUICtrlSetColor(-1, 0x000000) GUICtrlSetFont(-1, 14, 700) GUISetState(@SW_SHOW, $hGui) GUICtrlSetData ($Label,"System information:") While 1     $msg = GUIGetMsg()     If $msg = $GUI_EVENT_CLOSE Then ExitLoop     If $msg = $but Then ExitLoop WEnd

OS: Windows XP SP3, AutoIt version: 3.3.0.0Posted Image My Projects: Free_Resources | Splitter | wgetGUI | UnRARIt | USBMon | CDROM-Control | Volume Serial Changer | WinTrayPosted Image My UDFs: _ScreenSetting | ListView_Progress | ContextHelp | ToolTip_UDF | UnRAR | Zip32 | BassMod | ShellTreeView | GuiHotKey | 7ZipPosted Image My Examples: TrayIcon_Click | SystemTray_Refresh | _ListView_Sort | CPUmonLike above scripts? Please rate the topic Posted Image

#5 Juvigy

Juvigy

    Experimental Drugs Abuser

  • Active Members
  • PipPipPipPipPipPip
  • 1,282 posts

Posted 22 August 2008 - 07:48 AM

$but = GUICtrlCreateButton ('OK',0, 0,500,380)
$but = GUICtrlCreateButton ('OK', 0, 180, 500, 50)

So i guess my button coordinates was not correctly calculated? Is this all that was wrong in my script? And there is no "repaint the GUI with all in it function" ?

Edited by Juvigy, 22 August 2008 - 08:23 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users