Jump to content

GUICtrlSetGraphic Problem


Recommended Posts

Why doesn't it work to set a graphic after GUISetState(@SW_SHOW)

#include <GUIConstants.au3>
Opt("MouseCoordMode", 0)  

$child=GUICreate("My Draw")
GUISetState()

$x_pos=20
$y_pos=20
$a=GuiCtrlCreateGraphic(20, 20, 100,100)
GUICtrlSetBkColor(-1,0xffffff)
GUICtrlSetColor(-1,0)
GUICtrlSetGraphic($a,$GUI_GR_COLOR, 0xff0000,0xff0000)
GUICtrlSetGraphic ( $a, $GUI_GR_PIXEL , $x_pos,$y_pos )
GUICtrlSetGraphic($a,$GUI_GR_COLOR, 0xff0000,0xff0000)
GUICtrlSetGraphic ( $a, $GUI_GR_PIXEL , $x_pos,$y_pos+1 )
GUICtrlSetGraphic($a,$GUI_GR_COLOR, 0xff0000,0xff0000)
GUICtrlSetGraphic ( $a, $GUI_GR_PIXEL , $x_pos,$y_pos+2 )




Do
    $msg=GUIGetMsg()
Until $msg=$GUI_EVENT_CLOSE

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

I had that problem before, I find it always shows if you add a GUICtrlSetState($graphic, $GUI_SHOW) after the Graphic if created & set.

#include <GUIConstants.au3>
Opt("MouseCoordMode", 0)  

$child=GUICreate("My Draw")
GUISetState()

$x_pos=20
$y_pos=20
$a=GuiCtrlCreateGraphic(20, 20, 100,100)
GUICtrlSetBkColor(-1,0xffffff)
GUICtrlSetColor(-1,0)
GUICtrlSetGraphic($a,$GUI_GR_COLOR, 0xff0000,0xff0000)
GUICtrlSetGraphic ( $a, $GUI_GR_PIXEL , $x_pos,$y_pos )
GUICtrlSetGraphic($a,$GUI_GR_COLOR, 0xff0000,0xff0000)
GUICtrlSetGraphic ( $a, $GUI_GR_PIXEL , $x_pos,$y_pos+1 )
GUICtrlSetGraphic($a,$GUI_GR_COLOR, 0xff0000,0xff0000)
GUICtrlSetGraphic ( $a, $GUI_GR_PIXEL , $x_pos,$y_pos+2 )

GUICtrlSetState($a, $GUI_SHOW)

Do
    $msg=GUIGetMsg()
Until $msg=$GUI_EVENT_CLOSE

Kurt

Awaiting Diablo III..

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