Support Forum

Debug in macro scripts

User
LayoutEditorFull
Thursday 1st November 2018
Hello, I am working on a simple c++ macro script and I am trying to debug why it is not working. I am running 20180804 on Centos 7. I tried adding some debug() commands but the debug.show() command does not open a window on my system. The example debug.layout also does not seem to be able to create a text editor window. Is there a place to setup the default text editor used by layouteditor? I was not able to find an option under the setup window. The error message that I get when I run my macro is: ") expected". Is there a log file available that shows more information about where this is encountered? Line numbers would be really helpful. I've scanned the code and it is not obvious to me where the missing parenthesis is located. Best, Andrew
Jürgen
LayoutEditorFull
Thursday 1st November 2018
Hi Andrew, how did you start the c++ macro script and where the error message is displayed? It should usually be like "*( expected. (row 13)*" including the row of code. If you start the macro from the build-in TextEditor the full error message and the debug output should be displayed there. If no text window is opened a new text window will be opened. With some display manager this window is behind the open layout window and hardly to recognize. In any case you will get the debug output, if you start the LayoutEditor from the command line with the "*--debug*" option. In this case any error message will be printed there as well as some additional debug information.
User
LayoutEditorFull
Thursday 1st November 2018
Thank you for the quick response. I started the macro by using the macros->execute macro function. If I use the macros->edit macro function nothing happens. The truncated error message appears in the bottom left corner of the editor window, in the same region where the mouse x,y coordinates are normally displayed. Moving the mouse overwrites the error message. I did restart layout editor with the --debug flag. That did work, and I was able to correct my macro with the detailed error messages. Thank you for your help. I would like to understand why the text editor does not seem to open. I am sure it must be due to a path or config issue on my system. Best, Andrew
Jürgen
LayoutEditorFull
Thursday 1st November 2018
That is strange. The TextEditor is build-in. It should run without any system configuration. Have you tried to start the LayoutEditor with the "*--textedit*" option. That will start the TextEditor windows directly. Does any entry appear for the TextEditor in the window list? What window manager / desktop system do you use? (KDE, Gnome, ...)
User
LayoutEditorFull
Thursday 1st November 2018
Thank you. I am running KDE 4.14.8 on Centos 7. When I use the --textedit option I get the following messages. No windows open, and using alt-tab does not show any windows that are drawn over: OpenAccess not found. Add a link to the oa binaries folder at layout/oa to use OpenAccess use desktop kde QXcbConnection: XCB error: 3 (BadWindow), sequence: 744, resource id: 31458614, major code: 40 (TranslateCoords), minor code: 0 Best, -A
Jürgen
LayoutEditorFull
Thursday 1st November 2018
Many different Version of KDE as well as RHEL7 (=CentOS7) is knowing to work correctly. I will try to reproduce this problem with this combination. The only thing i can imagine is that you had a bigger screen in the past and have moved the TextEditor to a location of the screen no longer existing and for this reason restoring the TextEdtior window location fails. In that case a start with the option "*--reset*" will help. But it should be listed in the KDE toolbar with all running application in any case.
User
LayoutEditorFull
Thursday 1st November 2018
It appears that when I press the text editor icon I can sometimes see an attempt to create a window, which then disappears as if the child process crashed. I looked through the system and x logs but did not see anything that stood out. I tried to start layouteditor using strace to see if that revealed anything but it did not. Starting with the --reset option does not appear to change the behavior. Amazingly, during this troubleshooting the text editor did appear one time. However, I have not been able to replicate this which is a little frustrating. The event that caused it to occur was when I executed a macro and entered in bogus data, causing the debug window to pop up. While it was up, the text editor appeared to functional normally. But attempting to repeat that operation so far has just resulted in the original behavior where the window does not appear. Interesting. Based off of that I would say that the problem may be something causing that child to crash. -A
Jürgen
LayoutEditorFull
Friday 2nd November 2018
I can confirm is issue: On RHEL7 with KDE the display of the TextEditor fails. When the TextEditor window is created the window flashes for some milliseconds and then it is never displayed again. The internal code textEditor->show() has no effect. All the code is running fine, just nothing is displayed. I guess the show event from the TextEditor to the desktopManager get somehow lost. The issue will be reviewed and fixed with the next update. Thanks for reporting it! RHEL7 and Gnome was also intensive tested and is running fine. This issue never appeared with Gnome.
User
LayoutEditorFull
Friday 2nd November 2018
Thanks for the quick response! Andrew