Hi folks,
I am trying to mimic the mechanism of the reload all macros button.
Unfortunately, i get a nasty issue when i am using a loop i declare the isubpalette and the ibutton.
Here i post two macros the first one doesn’t works ( use [loop])
and the second macro works properly for the creation of the ui items.
[RoutineDef, Hello_World,
[Note, [StrMerge, message, " :: ", item]]
,message, item]
[IButton, "???", "Add subpalettes and button UI",
[If, [IExists, "Zplugin:Testing"],
[IClose, "Zplugin:Testing"]
[ISubPalette, "Zplugin:Testing"]
,//else
[ISubPalette, "Zplugin:Testing"]
]
[Loop, 5,
[VarSet, path, [StrMerge, "Zplugin:Testing:", n]]
[If, [IExists, path],
[IClose, path]
]
[VarSet, text, [StrMerge, "button-", n, " was pressed."]]
[IButton, path,"tooltip !",
[RoutineCall, Hello_World, text,n] // < don't pay attention to that )
,0,1]
[Note, [StrMerge, path,"\n"],,-1]
,n]
[Note,]
,,1]
but this one works :
[RoutineDef, Hello_World,
[Note, [StrMerge, message, " :: ", item]]
,message, item]
[IButton, "???", "Add subpalettes and button UI",
[If, [IExists, "Zplugin:Testing"],
[IClose, "Zplugin:Testing"]
[ISubPalette, "Zplugin:Testing"]
,//else
[ISubPalette, "Zplugin:Testing"]
]
[VarSet, i , 0]
[IButton, [StrMerge, "Zplugin:Testing:", i],"tooltip...",
[RoutineCall, Hello_World, "button was pressed.", [Var, i]]
,,1]
[VarInc, i]
[IButton, [StrMerge, "Zplugin:Testing:", i],"tooltip...",
[RoutineCall, Hello_World, "button was pressed.", [Var, i]]
,,1]
[VarInc, i]
[IButton, [StrMerge, "Zplugin:Testing:", i],"tooltip...",
[RoutineCall, Hello_World, "button was pressed.", [Var, i]]
,,1]
[Loop, 5,
[VarSet, path, [StrMerge, "Zplugin:Testing:", n]]
[If, [IExists, path],
[IClose, path]
]
[VarSet, text, [StrMerge, "button-", n, " was pressed."]]
[IButton, path,"tooltip !",
[RoutineCall, Hello_World, text,n]
,0,1]
[Note, [StrMerge, path,"\n"],,-1]
,n]
[Note,]
,,1]
If someone has any idea, because i can’t to not use [Loop] for such of purpose
Nicolas