New, need very, very simple help with buttons
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 56
- Joined: Sat Jun 20, 2009 2:41 pm
New, need very, very simple help with buttons
Hello, I'm new to RR and have only very basic knowledge of programming. Need some very basic help with buttons.
I'll probably post about a million other questions if that's ok...
I'm not great at explaining things sometime so I make videos...
http://screencast.com/t/Z4iwwvjYpT9
Thanks!
I'll probably post about a million other questions if that's ok...
I'm not great at explaining things sometime so I make videos...
http://screencast.com/t/Z4iwwvjYpT9
Thanks!
Hi todayistheday (where do all you guys get those crazy nicks???
)
OK, here the answers (as I understood your problem)
1. Use a "on mouseenter" handler to do things when the mouse "rolls" over a button (or any other object).
Like this:
To "clear" the info field again when the user moves the mouse off of the button you can use "mouseleave"
2. This looked like another stack(?) that you want to show when the user clicks a button:
Pretty simply, once you know it 
Best from germany
Klaus

OK, here the answers (as I understood your problem)
1. Use a "on mouseenter" handler to do things when the mouse "rolls" over a button (or any other object).
Like this:
Code: Select all
on mouseenter
put "Click here or get lost" into fld "Info"
## Optional use another field with premade text:
## put fld "the (maybe hidden) field with the long info text" into fld "info"
end mouseenter
Code: Select all
on mouseleave
put empty into fld "info"
end mouseleave
Code: Select all
on mouseup
go stack "the stack with your TAB buttons here..."
## Or go to another card in the same stack as the button:
## go cd "card with the TAB buttons on it"
end mouseup

Best from germany
Klaus
Oh, I forgot:
Welcome to the forum!
Welcome to the forum!

Last edited by Klaus on Sat Jun 20, 2009 3:32 pm, edited 1 time in total.
Nice use of video 
for hovering there are (as often) several possible ways to do it. One that is not 100% reliable (but most of the time) would be this:
Another way is to not use a field, but enter text into the "tooltip" part of the property inspector for each of your buttons.
for changing the stuff that is currently shown on a stack ("stack" can mean various things in Rev, here it is a synonym for window) there's mostly 2 approaches:
showing/hiding groups:
You can group all the objects that belong together, and then set the "visibility" of the group to false/true. This is faster then hiding/showing each object by itself, and also easier to manage in code.
so for a tab button, you could create groups that are named the same as the items that the user can choose in the tabs:
using cards:
this is easier if you already used hypercard before, as the concept of cards would be known to you. basically each card is a "view", and a card is always part of a stack. you can do various things with cards, like store them for later reference (with "push" and "pop"), or just for hiding stuff from the user (by not giving him a way to navigate to the card).
For a tabbed button, you'd need to put the tabs into a group, and set that groups "backgroundbehavior" to true, and then you'd need to "place" said group onto each card that is part of the tabbed behaviour (this is done automatically if you create a new card). the code could then look like this, if you'd have named your cards the same as all the tabs:
I suggest to read all the tearms i mentioned above in the dictionary. Even if it's a bit overwhelming at first, something is bound to stick, and "browsing" trough the terms via the "see also" links is a good way to read about similar, or related topics.

for hovering there are (as often) several possible ways to do it. One that is not 100% reliable (but most of the time) would be this:
Code: Select all
on mouseEnter
put "mouse is within" && the short name of me into field 1
end mouseEnter
on mouseLeave
put "mouse is not over a button" into field 1
end mouseLeave
for changing the stuff that is currently shown on a stack ("stack" can mean various things in Rev, here it is a synonym for window) there's mostly 2 approaches:
showing/hiding groups:
You can group all the objects that belong together, and then set the "visibility" of the group to false/true. This is faster then hiding/showing each object by itself, and also easier to manage in code.
so for a tab button, you could create groups that are named the same as the items that the user can choose in the tabs:
Code: Select all
on menupick thePickedItem thePreviousItem
--first hiding the previous one
hide group thePreviousItem
--now show the one the user clicked on
show group thePickedItem
end menuPick
this is easier if you already used hypercard before, as the concept of cards would be known to you. basically each card is a "view", and a card is always part of a stack. you can do various things with cards, like store them for later reference (with "push" and "pop"), or just for hiding stuff from the user (by not giving him a way to navigate to the card).
For a tabbed button, you'd need to put the tabs into a group, and set that groups "backgroundbehavior" to true, and then you'd need to "place" said group onto each card that is part of the tabbed behaviour (this is done automatically if you create a new card). the code could then look like this, if you'd have named your cards the same as all the tabs:
Code: Select all
on menuPick theCurrentChoice
go card theCurrentChoice
end menuPick
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
-
- Posts: 56
- Joined: Sat Jun 20, 2009 2:41 pm
Thank you!
More question...
1. Do you have to go to a new window or can the entire page you were on be the new window. i.e.- can it just simply redraw the contents.
2. Once I'm previewing and "running" the program. How do I get back to be able to edit?
http://screencast.com/t/Ym0QGc53hGa
I know I've got a couple more questions about the tab use. I'll post that in a few...
Thanks again.
More question...
1. Do you have to go to a new window or can the entire page you were on be the new window. i.e.- can it just simply redraw the contents.
2. Once I'm previewing and "running" the program. How do I get back to be able to edit?
http://screencast.com/t/Ym0QGc53hGa
I know I've got a couple more questions about the tab use. I'll post that in a few...
Thanks again.
Hi Today,
1. I would suggest to use different cards in your (same) stack to display different content.
This way everything will happen in the same window.
And it is easy to navigate, see my last post:
2. This is extremely easy:
Just change the tool in the tools palette to "pointer" tool = the arrow with the little cross underneath.
This is one of the big benefits of Rev: No compiling to run the "app", just switch the tool
Best
Klaus
1. I would suggest to use different cards in your (same) stack to display different content.
This way everything will happen in the same window.
And it is easy to navigate, see my last post:
Code: Select all
...
go card "Name of cd with the TAB buttons"
...
Just change the tool in the tools palette to "pointer" tool = the arrow with the little cross underneath.
This is one of the big benefits of Rev: No compiling to run the "app", just switch the tool

Best
Klaus
P.S.
Be sure to work through these stacks here, which are extremely helpful to understand how everything works in Rev:
http://www.hyperactivesw.com/revscriptc ... ences.html
I make the one about "controls"
Be sure to work through these stacks here, which are extremely helpful to understand how everything works in Rev:
http://www.hyperactivesw.com/revscriptc ... ences.html
I make the one about "controls"

-
- Posts: 56
- Joined: Sat Jun 20, 2009 2:41 pm