On Sat, 08 May 2004 00:41:06 -0700 John Finlay <[EMAIL PROTECTED]> wrote:
> Bob Hepple wrote: > > >On Fri, 7 May 2004 08:59:59 +0200 > >"Maik Hertha" <[EMAIL PROTECTED]> wrote: > > > > > > > >>:> Date: Thu, 6 May 2004 17:28:20 +1000 > >>:> From: Bob Hepple <[EMAIL PROTECTED]> > >>:> Subject: Re: [pygtk] segmentation fault after using clipboard > >>:> To: [EMAIL PROTECTED] > >>:> Message-ID: <[EMAIL PROTECTED]> > >>:> Content-Type: text/plain; charset="us-ascii" > >>:> > >>:> Just to narrow it down a bit, it's the > >>:> gtk.gdk.Display(os.environ["DISPLAY"]) call that causes the problem. > >>:> > >>:> Anyone with an idea? > >>:> > >>Why setting the DISPLAY explicit? PyGtk initializes itself with the current > >>DISPLAY otherwise it fails. > >> > >> > > > >Dear Maik, > > > >OK - I understand - but can you tell me, please, how do I reference the > >one created in the initialization? > > > > > Try the gtk.gdk.display_get_default() function: > > http://www.moeraki.com/pygtkreference/pygtk2reference/class-gdkdisplay.html#function-gdk--display-get-default > > John > Yes - it worked. I now do the following and the segmentation violations go away. self.display = gtk.gdk.display_manager_get().get_default_display() self.clipboard = gtk.Clipboard(self.display, "CLIPBOARD") I think my initial problem was calling gtk.gdk.Display() for every copy/cut/paste operation - pygtk does not like it! Same with gtk.Clipboard() - call it more than once and you're dead. So I call it once at the start of the program, store the values and everything is peachey! Thanks for the help! Cheers Bob -- Bob Hepple mailto:[EMAIL PROTECTED] http://bhepple.freeshell.org Public Key: http://bhepple.freeshell.org/public_keys.txt
pgp00000.pgp
Description: PGP signature
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
