AcidCorps Posted January 7, 2010 Share Posted January 7, 2010 This script is pretty long at this point (a lot of directory reading and web reading) so I'm only going to include the part that I need help on While 1 $Msg = GUIGetMsg() $Hover = _ControlHover(0) If $Hover = 1 Then Prewview(@Extended) EndIf If $Hover = 0 Then GuiCtrlSetImage($GuiBackground, $GuiWallpaper) Select Case $Msg = $Exit Exit EndSelect WEnd Func Prewview($xControl) $Text = GuiCtrlRead($xControl) For $i = 1 to $GuiMenuItems[0][0] If $Text = $GuiMenuItems[$i][0] Then $Element = $i ExitLoop EndIf Next $PreviewPic = @ScriptDir & '\' & IniRead($GuiMenuDir & $GuiMenuItems[$Element][1], 'Data', 'ImagePreview', 'bin\menuitems\images\movies.jpg') GuiCtrlSetImage($GuiBackground, $PreviewPic) EndFunc EndFunc my problem is I can get the iamge to change when the button is hovered over but when I try to add If $Hover <> 1 Then GuiCtrlSetImage($GuiBackground, $GuiWallpaper) it flickers the image I want to have when its hovered and then just flickers the background image a lot Thanks in advance Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted January 7, 2010 Share Posted January 7, 2010 (edited) Maybe you should try to set the image once instead of 100 times a second? $globalflag = 0 While 1 $Msg = GUIGetMsg() $Hover = _ControlHover(0) If $globalflag = 0 And $Hover = 1 Then $globalflag = 1 Prewview(@Extended) EndIf If $globalflag = 1 And $Hover = 0 Then $globalflag = 0 GuiCtrlSetImage($GuiBackground, $GuiWallpaper) EndIf Select Case $Msg = $Exit Exit EndSelect WEndEdit:Wait... That's not right. Better now? Edited January 7, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
AcidCorps Posted January 9, 2010 Author Share Posted January 9, 2010 Thank you 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