Page 1 of 1

Possible popup menu bug.

Posted: 22 Mar 2022 11:59
by Amunrah
Help.
Maybe I'm doing something wrong. But previously it worked in the custom buttons.

Code: Select all

"Favorites"
  $items = <<<~
    Favfolders|:favs|:favs
    Favfiles|:favfiles|:favfiles
    -
    Comp|:myco|:myco
    User folders|#551|MyIco.ico|1
~;
  popupmenu($items, , , , , , <crlf>, "|");
Now it doesn't work. Nothing happens when you click on menu items. Why?

Re: Possible popup menu bug.

Posted: 22 Mar 2022 12:32
by highend
previously
With which version?

Re: Possible popup menu bug.

Posted: 22 Mar 2022 21:43
by Amunrah
highend wrote: 22 Mar 2022 12:32
previously
With which version?
Sorry. But for example in version 22.40 it worked. Now the latest version (not worked).

Re: Possible popup menu bug.

Posted: 22 Mar 2022 22:01
by highend
Can confirm it.

It works with XYplorer 22.90.0012 but not 22.90.0100 so either 22.90.0013 (never released to the public) or 22.90.0100 is the culprit...

Re: Possible popup menu bug.

Posted: 26 Mar 2022 09:24
by admin
Indeed: The syntax you are using is caption;data;icon;state (or maybe better: caption;command;icon;state ) and it became a victim of the Hamburger revolution. Quietly an alternative syntax command;caption;icon;state had emerged. In order not to break any old code, I now decided to support both ways, and implement some logic that decides whether it's caption;command... or command;caption.... So, it should work again in the next beta.

Re: Possible popup menu bug.

Posted: 27 Mar 2022 05:22
by Amunrah
admin wrote: 26 Mar 2022 09:24 Indeed: The syntax you are using is caption;data;icon;state (or maybe better: caption;command;icon;state ) and it became a victim of the Hamburger revolution. Quietly an alternative syntax command;caption;icon;state had emerged. In order not to break any old code, I now decided to support both ways, and implement some logic that decides whether it's caption;command... or command;caption.... So, it should work again in the next beta.
Thank you so much, it works now.

Re: Possible popup menu bug.

Posted: 27 Mar 2022 09:41
by admin
1a. I'd say the recommend item syntax in a Hamburger now is this:
command (can be: menu command, toolbar button, script, path, URL)
and it will control the action, the caption, and the icon of the menu item.

1b. You can optionally customize the caption, the icon, and the state by adding these fields:
command[;caption;icon;state]

2. For backward compatibility, this old syntax is currently still tolerated (and it will be used when the 2nd field *looks like* a command ... I know this can mean trouble):
caption;command;icon;state

Re: Possible popup menu bug.

Posted: 27 Mar 2022 13:57
by xy123
admin wrote: 27 Mar 2022 09:41 1b. You can optionally customize the caption, the icon, and the state by adding these fields:
command[;caption;icon;state]
Except for script command, right? For script command only caption;/icon;command; works?

Code: Select all

::Hi;/some.ico;echo "hi!";

Re: Possible popup menu bug.

Posted: 27 Mar 2022 15:30
by admin
Yes, scripts are a necessary exception because they use the ";" separator as part of the script syntax.