[Gambas-user] Use of Embedder Component

Martin McGlensey mmcg29440 at ...3163...
Sat Dec 24 20:10:32 CET 2016


Hello,

 

I trying to embed a window running on the desktop in a form. The test app is
simple a form with a button and a frame. The code below is attached to the
"Start" button.  I'm running Gambas 3.9.1 under Mint 17 with the Mate
desktop.

 

What is the correct syntax for the Desktop.FindWindow command. I used the
title shown on the open window I want to embed. Not sure that was correct.

 

Thanks,

Marty

 

<Code>

 

Gambas class file

 

Public Sub btnStart_Click()

  Dim hEmbedder As Embedder

  Dim iWindowinfoArray As Integer[]

 

  hEmbedder = New Embedder(iqpy) As "Panadapter"

  Print Desktop.ActiveWindow

  * iWindowinfoArray = Desktop.FindWindow("IQ.PY v. 0.30 de AA6E")

  hEmbedder.Embed(iWindowinfoArray[0])

 

End

Iqpy is the name of the frame on the form.

 

The error occurs at the line marked with the *.

=======================<Error>=========================================

50331653 < Result obtained for the active window (Print
Desktop.ActiveWindow)

 

The program 'Panadapter' received an X Window System error.

 

This probably reflects a bug in the program.

 

The error was 'BadWindow (invalid Window parameter)'.

  (Details: serial 672 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.)

 




More information about the User mailing list