Sign in to follow this  
Followers 0
typhoon

When to refresh?

11 posts in this topic

When I use the Graphic control, nothing shows up unless I click off the window and then click back to it. Are manual refreshes necessary to make graphics show up while having the script gui on top?

Share this post


Link to post
Share on other sites



Supply a short script that can reproduce the problem, and we should be able to help resolve the problem.


SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Share this post


Link to post
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.

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
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 ;)

Share this post


Link to post
Share on other sites

Make it click on the desktop, then on the taskbar or just make it open the window.

Nonsense, no need to do something like that.


SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0