[Closed] rcmenu on button
cool! (i saw the thread) although i was hoping for some kind of a method to do it without adding or installing a plugin…
Hmm… i just got an idea… i think i could overlap a button over a disabled imgtag, that way i could check if the the mouse is over the button, then maybe i could just set a switch for the on rbuttondown handler to check… (something [color=white]like [/color]if switch == 1 then do…) … this just might work… still have to test it though… anyway… thanks again for the reply! cool way to call an rcmenu by the way… i dont put my rcmenus inside functions (never though of it, never occured to me, hehehe)… but now, i guess your approach is way better.
rollout test_roll "test rollout" width:162 height:51
(
local switch = false
local myrcmenu
fn openrcmenu =
(
rcmenu myrcmenu
(
menuitem testitem1 "test 1"
menuitem testitem2 "test 2"
)
)
ImgTag invi_imgtag "" pos:[8,8] width:60 height:20
--button rc_button "right+click" pos:[8,8] width:60 height:20
button switch_bot "switch" pos:[80,8] width:60 height:20
on invi_imgtag mouseover do
(
print "inside"
invi_imgtag.visible = false
print invi_imgtag.visible
switch = true
)
on invi_imgtag mouseout do
(
print "outside"
invi_imgtag.visible = true
print invi_imgtag.visible
switch = false
)
on test_roll open do
(
openrcmenu()
print "registered rcmenu"
)
on test_roll rbuttondown the_pos do
(
if switch then
(
popupmenu myrcmenu
)
else
(
print "off"
)
)
on switch_bot pressed do
(
switch = (not switch)
print switch
)
)createdialog test_roll
i thought it was gonna work… but to my dismay, i guess i still have to look for another way… i just posted the script that i was working on just in case anyone also wants to try it out, or maybe suggest some other ideas… sigh