Rename a listview entry

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

Rename a listview entry

Post by papiosaur »

Hello all,

i would like to rename a text entry in a listview but don't work.

my line is:

moai.DoMethod("listview", "rename", "active", column6$)

Hollywood writes me string expected in argument 5, what i need more, in example i see "..." but don't work.

I have problems with functions : domethod("listview', .... ) because there no examples, and i don't understand variables.

Thanks for your help!
plouf
Posts: 671
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Rename a listview entry

Post by plouf »

provide a MinimunExampleCode with a listview you want to rename to see whats wrong

i suspect your position ->"active" ?! is wrong usually should be a number 0,1 etc
Christos
papiosaur
Posts: 217
Joined: Fri Mar 31, 2023 1:34 pm

Re: Rename a listview entry

Post by papiosaur »

Hi plouf,

i would like just rename a path in my entry of the column6 when i click on button named "modifydestpath",
i have a poppath which return a path with the variable destpath$.
I would like rename the entry of the column6$ by destpath$.

Code: Select all

Case "Pressed"
     Switch msg.ID
       Case "modifydestpath"
            moai.domethod'("listview", "rename", "active", column6$)
     Endswitch
plouf
Posts: 671
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Rename a listview entry

Post by plouf »

the code should work when i copy paste it .

i still see that you use "Active" and not something like moai.DoMethod("listview", "Rename", 1, column6$)

thats why a code that it should work, but FULLY code is necessary to check
i.e. do you have only 1 column ? what error provides etc
Christos
papiosaur
Posts: 217
Joined: Fri Mar 31, 2023 1:34 pm

Re: Rename a listview entry

Post by papiosaur »

i have 6 columns.

Something bizarre, if i write

moai.DoMethod("listview", "rename", "active", 1, 2, 3, 4, 5, despath$)

i have string 1 in column 1, etc.. and destpath$ in column 6 (it that i want)

I think there is a bug in RapaGui because normaly only column 6 is "EDITABLE"... Andreas?

But how to rename only column 6 ? I have tried this

moai.DoMethod("listview", "rename", "active", , , , , , destpath$)

but don't work...
User avatar
jPV
Posts: 734
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Rename a listview entry

Post by jPV »

Documentation tells:
"If the listview has multiple columns, you need to pass a new name for every column. It is not possible to rename only a single column entry - this method always affects the complete row so you need to pass as many strings as there are columns in your listview."

So, enter as many strings as you have columns in the listview. If you don't have other columns stored elsewhere, you can always do GetEntry to get the existing data before passing it back with Rename.

Like:
Local c1$, c2$, c3$, c4$, c5$, c6$ = moai.DoMethod("listview", "GetEntry", "Active")
moai.DoMethod("listview", "Rename", "Active", c1$, c2$, c3$, c4$, c5$, destpath$)
papiosaur
Posts: 217
Joined: Fri Mar 31, 2023 1:34 pm

Re: Rename a listview entry

Post by papiosaur »

Thanks jPV!

sorry, i didn't the first lines...
Post Reply