Double click on a picture
Double click on a picture
Hello,
is it possible to double click on a brush inserted between <rectangle/> to do an action please ?
I have tried many thing but nothing work...
Thanks for your help.
is it possible to double click on a brush inserted between <rectangle/> to do an action please ?
I have tried many thing but nothing work...
Thanks for your help.
Re: Double click on a picture
have you try to display it using Button.Icon (aka do it buton) or inside a html class ?
both these classes provide events
both these classes provide events
Christos
Re: Double click on a picture
Thanks plouf!
I will try them and comeback here
I will try them and comeback here
Re: Double click on a picture
Hello plouf,
i have tried the 2 solutions but without success...
i have tried the 2 solutions but without success...
Re: Double click on a picture
Is it possible to change the picture of the button with moai.Set() ?
I try but don't work...
work with picture class...
I try but don't work...
work with picture class...
Re: Double click on a picture
ok solved with LoadBrush()
Re: Double click on a picture
sorry, doesn't work, i can't update the brush in the button...
Any ideas please?
Any ideas please?
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Double click on a picture
Button.Icon has an applicability of I so moai.Set() won't work. The problem could be circumvented by detaching, re-creating and re-attaching the button but that is a rather ugly solution and will probably cause a visible visual glitch to the GUI.
To come back to your original problem: I agree that RapaGUI's Image class should provide some event handlers like mouse clicks. I'll add this for the next update. It has already been requested here.
Re: Double click on a picture
best way is to wait Adnreas to implement it, in the mean time you can use HOllywood display as a workaround
here is an example with single click
here is an example with single click
Code: Select all
xml$ = [[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="win" title="Tasks" >
<vgroup>
<rectangle />
<button id="ok">OK</button>
<hollywood display="2" width="150" height="150"/>
<button id="no">NO</button>
</vgroup>
</window>
</application>
]]
@REQUIRE "RapaGUI"
CreateDisplay(2,{color=#RED,x=150,y=150})
SelectDisplay(2)
CreateBrush(1,15,15,#GREEN)
CreateBrush(0,30,30,#BLUE)
DisplayBrush(1,20,20)
moai.CreateApp(xml$)
Function MouseUp(msg)
DebugPrint("clicl")
DisplayBrush(brush,20,20)
brush = 1-brush
EndFunction
InstallEventHandler({RapaGUI = p_eventFunc,OnMouseUp=MouseUp})
Repeat
WaitEvent
Forever
Christos