
-----------------------------------
Paul
Thu Jan 29, 2004 10:52 pm

In which cases would you use this button code?
-----------------------------------
In which cases would you use: 

GUI.CreateButton (x, y, width : int, text : string,
    actionProc : procedure x ()) : int


and when would you useK

GUI.CreateButtonFull (x, y, width : int, text : string,
    actionProc : procedure x (), height : int, shortcut : char, default : boolean) : int


-----------------------------------
shorthair
Thu Jan 29, 2004 10:56 pm


-----------------------------------
There is no need for create button full really , and i warn you as being a new programmer to istead of going into the path of GUI , go into the path of making your own buttons ,that way ther eis not reset prglems or mixups , and it will be alot fater aswell , if you would like to learn more about making your own buttons PM me

-----------------------------------
Paul
Thu Jan 29, 2004 10:58 pm


-----------------------------------
You mean like using mousewhere and stuff, check the x and y coordinates?
the problem is, I dont know how to make the program stop and wait for a click

like this:

var font := Font.New ("serif:24") 
var x, y, button : int
       
            Mouse.Where (x, y, button)
           drawbox (6, maxy -111, 111, maxy-74, black)
            drawfillbox (7, maxy -110, 110, maxy-75, grey)
           Draw.Text ("sure bet", 10, maxy - 100, font, 34) 
           
           if button = 0 and x>6 and x < 111 and y > maxy-111 and y< maxy-74then
                locate (maxrow -5, maxcol -5)
                put "Sure Bet"
            else
                put " not clicked"
        
end if

how can I make it so that only a click is responded to?

-----------------------------------
jonos
Thu Jan 29, 2004 11:36 pm


-----------------------------------
i think you need to change button = 0 to button = 1 because button = 0 is no click on the mouse. also you should put it in a loop i think , that's what i do...

-----------------------------------
Delta
Thu Jan 29, 2004 11:36 pm


-----------------------------------
Well thats the thing... GUI.CreateButtonFull... at least the only reason I use it... is because you can set a shortcut key for it... say you want to press ctrl+z to undo something... then boom... it runs the button procedure... very useful

-----------------------------------
Paul
Thu Jan 29, 2004 11:38 pm


-----------------------------------
Thanx Jonos, even though I didn't get it right away, I got it eventually, I'll run a loop ONLY for the assignment of the variables, stupid me. Yay, self learning, I feel proud

-----------------------------------
we64
Thu Jan 29, 2004 11:44 pm


-----------------------------------
maybe you could do something like what I did in my hangman program...
if you do, change my button a little better....  :lol:  :lol: (my buttons were crappy. :D )

-----------------------------------
Paul
Thu Jan 29, 2004 11:45 pm


-----------------------------------
you should see Ivan's, he showed me how to do the unpushed/pushed buttons.

-----------------------------------
jonos
Fri Jan 30, 2004 12:09 am


-----------------------------------
seriously, if you have any problems with turing, just go to turing reference and search for that command you have problems with, that's what i did for some stuff and it really helped (that's how i figured out the button = 1 thing a little white back)
