[Gambas-user] "The program received an X Window System error"... and more problems
Ru Vuott
vuott at ...325...
Tue Jun 17 01:27:42 CEST 2014
Hello,
well, I have this code to run a extern program from a Terminal:
****************************************
Public Sub Button1_Click()
' Opens the Terminal:
Desktop.OpenTerminal
End
Public Sub Button2_Click()
Dim c As Integer[]
' Finds the ID of Terminal window before open:
c = Desktop.FindWindow("Terminal")
' Gives the "Focus" to Terminal window:
Desktop.ActiveWindow = c[c.Max]
' Runs "Gedit" program:
Desktop.SendKeys("{gedit\n}")
End
*********************************************
I have some problems:
1) If I activate only "gb.desktop", but not also "gb.desktop.x11", I obtain an error at line:
c = Desktop.FindWindow("Terminal"):
" cannot load class x11: Unable to load class file "
My question: ok, but why does "gb.desktop" component have the function ".FindWindow()" ?
2) Well, so I activate also
I run my program, and press Button1: In console I obtain this notice:
"(gnome-terminal:21625): GLib-GIO-CRITICAL **: g_settings_get: the format string may not contain '&' (key 'monospace-font-name' from schema 'org.gnome.desktop.interface').
This call will probably stop working with a future version of glib."
My question: What's that ?
3) By pressing Button1, a Terminal window open. Well, so I press Button2... but I obtain this error:
" The program 'my_program'
received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 2363 error_code 3 request_code 20 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.) "
My question: What's that ?
4) Now I repeat procedure, but I do not close last Terminal. I run my_program, press Button1: now obviously I have 2 Terminals.
So, now I press Button2 and I do not receive error or notices.
Gedit opens.
My question: ...Why does my program runs perfect only with 2 or more Terminals ?
Best regards
vuottttttttt
More information about the User
mailing list