Page 1 of 1
losing focus after moveto
Posted: 16 Jan 2025 06:31
by qwerty
Basically I need to create a new folder and move 2 files "111.txt|222.txt" to it; then trigger the rename mode (with "F2") waiting for the user input. I have the script code below:
Code: Select all
$selitems = "111.txt|222.txt";
$create = "123";
$new = new($create, "dir");
moveto $new, $selitems;
// focus; // doesn't work
selectitems $new;
#172;
It worked in v25.xx. But since v26.xx it has an error message saying "Tree or List must have input focus.". Looks like it lost focus after the
moveto command.
selectitems can't get the focus back. I tried
setting "BackgroundFileOps", 0;, but in vain. Any ideas?
P.S.
focus doesn't work: although the error message is gone, it only selected the new folder and doesn't trigger the rename mode like this:

- 123.png (1.48 KiB) Viewed 1863 times
Re: losing focus after moveto
Posted: 16 Jan 2025 06:40
by highend
Can't replicate in current beta when using
setting "BackgroundFileOps", 0;
You need to use that anyway, moveto is a command, not a function.
And in general: Why don't you ask via input for the folder name in the first place instead of going into rename mode?
Re: losing focus after moveto
Posted: 16 Jan 2025 14:32
by qwerty
Thanks for your reply.
Actually I found the difference (or bug?) in this new beta version and wanted to figure out what is going on. The basic idea is create a new folder with a "default" name (e.g. 123 in the example code). If the user is happy with it, just click anywhere else to accept the name; if not, just input the new name directly. input is too heavy for it, although it may work. Please help.
Below are the 2 gif files running the same code in v23 and v26 (the latest beta version).
v23 (comment
setting "BackgroundFileOps", 0;, and it works):

- v23.gif (62.12 KiB) Viewed 1828 times
v26 same effects with or without the setting

- v26.gif (132.06 KiB) Viewed 1828 times
Re: losing focus after moveto
Posted: 16 Jan 2025 16:07
by highend
Attach the XYplorer.ini (renamed to .xys) from that beta (remove license data before)
Re: losing focus after moveto
Posted: 16 Jan 2025 20:48
by qwerty
PM'ed to you. Thanks.
Re: losing focus after moveto
Posted: 16 Jan 2025 21:12
by highend
This works with your .ini here...
Code: Select all
setting "BackgroundFileOps", 0;
$selitems = "111.txt|222.txt";
$create = "123";
$new = new($create, "dir");
moveto $new, $selitems;
focus;
selectitems $new;
#172;
Re: losing focus after moveto
Posted: 16 Jan 2025 22:05
by qwerty
I tried it in a freshly downloaded beta version and it
indeed works in it. However, in the upgraded non-installed version, I have the same issue. A Weird problem.
I noticed for the fresh download, the xyplorer.ini file is in the root folder of xyplorer, while in the upgraded version, which was coming since v20.xx, everything keeps the old settings, and all the user data including .ini, .dat, the scripts and the layouts, is stored in a separate folder called "\data". Is that the reason?
Thanks anyway

. I will build it from the fresh version if I can't find why.
Re: losing focus after moveto
Posted: 16 Jan 2025 22:33
by highend
I noticed for the fresh download, the xyplorer.ini file is in the root folder of xyplorer
What? The portable version will have it's data in the ".\Data" subfolder, not in the root...
Re: losing focus after moveto
Posted: 16 Jan 2025 22:45
by qwerty
Re: losing focus after moveto
Posted: 16 Jan 2025 22:59
by highend
Obviously...

- 1.png (33.2 KiB) Viewed 1772 times
Re: losing focus after moveto
Posted: 16 Jan 2025 23:03
by qwerty