Page 1 of 1

Simple help with context menu

Posted: 08 Apr 2022 09:21
by John_C
This is a script to create custom "right-click on white in file list" menu.

When I select "New Folder", XY doesn't create it for me. The same for other menu items, they doesn't really work.

Code: Select all

"Right-Click on White in File List"
  $menu = <<<MENU
New Folder;#231
New Text File;#234
-
Paste;#202
-
Refresh;#1001
  MENU;

  popupmenu($menu);
As I understand, it seems there might be necessary to use eval() instead of popupmenu($menu), but it still doesn't work:

Code: Select all

"Right-Click on White in File List"
  $menu = <<<MENU
New Folder;#231
New Text File;#234
-
Paste;#202
-
Refresh;#1001
  MENU;

  $selected = popupmenu($menu);
  if (strpos($selected, "#") != -1) { eval("""$selected"""); }
  else { eval($selected); }

Re: Simple help with context menu

Posted: 08 Apr 2022 09:33
by highend
1st works fine in 23.00.0013 fresh...

Re: Simple help with context menu

Posted: 08 Apr 2022 10:11
by John_C
Works for me in 23.00.0013 too.

Still doesn't work in 23.00 after I have removed the Data folder. Not sure of course, but it seems there was a bug, which is now fixed