Sign in to follow this  
Followers 0
Pakku

Button And Picture

8 posts in this topic

hi,

how do i get this to work

when i click on the button with the text test, it does nothing

can someone help?

#include<GUIConstants.au3>

Opt("GUICloseOnESC",1)
Opt("GUIOnEventMode", 1)
Opt("RunErrorsFatal", 0)
Opt("TrayAutoPause", 0)
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode",1)
Opt("OnExitFunc", "close")

GUICreate("my proggie",600,400)

$tray_start = TrayCreateItem("Start")
TrayItemSetOnEvent($tray_start,"close")
$tray_status = TrayCreateItem("Status")
TrayItemSetOnEvent($tray_status,"close")
$tray_instellingen = TrayCreateItem("Instellingen")
TrayItemSetOnEvent($tray_instellingen,"close")
$tray_afsluiten = TrayCreateItem("Afsluiten")
TrayItemSetOnEvent($tray_afsluiten,"close")
TraySetIcon("Clean XP Pro.ico")


GUISetBkColor(0xFFFFFF)
GUISetIcon("icon.ico")
GUICtrlCreatePic("balk1.jpg",0,0,600,100)
$help = GUICtrlCreatePic("balk2.jpg",0,350,600,50)
GUICtrlCreatePic("balk3.jpg",575,100,25,250)
GUICtrlCreatePic("balk3.jpg",0,100,25,250)
GUICtrlCreatePic("balk4.jpg",300 - 154,60,308,40)
GUISetOnEvent($GUI_EVENT_CLOSE, "close")


$btn_start = GUICtrlCreateButton("test",200,375)
GUICtrlSetOnEvent($btn_start,"test")

GUISetState(@SW_SHOW)

While 1
    
WEnd

Func test()
    MsgBox(0,"","")
EndFunc

Func close()
    Exit
EndFunc

Arjan

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It goes to the msgbox() in test() for me, but then I don't have your pictures either. If you comment the pictures out, what happens?

Edit:

Try giving each of your GUICtrlCreatPic()'s a variable name, then before you call GUISetState(), disable them.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

to slow CPU useage... place a sleep in your loop

While 1

Sleep(10)

WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

the pictures are the problem, the script works fine without the picture but not with the pictures.

i think it has something to do with the syles or something.

Arjan

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

thanks Valuater

i'll do that

but the problem isn't resolved...

Arjan

Edited by arjan staring

Share this post


Link to post
Share on other sites

GuiCtrlSetState( -1, $GUI_DISABLE)

just after creating a pic ( that you are not using for input )

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

The sleep is definately an issue with CPU usage, but not the issue your having with your pictures, take a look at my edit above, and use the disable method for your pictures.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

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