Re: [PyQt] using xembed with pyqt/pykde

2010-07-28 Thread Aljoša Mohorović
anybody using xembed with pyqt?

Aljosa

On Mon, Jul 26, 2010 at 3:30 PM, Aljoša Mohorović
aljosa.mohoro...@gmail.com wrote:
 i'm trying to find a working example of a pyqt/pykde application that uses
 xembed to embed a gtk/gnome based app.
 don't know if it's important but i'm embedding gvim into a pykde app.

 any docs or examples are appreciated.

 Aljosa Mohorovic

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] using xembed with pyqt/pykde

2010-07-28 Thread Henning Schröder
On Wed, Jul 28, 2010 at 4:17 PM, Aljoša Mohorović
aljosa.mohoro...@gmail.com wrote:
 anybody using xembed with pyqt?

 Aljosa

I used QX11EmbedContainer to embed a terminal in PyQt. I don't know if
gvim could be used in a similar way.

Henning

# 
# -*- coding: utf-8 -*-
import atexit

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



class XTerm(QX11EmbedContainer):

   def __init__(self, parent, xterm_cmd=xterm):
   QX11EmbedContainer.__init__(self, parent)
   self.xterm_cmd = xterm_cmd
   self.process = QProcess(self)
   self.connect(self.process,
SIGNAL(finished(int, QProcess::ExitStatus)),
self.on_term_close)
   atexit.register(self.kill)


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


   def sizeHint(self):
   size = QSize(400, 300)
   return size.expandedTo(QApplication.globalStrut())


   def show_term(self):
   args = [
   -into,
   str(self.winId()),
   -bg,
   #00, # self.palette().color(QPalette.Background).name(),
   -fg,
   #f0f0f0, #self.palette().color(QPalette.Foreground).name(),
   # border
   -b, 0,
   -w, 0,
   # blink cursor
   -bc,
   ]
   self.process.start(self.xterm_cmd, args)
   if self.process.error() == QProcess.FailedToStart:
   print xterm not installed


   def on_term_close(self, exit_code, exit_status):
   print close, exit_code, exit_status
   self.close()
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] using xembed with pyqt/pykde

2010-07-26 Thread Aljoša Mohorović
i'm trying to find a working example of a pyqt/pykde application that uses
xembed to embed a gtk/gnome based app.
don't know if it's important but i'm embedding gvim into a pykde app.

any docs or examples are appreciated.

Aljosa Mohorovic
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt