Page 1 of 1

Desactivate a button with a specific entry in a listview

Posted: Mon May 15, 2023 10:36 am
by papiosaur
Hello,

i would like to desactivate a button for z specific entry in a listview. This my code but don't work

Code: Select all

Switch msg.action
	Case "RapaGUI"
		Switch msg.Class
		Case "Listview":
				Switch msg.Attribute
              			Case "Active":
					Local a1$, a2$, a3$, a4$, a5$, a6$, a7$, a8$ = moai.domethod("listview", "getentry", "active")	
					If a1$ = "https://www.morphos-storage.net/development/library/SDL_2.26.5_Librairies.lha"
						moai.set("modifydestpath", "disabled", true)
					Endif
				Endswitch		
		Endswitch	
Any idea ? Thanks for your help

Re: Desactivate a button with a specific entry in a listview

Posted: Mon May 15, 2023 12:01 pm
by Juan Carlos
Using the EnableButton you can use the DisableButton, but if it is RapaGUI, I haven't any idea for it.

Re: Desactivate a button with a specific entry in a listview

Posted: Mon May 15, 2023 4:06 pm
by plouf
a button,and most widgets, in RapaGui can be disabled using

Code: Select all

moai.Set("Button_ID","Disabled",True)
please always provide a minimun butfully working code, demostarting your problem
fully working = i can copy pase your code and will compile

this way helps everyone

Double thought... a example need since listview has only checkboxes and no buttons

Re: Desactivate a button with a specific entry in a listview

Posted: Mon May 15, 2023 5:31 pm
by papiosaur
my button is not in the listview but in my GUI

If i create a button to ask the same conditions, it work, the button is disabled if i select entry and press button.

I would like the button disabled when i click on the specific entry of the listview and not the button.

Entire code is not necessary i think in this case.

Re: Desactivate a button with a specific entry in a listview

Posted: Mon May 15, 2023 6:03 pm
by plouf
Therefore your problem is to detect when user pushes the exact item in a listview??

I think the easiest way is to add a checkbox

Re: Desactivate a button with a specific entry in a listview

Posted: Mon May 15, 2023 6:56 pm
by papiosaur
Thanks plouf for this way, i will test checkbox, i think it better way in fact to test an entry in a listview...

I comeback if it work or not :-)