Right Click starter
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Right Click starter
Hello all,
In my project, I have a button that I would like to offer 'right click' options for, ie; Load a file, clear a file, etc...
Where can I find a tutorial on this and does anyone have any advise or tips for this very inexperienced traveler in Runtime?
Thanks in advance,
D
In my project, I have a button that I would like to offer 'right click' options for, ie; Load a file, clear a file, etc...
Where can I find a tutorial on this and does anyone have any advise or tips for this very inexperienced traveler in Runtime?
Thanks in advance,
D
-
- Posts: 344
- Joined: Tue Feb 24, 2009 6:14 pm
- Contact:
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
If you wqant your button to work for both left- and right-button clicks, doing some action for the left-button, and displaying the menu when right-clicking, then the following method will work best.
Put a popup-menu next to your button, name it "ContextualMenu" and set its menu content using the Inspector palette; set its script to and finally hide it. Then set the script of your button to
Now, when you left-click on the button, it continues to work as normal; when you right-click, the contextual menu pops up - and when you choose one of its items, the script simply tells you which item you picked.
Jan Schenkel.
Put a popup-menu next to your button, name it "ContextualMenu" and set its menu content using the Inspector palette; set its script to
Code: Select all
on menuPick pMenuItem
answer pMenuItem
end menuPick
Code: Select all
on mouseUp pMouseButton
if pMouseButton is 1 then -- left-button click
... do your normal thing ...
else
popup button "ContextualMenu"
end if
end mouseUp
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Oh yeah!!!
Far out guys! Thanks for that, it's working a treat so, while I have your attention...
I've succesfully managed to load a music file into a button, I can play it and puase it with that button, I can make options available by a right click menu now thanks to you guys but... How do I empty the button before I put a new file in it? ie, I just want an empty button.
Yours truly,
D
I've succesfully managed to load a music file into a button, I can play it and puase it with that button, I can make options available by a right click menu now thanks to you guys but... How do I empty the button before I put a new file in it? ie, I just want an empty button.
Yours truly,
D
So, it's a big Salami... Just take it one slice at a time.
-
- Posts: 344
- Joined: Tue Feb 24, 2009 6:14 pm
- Contact:
Hi Shadowslash...
I'm building an audio player and as I'm on a massive learning curve here, I've built several basic stacks and I use each stack to work out and test one or two simple functions at a time.
The plan is to have a button which I can load with a music file and then play it when I click the button. However, I want to be able to "purge" the player so that it is empty. I can then add a different file if required.
I use a load button to load the player, a play/pause button to... Well play & pause but I would like to offer the "load .wav" and "remove.wav" options as part of the right click menu.
However, I'm finding it hard to track down any examples of a simple "on mouse down" type of code to simply clear the current file from the player.
Sorry to go on and on but does this help?
D
The plan is to have a button which I can load with a music file and then play it when I click the button. However, I want to be able to "purge" the player so that it is empty. I can then add a different file if required.
I use a load button to load the player, a play/pause button to... Well play & pause but I would like to offer the "load .wav" and "remove.wav" options as part of the right click menu.
However, I'm finding it hard to track down any examples of a simple "on mouse down" type of code to simply clear the current file from the player.
Sorry to go on and on but does this help?
D
So, it's a big Salami... Just take it one slice at a time.
That does it...
Hi Guys,
Yes, that does the trick, that's all I needed to know at this stage. Now I can load and unload a music file from the player. Next step is to put the unload option into the right click menu and I can move onto the next mystery.
The device I'm trying to create is essentially for sound engineers like me, who have to fire sound effects and music stings into a production on very short notice. The idea is to have a page with say 20 "players" on it, each loaded with various music files ready to go at the click of a mouse.
Some files may be changed during the event hence a right click function menu to remove/reload files.
I don't want to use propriatory dedicated devices costing thousands os euros though, I want to use a simple bit of PC software.
Regards,
D
Yes, that does the trick, that's all I needed to know at this stage. Now I can load and unload a music file from the player. Next step is to put the unload option into the right click menu and I can move onto the next mystery.
The device I'm trying to create is essentially for sound engineers like me, who have to fire sound effects and music stings into a production on very short notice. The idea is to have a page with say 20 "players" on it, each loaded with various music files ready to go at the click of a mouse.
Some files may be changed during the event hence a right click function menu to remove/reload files.
I don't want to use propriatory dedicated devices costing thousands os euros though, I want to use a simple bit of PC software.
Regards,
D
So, it's a big Salami... Just take it one slice at a time.
-
- Posts: 344
- Joined: Tue Feb 24, 2009 6:14 pm
- Contact:
Well it's a good thing that you settled for RunRev. A lot of people seem to think that Rev is complicated but it's not. I myself thought of that before but when I spent a couple of days with Rev and checking the sample stacks and of course, getting some help from forum users, I managed to get around my problems...
Just take a look at this story of a guy who got locked out and saw the real ease of Rev. http://forums.runrev.com/phpBB2/viewtopic.php?t=3223 

