[Gambas-user] Re: how to use embedder?
tetsuo
tetsuo at ...756...
Fri Oct 7 12:26:06 CEST 2005
Steve Starr wrote:
> tetsuo could you tell us step by step exactly how you used the
> embedder component?
> possible post some code.
>
> Thanks. :)
this is the code; it need of a form and an object-embedder named
Embedder1... but i don't like it:
<CODE>
PRIVATE shellProc AS Process
PUBLIC SUB Form_Open()
shellProc = EXEC ["Eterm", "--title", "keyword"]
WAIT 1'this is a bad condition
PRINT desktop.Find("keyword")[0]
Embedder1.Embed(desktop.Find("keyword")[0])
END
PUBLIC SUB Process_Kill()
ME.close
END
PUBLIC SUB Form_Close()
Embedder1.Discard
shellProc.Kill
END
</CODE>
Problems and bad conditions for this code:
the EXEC and SHELL functions, without WAIT flag, return imediatly when
the process is created (but not the windowID), so the desktop.find()
method called do not recognized new window.
For this problem i thinked to use a temporized WAIT, but it depend on
the loads and performaces of the local system; so this is a BAD solution.
When the X11-terminals starts they write the WINDOWID env-variable; i
could use -e option for execute "echo $WINDOWID". But i don't know how
to integrate this action in gambas; i can't read this line from gambas,
and the -e option close the term after the esxecution of command.
Pheraps the $WINDOWID way is wrong; another bad conseguence is that it's
valid only form terms and not for each kind of X11-window.
I didn't understand how to use Application.embedder. Pheraps it is only
possible good way... I didn't understand the example MyEmbed of Daniel
Campos :D
More information about the User
mailing list