Loading ...
Sorry, an error occurred while loading the content.

Re: xembed options for vim?

Expand Messages
  • Marc Weber
    ... Sorry I was off topic. ... If you hack gvim then yes. However I think you can t touch the main typing area easily because it basically is a terminal or
    Message 1 of 9 , Jul 1, 2010
    • 0 Attachment
      Excerpts from Aljosa Mohorovic's message of Fri Jul 02 01:26:37 +0200 2010:
      > On Jul 1, 6:10 pm, Marc Weber <marco-owe...@...> wrote:
      > > I still don't understand? Do you want to replace text fields in HTML
      > > documents by Vim ? That would be awesome!
      >
      > no, i just want to embed another application into vim window.
      > you can completely forget that i mentioned html5, if xembed (or some
      > similar technology) works in vim anything can be displayed.
      Sorry I was off topic.

      > > Give more details about your idea then. Do you want to have a special
      > > buffer which is kind of X display?
      > i think it's been discussed before but yes, i want a buffer/window/
      > anything inside vim that can render more advanced gui elements.
      > since gvim uses gtk is it possible to display other gtk elements
      > inside gvim window?
      If you hack gvim then yes.
      However I think you can't touch the main typing area easily because it
      basically is a terminal or such.

      > > The other way should be easy: create a window and embed Vim and your
      > > other X application.
      > could you point me to an existing example?
      I don't have one. I mean you could create a gtk/qt app

      +========================+
      | TITLE |
      +========================+
      | | |
      | VIM | YOUR |
      | | GUI |
      | | |
      +========================+

      Then you have to xembed vim at the left and tell it how to display a gui
      at the right (maybe using xembed again).
      I never used xembed so I don't know exactly how it works. glancing at
      some docs found by google it seemed to me being possible.

      Marc Weber

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Andy Spencer
      ... Agreed, if I remember correctly, even the GTK tabs aren t really tabs, but more like buttons that tell the main vim window which tab it should display.
      Message 2 of 9 , Jul 1, 2010
      • 0 Attachment
        On 2010-07-02 03:33, Marc Weber wrote:
        > Excerpts from Aljosa Mohorovic's message of Fri Jul 02 01:26:37 +0200 2010:
        > > i think it's been discussed before but yes, i want a buffer/window/
        > > anything inside vim that can render more advanced gui elements.
        > > since gvim uses gtk is it possible to display other gtk elements
        > > inside gvim window?
        >
        > If you hack gvim then yes.
        > However I think you can't touch the main typing area easily because it
        > basically is a terminal or such.

        Agreed, if I remember correctly, even the GTK "tabs" aren't really tabs,
        but more like buttons that tell the main vim window which "tab" it
        should display.


        On 2010-07-02 16:26, Aljosa Mohorovic wrote:
        > On Jul 1, 6:10?pm, Marc Weber <marco-owe...@...> wrote:
        > > The other way should be easy: create a window and embed Vim and your
        > > other X application.
        >
        > could you point me to an existing example?

        This will work, and it's pretty easy to do, I've attached a simple
        example using GtkSocket. What you won't be able to do is treat your GUI
        as a "vim window", e.g.:

        +========================+
        | TITLE |
        +========================+
        | | YOUR |
        | VIM | GUI |
        | |------------|
        | | |
        |-----------| VIM |
        | VIM | |
        +========================+

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Aljosa Mohorovic
        i ve used --servername and --socketid to embed gvim into a qt app but with no success. i can normally embed xterm using this code but with gvim nothing
        Message 3 of 9 , Jul 30, 2010
        • 0 Attachment
          i've used "--servername" and "--socketid" to embed gvim into a qt app
          but with no success.
          i can normally embed xterm using this code but with gvim nothing
          happens although if i use no args (for gvim process) it normally opens
          gvim outside of qt app.
          any ideas/tips?

          Aljosa Mohorovic


          python/qt code:
          ---------------------------------------------------------------------
          # -*- coding: utf-8 -*-
          import atexit
          import sys

          from PyQt4.QtCore import *
          from PyQt4.QtGui import *

          class GVim(QX11EmbedContainer):
          def __init__(self, parent):
          QX11EmbedContainer.__init__(self, parent)
          self.process = QProcess(self)
          self.connect(self.process,
          SIGNAL("finished(int, QProcess::ExitStatus)"),
          self.on_cmd_close)
          atexit.register(self.kill)

          def kill(self):
          self.process.kill()
          self.process.waitForFinished()

          def show_cmd(self):
          args = ["--servername", "%d" % self.winId(), "--socketid",
          "%d" % self.winId()]
          # args = []
          print args

          self.process.start("gvim", args)

          print "error:", self.process.error()
          if self.process.error() == QProcess.FailedToStart:
          print "cmd not installed"

          def on_cmd_close(self, exit_code, exit_status):
          print "close", exit_code, exit_status
          self.close()

          if __name__ == "__main__":
          app = QApplication(sys.argv)

          widget = QMainWindow()
          cmd = GVim(widget)
          cmd.show_cmd()
          cmd.resize(500,500)

          widget.resize(800,800)
          widget.show()

          sys.exit(app.exec_())

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Tony Mechelynck
          ... IIRC, to embed Vim in a Qt app (for instance in a Konqueror tab) you needed a Qt Vim: that would have meant kvim, which however stopped being maintained
          Message 4 of 9 , Jul 30, 2010
          • 0 Attachment
            On 30/07/10 18:10, Aljosa Mohorovic wrote:
            > i've used "--servername" and "--socketid" to embed gvim into a qt app
            > but with no success.
            > i can normally embed xterm using this code but with gvim nothing
            > happens although if i use no args (for gvim process) it normally opens
            > gvim outside of qt app.
            > any ideas/tips?
            >
            > Aljosa Mohorovic

            IIRC, to embed Vim in a Qt app (for instance in a Konqueror tab) you
            needed a Qt Vim: that would have meant kvim, which however stopped being
            maintained when it was at some patchlevel of Vim 6.1. If you have access
            to some old KDE3 release from a few years ago, it might be included.


            Best regards,
            Tony.
            --
            The trouble with superheros is what to do between phone booths.
            -- Ken Kesey

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          Your message has been successfully submitted and would be delivered to recipients shortly.