Desactivate a button with a specific entry in a listview

Find quick help here to get you started with Hollywood
Post Reply
papiosaur
Posts: 217
Joined: Fri Mar 31, 2023 1:34 pm

Desactivate a button with a specific entry in a listview

Post 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
User avatar
Juan Carlos
Posts: 933
Joined: Mon Sep 06, 2010 1:02 pm

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

Post by Juan Carlos »

Using the EnableButton you can use the DisableButton, but if it is RapaGUI, I haven't any idea for it.
plouf
Posts: 671
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

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

Post 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
Christos
papiosaur
Posts: 217
Joined: Fri Mar 31, 2023 1:34 pm

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

Post 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.
plouf
Posts: 671
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

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

Post 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
Christos
papiosaur
Posts: 217
Joined: Fri Mar 31, 2023 1:34 pm

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

Post 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 :-)
Post Reply