2

Good morning,

I'm implementing a software in labgtk and I'd like to embed a terminal-like widget in the interface, similarly the terminal embedded in gedit (example: http://www.linuxnov.com/wp-content/uploads/2011/04/embedded-terminal-gedit-plugin.png). But the terminal-like widget must respond only to specific commands from the software, not from commands present in the OS.

I didn't find a lablgtk widget that can do this directly, and I only found vte, which is not implemented in Ocaml (and I never used the widget).

My question is: is there a way to embed a terminal/console widget in a lablgtk application?

Thanks in advance!

anol
  • 8,264
  • 3
  • 34
  • 78
  • *"But the must react only to specific commands from the software"* Is this software a program or a library? – didierc Feb 22 '15 at 11:39
  • Sorry for my odd english. I changed the phrase a little. It is a program. – Vítor Alcantara de Almeida Feb 23 '15 at 04:05
  • No problem, we're here to learn, I have my (large) share of mistakes. – didierc Feb 23 '15 at 19:31
  • Even though vte isn't in OCaml, it should be possible to bind it so you can use it in your program. I don't know how. That being said, I wouldn't know how to use vte to do what you want either; you'll probably want to play with `vte_terminal_feed()` and one (or more) of the various signals on `VteTerminal` since you likely **aren't** going to have a child process (given the problem description). I wouldn't really know; sorry. If worst comes to worst you could just fake it with a `GtkEntry` and `GtkTextArea`. – andlabs Feb 24 '15 at 05:06
  • Thank you @andlabs. Yes, I don`t intend to have a child process. I though about doing the second option (to fake it) in case I can't bind it to Ocaml, but I'd not like to do so much hard work before some research. – Vítor Alcantara de Almeida Feb 24 '15 at 15:16
  • How much hard work would it take to bind? I'm not familiar with Ocaml, sorry. – andlabs Feb 25 '15 at 16:41
  • I have no full idea either. But the lablgtk doc is not fully documented, so many times I`ll have to copy codes from other examples, then I assume it would take some considerable time. – Vítor Alcantara de Almeida Feb 27 '15 at 18:41
  • What I mean is making a direct binding of VTE to ocaml, rather than trying to do what lablgtk does. This assumes lablgtk can take a raw `GtkWidget *` to add to your window. As a word of warning: you'll need a version of VTE that still works with GTK+ 2. – andlabs Feb 28 '15 at 00:06

0 Answers0