AutoHotkey Community

It is currently May 27th, 2012, 2:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: January 30th, 2010, 12:08 am 
Offline

Joined: November 23rd, 2009, 2:11 pm
Posts: 104
i am making a confusing script
it is supposed to make a gui that will add buttons to itself.
because it uses a target label, i had to make it reproduce itself into another file
it should then reload the script and produce another gui and the process repeats
it is not functioning correctly
NOTE:DONT COMPILE

Code:
type = 1
;1
if type = 1
nxtype = 2
else
nxtype = 1
gui, add, text, cgreen, button name
gui, add, edit, vname
gui, add, text, cgreen, website name
gui, add, edit, vplace
gui, add, button, default, create
;1
gui, add, button,, exit
gui, show
return
;1
;1
buttonexit:
gui, destroy
return
buttoncreate:
gui, submit
fileread, file, %A_ScriptFullPath%
filedelete, file, %A_ScriptFullPath%
;1
stringsplit, part, file, `;1
;1
fileappend,
(
type = %nxtype%
;%nxtype%%part2%gui, add, button,, %name%
;%nxtype%%part3%;%nxtype%%part4%button%name%:
run, %place%
return%part5%stringsplit, part, file, `;%type%
;%nxtype%%part5%
), %A_ScriptFullPath%
reload


it seems that it isnt reading itself, and it isnt deleting itself.
i have not compiled to exe, so it should have no problems with these tasks.

please help, i have put a lot of brain power into it and dont want it to go to waste
please help, i would like to have one of these

_________________
  /\ /\ This is Kitty
(>';'<) Cut, copy, and paste kitty onto your sig.
((")(")) Help Kitty gain World Domination.

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 30th, 2010, 12:59 am 
Offline

Joined: December 17th, 2008, 5:36 am
Posts: 80
Why are you trying to have the script re write itself just to add a button? I guess I don't know what you mean by target label. Either way here is how to add a button on the fly.

Example:
Code:
buttonnumber := 0
Gui, Add, Button, x5 y5 w60 h60 vbutton21 gtest, test
Gui, Show, w800 h100,
Return

test:
buttonnumber := buttonnumber + 1
xtemp := xtemp + 5
Gui, Add, Button, %xtemp% y5 w60 h60, #%buttonnumber%
return

guiclose:
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 30th, 2010, 1:26 am 
Offline

Joined: November 23rd, 2009, 2:11 pm
Posts: 104
i understand that now

but i still do not know how to make the button do anything

that was the reason i had the TARGET website, as i am going to use this to create internet shortcuts that i can pull up by opening the app.

andthese buttons are not permanent

_________________
  /\ /\ This is Kitty
(>';'<) Cut, copy, and paste kitty onto your sig.
((")(")) Help Kitty gain World Domination.

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 30th, 2010, 5:07 am 
take this for example:
Code:
Gui, Show, w200 h400

loop, 4
{
   ButtonPosY := (A_Index - 1) * 100
   ButtonVar%A_Index% := A_Index
   Gui, Add, Button, vButtonVar%A_Index% gButtonHandler x0 y%ButtonPosY% w200 h100, Button Nr. %A_Index%
   MsgBox
}

return

ButtonHandler:
PressedButton := %A_GuiControl%
MsgBox, You pressed Button Nr. %PressedButton%
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 30th, 2010, 10:42 pm 
Offline

Joined: November 23rd, 2009, 2:11 pm
Posts: 104
you see, by target label i meant the assigned gosub label. the button makers you have supplied do not have makeable gosubs.
also, when i start the script up, it does not load the buttons that i made last time

finally, i just want it to read and delete itself propely. it should have no problem, should it?

_________________
  /\ /\ This is Kitty
(>';'<) Cut, copy, and paste kitty onto your sig.
((")(")) Help Kitty gain World Domination.

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, engunneer, Google Feedfetcher, JSLover, rbrtryn, sjc1000 and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group