Jump to content

When to refresh?


typhoon
 Share

Recommended Posts

$graphic = GUICtrlCreateGraphic(0, 0, 100, 100)
GUICtrlSetBkColor($graphic, 0xffffff)

while 1
; main loop
wend

So, what happens is that I just want the background color to show up (to highlight the graphic box from the rest of the gray window). This doesn't happen when the script runs, only when I click off and then back onto the script gui.

Link to comment
Share on other sites

works for me with 3.2.0.1 and beta 3.2.1.13

#include <GUIConstants.au3>

GUICreate('test', 150, 125)

Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "ExitScript")

$graphic = GUICtrlCreateGraphic(0, 0, 100, 100)
GUICtrlSetBkColor($graphic, 0xffffff)

GUISetState()

While 1
    Sleep(5000)
WEnd

Func ExitScript()
    Exit
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Huh. After playing around with it a bit, it seems like the problem was that I was showing the main GUI window before adding the Graphic control (adding it before showing the main window makes it ok, I guess because there is an implicit repaint). Strange though, because I also added Input controls after showing the main window and they show up without needing a manual refresh. Seems like this is varying from one control to another.

Link to comment
Share on other sites

Ok, well it seems that after drawing to the control (after showing the initial state), it still fails to refresh automatically unless the window is clicked off. I am drawing Pixels if that makes any difference.

Edited by typhoon
Link to comment
Share on other sites

$graphic = GUICtrlCreateGraphic(0, 0, 100, 100)
GUICtrlSetBkColor($graphic, 0xffffff)

while 1
; main loop
wend

So, what happens is that I just want the background color to show up (to highlight the graphic box from the rest of the gray window). This doesn't happen when the script runs, only when I click off and then back onto the script gui.

Ok, well it seems that after drawing to the control (after showing the initial state), it still fails to refresh automatically unless the window is clicked off. I am drawing Pixels if that makes any difference.

I suppose you would have had an solution by now if you prepared your question a little bit with some working code. Just throwing out unprepared questions are futile.

Wish you the best of luck with your code ;)

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...