Graphic Buttons?
Author |
Message |
hamid14
|
Posted: Mon Oct 19, 2009 4:18 pm Post subject: Graphic Buttons? |
|
|
I searched CompSci for tutorials on buttons that have a picture on them, but couldn't find one. I tried putting a picture on top of the button, but it was behind the button. I tried all the different modes for the picture but it didn't work. Anybody know how to make graphic buttons? I am using Turing version 4.1. Thanks in advance.
Here's the code if you want to see it:
import GUI
var picture1 : int := Pic.FileNew("hello.BMP")
colorback(16)
color(1)
proc ello2
put "Hello! You clicked button 2!"
end ello2
proc ello
put "Hello! You clicked button 1!"
end ello
var button2 : int := GUI.CreateButton(125,10,5,"Hello!", ello)
var button1 : int := GUI.CreateButton(10,10,5,"Hello Again!", ello2)
loop
exit when GUI.ProcessEvent
end loop |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Mon Oct 19, 2009 4:45 pm Post subject: Re: Graphic Buttons? |
|
|
hamid14 @ Mon Oct 19, 2009 4:18 pm wrote: Anybody know how to make graphic buttons?
Pic.Draw + Mouse.Where |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
TheGuardian001
|
Posted: Mon Oct 19, 2009 6:36 pm Post subject: Re: Graphic Buttons? |
|
|
Or, if you absolutely insist on using the Turing GUI (Don't do it unless your teacher requires it),
GUI_CreatePictureButton |
|
|
|
|
|
SNIPERDUDE
|
|
|
|
|
Insectoid
|
Posted: Tue Oct 20, 2009 10:54 am Post subject: RE:Graphic Buttons? |
|
|
'cause it's probably more confusing to use yours than the default one?
Sniperdude, I just spent ten minutes thinking you were Btiffin. Can you...not have identical avatars? |
|
|
|
|
|
Kharybdis
|
Posted: Tue Oct 20, 2009 2:03 pm Post subject: RE:Graphic Buttons? |
|
|
your pictures were underneath because you didn't set the correct mode for it to appear with.
The following is taken from the manual:
picCopy This draws the picture on top of what was underneath, obscuring it completely.
picXor This draws the picture XORing it with the background. In DOS, you can use this function to do animation. Drawing an object on top of itself with XOR erases it and restores the background.
picMerge This draws the picture like picCopy except that any occurrence of the background color in the picture is not drawn to the screen. This allows you to draw an irregularly-shaped object and draw it to the screen.
picUnderMerge This draws the picture, but only where the background color was displayed underneath it. The effect of this is to make the picture appear to be displayed behind the background.
Edit: instectoid... you had 1111 posts when i saw this. my 5th 11:11 sighting of the day. sigh. |
|
|
|
|
|
SNIPERDUDE
|
Posted: Wed Oct 21, 2009 4:04 pm Post subject: Re: RE:Graphic Buttons? |
|
|
insectoid @ October 20th 2009 wrote: 'cause it's probably more confusing to use yours than the default one?
Sniperdude, I just spent ten minutes thinking you were Btiffin. Can you...not have identical avatars?
Sorry about that - It was too tempting to have Tux as an avatar. I was getting sick of my old one.
I also forgot btiffin had the same.
Anyway my GUI as simple as it may be, was intended for those who already understand Turing for the most part and provide more options than currently given.
Once you get to know it, it can be really extensive and useful. Bugs do exist due to me dropping that project (in Turing at least) and the fact that it isn't the greatest or fastest language. |
|
|
|
|
|
|
|