From faustus.eee at gmail.com Wed Feb 1 10:42:16 2012 From: faustus.eee at gmail.com (Syed Husain) Date: Wed, 1 Feb 2012 13:42:16 +1100 Subject: [pygtk] Very Simple PyGTK project from a newbie Message-ID: Hello everyone, i am quite new in using Pygtk. so be nice:-) . i have created this simple temperature converter that works fine. but the problem i am having is that i can convert only one number at a time. i want my program running continuously until i click the "EXIT" button i created in my window. i have attached my code in a text file. any help will be appreciated. regards, Syed here is the code: *#!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk class Temperature_Converter: #this method will destroy the window def destroy(self,widget,data=None): print "Closed Successfully" gtk.main_quit() #the method is for converting from C to F def C2F(self,widget,x=10): self.x = x x = (5.0/9)*(self.Temperature-32) print "C2F: %f" %x #this method is for converting from F to C def F2C(self,widget,y=5): self.y = y y = (9.0/5)*self.Temperature+32 print "F2C: %f" %y #def textchange(self,widget): #self.label.set_text(self.textbox.get_text()) def __init__(self,Temperature): self.Temperature = Temperature self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_position(gtk.WIN_POS_CENTER_ALWAYS) self.window.set_size_request(600,100) self.button1 = gtk.Button("EXIT") self.button1.connect("clicked",self.destroy) self.button2 = gtk.Button("C2F") self.button2.connect("clicked",self.C2F) self.button3 = gtk.Button("F2C") self.button3.connect("clicked",self.F2C) #self.textbox = gtk.Entry() #self.textbox.connect("changed",self.textchange) #self.butto4 = gtk.Button("Main") #self.button4.connect("clicked",self.main) #self.label = gtk.Label("Number") self.box1 = gtk.VBox() self.box1.pack_start(self.button1) self.box1.pack_start(self.button2) self.box1.pack_start(self.button3) #self.box1.pack_start(self.button4) #self.box1.pack_start(self.textbox) #self.box1.pack_start(self.label) self.window.add(self.box1) self.window.show_all() self.window.connect("destroy",self.destroy) def main(self): #z = float(raw_input("Enter a number: ")) gtk.main() if __name__ == "__main__": a = float(raw_input("Enter a Number to Convert: ")) #Class Instance base =Temperature_Converter(a) base.main()* -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieterv at optionexplicit.be Fri Feb 10 05:44:04 2012 From: dieterv at optionexplicit.be (Dieter Verfaillie) Date: Thu, 09 Feb 2012 22:44:04 +0100 Subject: [pygtk] ANNOUNCE: PyGTK All-in-one Installer 2.24.2 Message-ID: <4F343E24.1020903@optionexplicit.be> We are pleased to announce release 2.24.2 of the PyGTK All-in-one installer for Windows. More information can be found in the README file at: http://download.gnome.org/binaries/win32/pygtk/2.24/pygtk-all-in-one.README * What is it? ============= The PyGTK All-in-one installer provides an alternative installation method for PyGTK users on Windows. It bundles PyGTK, PyGObject, PyCairo, PyGtkSourceView2, PyGooCanvas, PyRsvg, the gtk+-bundle and Glade in one handy installer. Currently 32 bit Python 2.6 and 2.7 versions are supported on Windows XP and up. Some screenshots can be seen at: https://github.com/dieterv/pygtk-installer/wiki * What's changed in 2.24.2 ? ============================ * Updated bundled GTK+ runtime packages to GTK+ 2.24.10-1 * Where to get it? ================== binaries: http://download.gnome.org/binaries/win32/pygtk/2.24/pygtk-all-in-one-2.24.2.win32-py2.6.msi md5sum : e6bfb9f330236d24a81ed778ec48a5ca size : 32,4M http://download.gnome.org/binaries/win32/pygtk/2.24/pygtk-all-in-one-2.24.2.win32-py2.7.msi md5sum : 4bddf847f81d8de2d73048b113da3dd5 size : 32,4M source code of the installer build tool: https://github.com/dieterv/pygtk-installer/tree/release-2.24.2 https://github.com/dieterv/pygtk-installer/tarball/release-2.24.2 https://github.com/dieterv/pygtk-installer/zipball/release-2.24.2 Enjoy! The PyGTK Team From 7stud at excite.com Mon Feb 13 05:06:39 2012 From: 7stud at excite.com (7stud) Date: Sun, 12 Feb 2012 13:06:39 -0800 (PST) Subject: [pygtk] How to install pyGTK on Mac? In-Reply-To: References: Message-ID: <1329080799046-4463134.post@n6.nabble.com> > I have made some binary packages, for Mac OS X 10.5 up: > http://macpkg.sourceforge.net/ > The PyGTK.pkg contains everything needed to run PyGTK. What is the md5 for the package. Or where can I find it. I'm getting: MD5 (/Users/me/Downloads/PyGTK.pkg) = 06196e48d022e458b60d43784a91d86b -- View this message in context: http://python.6.n6.nabble.com/How-to-install-pyGTK-on-Mac-tp2661952p4463134.html Sent from the Gtk+ - Python mailing list archive at Nabble.com. From afb at users.sourceforge.net Mon Feb 13 06:33:04 2012 From: afb at users.sourceforge.net (=?iso-8859-1?Q?Anders_F_Bj=F6rklund?=) Date: Sun, 12 Feb 2012 23:33:04 +0100 Subject: [pygtk] How to install pyGTK on Mac? In-Reply-To: <1329080799046-4463134.post@n6.nabble.com> References: <1329080799046-4463134.post@n6.nabble.com> Message-ID: <501A4E8F-8264-4BF7-9F9C-EEE22901B88E@users.sourceforge.net> 7stud wrote: >> I have made some binary packages, for Mac OS X 10.5 up: >> http://macpkg.sourceforge.net/ > >> The PyGTK.pkg contains everything needed to run PyGTK. > > What is the md5 for the package. Or where can I find it. I'm getting: > > MD5 (/Users/me/Downloads/PyGTK.pkg) = 06196e48d022e458b60d43784a91d86b Find it on http://sourceforge.net/projects/macpkg/files/PyGTK/2.24.0/ Is there a problem with the package ? Maybe I should have signed it. --anders PS. The (i) button on the download page above has the MD5 and SHA1. From 7stud at excite.com Mon Feb 13 06:54:01 2012 From: 7stud at excite.com (7stud) Date: Sun, 12 Feb 2012 14:54:01 -0800 (PST) Subject: [pygtk] How to install pyGTK on Mac? In-Reply-To: <501A4E8F-8264-4BF7-9F9C-EEE22901B88E@users.sourceforge.net> References: <1329080799046-4463134.post@n6.nabble.com> <501A4E8F-8264-4BF7-9F9C-EEE22901B88E@users.sourceforge.net> Message-ID: <1329087241729-4463341.post@n6.nabble.com> Anders F Bj?rklund-3 wrote > > Is there a problem with the package ? Maybe I should have signed it. > I don't know yet, I haven't installed it. I wanted to make sure I was downloading what was advertised. Thanks. -- View this message in context: http://python.6.n6.nabble.com/How-to-install-pyGTK-on-Mac-tp2661952p4463341.html Sent from the Gtk+ - Python mailing list archive at Nabble.com. From 7stud at excite.com Mon Feb 13 08:57:09 2012 From: 7stud at excite.com (7stud) Date: Sun, 12 Feb 2012 16:57:09 -0800 (PST) Subject: [pygtk] How to install pyGTK on Mac? In-Reply-To: <1329087241729-4463341.post@n6.nabble.com> References: <1329080799046-4463134.post@n6.nabble.com> <501A4E8F-8264-4BF7-9F9C-EEE22901B88E@users.sourceforge.net> <1329087241729-4463341.post@n6.nabble.com> Message-ID: <1329094629038-4463580.post@n6.nabble.com> 7stud wrote > > > I don't know yet, I haven't installed it. I wanted to make sure I was > downloading what was advertised. > > Thanks. > My install seems to be working on some hello world gui's. I'm reading the tutorial here: http://www.learngtk.org/pygtk-tutorial Thanks for your help--and for creating the mac os x package. I've used tkinter and wxpython, so I'm curious to see how pygtk stacks up. -- View this message in context: http://python.6.n6.nabble.com/How-to-install-pyGTK-on-Mac-tp2661952p4463580.html Sent from the Gtk+ - Python mailing list archive at Nabble.com. From liuqing.com at gmail.com Thu Feb 16 21:12:52 2012 From: liuqing.com at gmail.com (qing liu) Date: Thu, 16 Feb 2012 13:12:52 +0000 (UTC) Subject: [pygtk] Invitation to connect on LinkedIn Message-ID: <362797535.2803638.1329397972674.JavaMail.app@ela4-bed81.prod> LinkedIn ------------ I'd like to add you to my professional network on LinkedIn. - qing qing liu engineer at ??? China Confirm that you know qing liu: https://www.linkedin.com/e/-l22sq2-gypt88n3-62/isd/5948916416/EYWgZR--/?hs=false&tok=3LcOBTrR9o5l81 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/-l22sq2-gypt88n3-62/AwhKAVnmn4plOEmNAoTieJTsSqU/goo/pygtk%40daa%2Ecom%2Eau/20061/I2068878470_1/?hs=false&tok=2qv2Hc72Ro5l81 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From awilliam at whitemice.org Sat Feb 18 00:46:35 2012 From: awilliam at whitemice.org (Adam Tauno Williams) Date: Fri, 17 Feb 2012 11:46:35 -0500 Subject: [pygtk] Label width in chars ? In-Reply-To: <20120119004746.4449eeb8@bouzin.lan> References: <20120119004746.4449eeb8@bouzin.lan> Message-ID: <1329497195.3296.4.camel@linux-dauq.site> On Thu, 2012-01-19 at 00:47 +0100, J?r?me wrote: > I don't understand how a label width can be specified in chars. > Does this refer to a conventional width, that may depend on the font size ? > For instance, if I set a width of 10 chars, and I'm not using a monospace > font, there won't be the same amount of space left whether my string is > '..........' or 'mmmmmmmmmm'. > http://pygtk.org/docs/pygtk/class-gtklabel.html Correct, AFAIK. Given the current font/size width-charts dynamically [attempts to] size the label. This is part of Pango's pango_font_description_... stuff I believe. A given font/size has a default or average width for a character used for geometry calculations. > "width-chars" > Read-Write > The desired width of the label, in characters. If this property is set to -1, > the width will be calculated automatically, otherwise the label will request > either 3 characters or the property value, whichever is greater. Allowed > values: >= -1. Default value: -1. Available in GTK+ 2.6 and above. -- System & Network Administrator [ LPI & NCLA ] OpenGroupware Developer Adam Tauno Williams From josephseraos at gmail.com Sun Feb 19 09:46:32 2012 From: josephseraos at gmail.com (=?ISO-8859-1?Q?Joseph_S=2E_Alc=E2ntara?=) Date: Sat, 18 Feb 2012 22:46:32 -0300 Subject: [pygtk] PyGTK + OpenCV Message-ID: hi, I'm writing a application that uses pygtk and opencv. and I had a problem. When I run the program it shows a gui. So far so good. But, when I click in a menuitem, it should call a functino that runs the famous routine to show a video from webcam. But in this moment, the app freezes. I have tried to use thread, but opencv gui runs just after I call gtk.main_quit(). What could solve my problem? Thanks. Estou escrevendo um programa em python, usando pygtk e opencv. Quando rodo o programa, aparece uma janela e at? a?, beleza. Mas quando eu clico em um menuitem, ele deve chamar uma fun??o que roda a famosa rotina que exibe um v?deo a partir da webcam. No entanto, neste momento, o programa trava. Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois que eu fecho a janela, chamando gtk.main_quit(). O que poderia ser? Obrigado desde j?. *Joseph Soares Alc?ntara* Engenharia da Computa??o - 8? semestre Universidade Federal do Cear? - UFC Sobral - Cear? +--------------------------------------------------------------------------+ .| - ?v?...A liberdade n?o pode ser comprada e sim | .| -/(_)\..conquistada. Conquiste a sua tamb?m use | .| - ^^ G N U / L I N U X | +--------------------------------------------------------------------------+ -------------- next part -------------- An HTML attachment was scrubbed... URL: From catalinfest at gmail.com Sun Feb 19 16:51:49 2012 From: catalinfest at gmail.com (Catalin) Date: Sun, 19 Feb 2012 10:51:49 +0200 Subject: [pygtk] How disable shadow for just one window in gnome? Message-ID: Hello friends How disable shadow for just one window in gnome? I use a transparent pixmap but the display remains the shadow of the window. Regards. -- python-catalin.blogspot.com www.free-tutorials.org From giuspen at gmail.com Mon Feb 20 07:08:13 2012 From: giuspen at gmail.com (Giuseppe Penone) Date: Mon, 20 Feb 2012 00:08:13 +0100 Subject: [pygtk] pygtk i18n problem with windows and glade sentences Message-ID: Hi, in order to have the i18n working on linux I use (cons is a module where I have my constants written): locale.bindtextdomain(cons.APP_NAME, cons.LOCALE_PATH) gettext.translation(cons.APP_NAME, cons.LOCALE_PATH).install() this way I have translated either the sentences from the glade file and the sentences from the python code. on windows I don't have locale.bindtextdomain available, this causes the sentences from the glade file to be not translated. does anybody know if there's a way to have glade sentences translated on windows? Thanks and best regards, Giuseppe. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bhartsho at yahoo.com Mon Feb 20 10:57:42 2012 From: bhartsho at yahoo.com (Hart's Antler) Date: Sun, 19 Feb 2012 18:57:42 -0800 (PST) Subject: [pygtk] PyGTK + OpenCV In-Reply-To: References: Message-ID: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Hi Joseph, I got GTK and OpenCV working together using threads. ?This example works with CPython2, CPython3 and PyPy, see my blog post. http://pyppet.blogspot.com/2011/12/rpythonic-044.html -brett- ________________________________ From: Joseph S. Alc?ntara To: pygtk at daa.com.au Sent: Sunday, February 19, 2012 9:46 AM Subject: [pygtk] PyGTK + OpenCV hi, I'm writing a application that uses pygtk and opencv. and I had a problem. When I run the program it shows a gui. So far so good. But, when? I click in a menuitem, it should call a functino that runs the famous routine to show a video from webcam. But in this moment, the app freezes. I have tried to use thread, but opencv gui runs just after I call gtk.main_quit(). What could solve my problem? Thanks. Estou escrevendo um programa em python, usando pygtk e opencv. Quando rodo o programa, aparece uma janela e at? a?, beleza. Mas quando eu clico em um menuitem, ele deve chamar uma fun??o que roda a famosa rotina que exibe um v?deo a partir da webcam. No entanto, neste momento, o programa trava. Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois que eu fecho a janela, chamando gtk.main_quit(). O que poderia ser? Obrigado desde j?. Joseph Soares Alc?ntara Engenharia da Computa??o - 8? semestre Universidade Federal do Cear? - UFC Sobral - Cear? +--------------------------------------------------------------------------+ .| - ?v?...A liberdade n?o pode ser comprada e sim? ?? | .| -/(_)\..conquistada. Conquiste a sua tamb?m use?? | .| - ^^? ? ? ? ? ? ? ? ? G N U / L I N U X? ? ? ? ? ? ? ? ? ? ? ? ? | +--------------------------------------------------------------------------+ _______________________________________________ pygtk mailing list? pygtk at daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieterv at optionexplicit.be Mon Feb 20 16:21:48 2012 From: dieterv at optionexplicit.be (Dieter Verfaillie) Date: Mon, 20 Feb 2012 09:21:48 +0100 Subject: [pygtk] pygtk i18n problem with windows and glade sentences In-Reply-To: References: Message-ID: On Mon, 20 Feb 2012 00:08:13 +0100, Giuseppe Penone wrote: > does anybody know if there's a way to have glade sentences translated > on windows? Yep, I've pointed out a possible solution here: https://bugzilla.gnome.org/show_bug.cgi?id=574520#c36 mvg, Dieter From delentef at gmail.com Tue Feb 21 03:48:53 2012 From: delentef at gmail.com (Fabrice DELENTE) Date: Mon, 20 Feb 2012 20:48:53 +0100 Subject: [pygtk] ImportError for pynotify? Message-ID: <20120220194853.GA650@smtp.free.fr> Hello. I hope this list is relevant for my problem. I'd like to install blueman, the GTK bluetooth manager on my machine (Slackware 13.37). For that, I installed libnotify-0.7.4 and notify-python-0.1.1 (with a bit of trouble due to API changes), and then compiled blueman. However, when I start blueman-applet, I get $ blueman-applet Traceback (most recent call last): File "/usr/bin/blueman-applet", line 25, in import pynotify ImportError: No module named pynotify Why do I get this error? Thanks! -- F. Delente From antoine at nagafix.co.uk Tue Feb 21 04:06:44 2012 From: antoine at nagafix.co.uk (Antoine Martin) Date: Tue, 21 Feb 2012 03:06:44 +0700 Subject: [pygtk] ImportError for pynotify? In-Reply-To: <20120220194853.GA650@smtp.free.fr> References: <20120220194853.GA650@smtp.free.fr> Message-ID: <4F42A7D4.90807@nagafix.co.uk> On 02/21/2012 02:48 AM, Fabrice DELENTE wrote: > Hello. > > I hope this list is relevant for my problem. > > I'd like to install blueman, the GTK bluetooth manager on my machine > (Slackware 13.37). > > For that, I installed libnotify-0.7.4 and notify-python-0.1.1 (with a > bit of trouble due to API changes), and then compiled blueman. > > However, when I start blueman-applet, I get > > $ blueman-applet > Traceback (most recent call last): > File "/usr/bin/blueman-applet", line 25, in > import pynotify > ImportError: No module named pynotify > > Why do I get this error? Because pynotify is not installed: http://pyinotify.sourceforge.net/ Antoine > > Thanks! > From antoine at nagafix.co.uk Tue Feb 21 04:09:16 2012 From: antoine at nagafix.co.uk (Antoine Martin) Date: Tue, 21 Feb 2012 03:09:16 +0700 Subject: [pygtk] ImportError for pynotify? In-Reply-To: <4F42A7D4.90807@nagafix.co.uk> References: <20120220194853.GA650@smtp.free.fr> <4F42A7D4.90807@nagafix.co.uk> Message-ID: <4F42A86C.7080102@nagafix.co.uk> On 02/21/2012 03:06 AM, Antoine Martin wrote: > On 02/21/2012 02:48 AM, Fabrice DELENTE wrote: >> Hello. >> >> I hope this list is relevant for my problem. >> >> I'd like to install blueman, the GTK bluetooth manager on my machine >> (Slackware 13.37). >> >> For that, I installed libnotify-0.7.4 and notify-python-0.1.1 (with a >> bit of trouble due to API changes), and then compiled blueman. >> >> However, when I start blueman-applet, I get >> >> $ blueman-applet >> Traceback (most recent call last): >> File "/usr/bin/blueman-applet", line 25, in >> import pynotify >> ImportError: No module named pynotify >> >> Why do I get this error? > Because pynotify is not installed: > http://pyinotify.sourceforge.net/ Sorry, wrong link, (blame google), here is the right one: http://www.galago-project.org/news/index.php It's difficult to find because it is sometimes called python-notify, notify-python, py-notify, etc! Antoine > > Antoine > >> >> Thanks! >> > From delentef at gmail.com Tue Feb 21 04:25:26 2012 From: delentef at gmail.com (Fabrice DELENTE) Date: Mon, 20 Feb 2012 21:25:26 +0100 Subject: [pygtk] ImportError for pynotify? In-Reply-To: <4F42A86C.7080102@nagafix.co.uk> References: <20120220194853.GA650@smtp.free.fr> <4F42A7D4.90807@nagafix.co.uk> <4F42A86C.7080102@nagafix.co.uk> Message-ID: <20120220202526.GB2348@smtp.free.fr> > > Because pynotify is not installed: > > http://pyinotify.sourceforge.net/ > Sorry, wrong link, (blame google), here is the right one: > http://www.galago-project.org/news/index.php > > It's difficult to find because it is sometimes called python-notify, > notify-python, py-notify, etc! Yeah, that must be why I didn't get the good one. Thanks for the link. -- F. Delente From delentef at gmail.com Tue Feb 21 04:28:06 2012 From: delentef at gmail.com (Fabrice DELENTE) Date: Mon, 20 Feb 2012 21:28:06 +0100 Subject: [pygtk] ImportError for pynotify? In-Reply-To: <20120220202526.GB2348@smtp.free.fr> References: <20120220194853.GA650@smtp.free.fr> <4F42A7D4.90807@nagafix.co.uk> <4F42A86C.7080102@nagafix.co.uk> <20120220202526.GB2348@smtp.free.fr> Message-ID: <20120220202806.GC2348@smtp.free.fr> > > Sorry, wrong link, (blame google), here is the right one: > > http://www.galago-project.org/news/index.php > Thanks for the link. ... except that this is the page I already downloaded from and then compiled and installed pynotify (notify-python-0.1.1.tar.bz2 is what I downladed) :^( Do I have to install galago and its python bindings? -- F. Delente From antoine at nagafix.co.uk Tue Feb 21 05:39:43 2012 From: antoine at nagafix.co.uk (Antoine Martin) Date: Tue, 21 Feb 2012 04:39:43 +0700 Subject: [pygtk] ImportError for pynotify? In-Reply-To: <20120220202806.GC2348@smtp.free.fr> References: <20120220194853.GA650@smtp.free.fr> <4F42A7D4.90807@nagafix.co.uk> <4F42A86C.7080102@nagafix.co.uk> <20120220202526.GB2348@smtp.free.fr> <20120220202806.GC2348@smtp.free.fr> Message-ID: <4F42BD9F.3080007@nagafix.co.uk> On 02/21/2012 03:28 AM, Fabrice DELENTE wrote: >>> Sorry, wrong link, (blame google), here is the right one: >>> http://www.galago-project.org/news/index.php > >> Thanks for the link. > > ... except that this is the page I already downloaded from and then > compiled and installed pynotify (notify-python-0.1.1.tar.bz2 is what I > downladed) :^( Maybe it isn't installed properly? This project has no docs, an empty README and an empty INSTALL.. ouch! > Do I have to install galago and its python bindings? > No. I don't think so. Sorry, out of ideas. Antoine From delentef at gmail.com Tue Feb 21 05:44:26 2012 From: delentef at gmail.com (Fabrice DELENTE) Date: Mon, 20 Feb 2012 22:44:26 +0100 Subject: [pygtk] ImportError for pynotify? In-Reply-To: <4F42BD9F.3080007@nagafix.co.uk> References: <20120220194853.GA650@smtp.free.fr> <4F42A7D4.90807@nagafix.co.uk> <4F42A86C.7080102@nagafix.co.uk> <20120220202526.GB2348@smtp.free.fr> <20120220202806.GC2348@smtp.free.fr> <4F42BD9F.3080007@nagafix.co.uk> Message-ID: <20120220214426.GA10410@smtp.free.fr> > Maybe it isn't installed properly? This project has no docs, an > empty README and an empty INSTALL.. ouch! I'll try recompiling and reinstalling then... I'll look into Ubuntu sources files too, because I know that blueman and so this module are installed there. > No. I don't think so. I don't think too. > Sorry, out of ideas. Thanks anyway! :^) -- F. Delente From josephseraos at gmail.com Tue Feb 21 07:37:10 2012 From: josephseraos at gmail.com (=?ISO-8859-1?Q?Joseph_S=2E_Alc=E2ntara?=) Date: Mon, 20 Feb 2012 20:37:10 -0300 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Message-ID: Hi, Thank you for response to me. See, can I sand you my program to you see what I am making? I've used Thread, but seems like is not working like I want. You must run from main.py *Joseph Soares Alc?ntara* Engenharia da Computa??o - 8? semestre Universidade Federal do Cear? - UFC Sobral - Cear? +--------------------------------------------------------------------------+ .| - ?v?...A liberdade n?o pode ser comprada e sim | .| -/(_)\..conquistada. Conquiste a sua tamb?m use | .| - ^^ G N U / L I N U X | +--------------------------------------------------------------------------+ 2012/2/19 Hart's Antler > Hi Joseph, > I got GTK and OpenCV working together using threads. This example works > with CPython2, CPython3 and PyPy, see my blog post. > http://pyppet.blogspot.com/2011/12/rpythonic-044.html > > -brett- > > ------------------------------ > *From:* Joseph S. Alc?ntara > *To:* pygtk at daa.com.au > *Sent:* Sunday, February 19, 2012 9:46 AM > *Subject:* [pygtk] PyGTK + OpenCV > > hi, I'm writing a application that uses pygtk and opencv. and I had a > problem. When I run the program it shows a gui. So far so good. But, when > I click in a menuitem, it should call a functino that runs the famous > routine to show a video from webcam. But in this moment, the app freezes. I > have tried to use thread, but opencv gui runs just after I call > gtk.main_quit(). What could solve my problem? Thanks. > > Estou escrevendo um programa em python, usando pygtk e opencv. Quando rodo > o programa, aparece uma janela e at? a?, beleza. Mas quando eu clico em um > menuitem, ele deve chamar uma fun??o que roda a famosa rotina que exibe um > v?deo a partir da webcam. No entanto, neste momento, o programa trava. > Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois que eu > fecho a janela, chamando gtk.main_quit(). O que poderia ser? Obrigado desde > j?. > > *Joseph Soares Alc?ntara* > Engenharia da Computa??o - 8? semestre > Universidade Federal do Cear? - UFC > Sobral - Cear? > > > +--------------------------------------------------------------------------+ > .| - ?v?...A liberdade n?o pode ser comprada e sim | > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > .| - ^^ G N U / L I N U X | > > +--------------------------------------------------------------------------+ > > > _______________________________________________ > pygtk mailing list pygtk at daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ > > -------------- Pr?xima Parte ---------- Um anexo em HTML foi limpo... URL: -------------- Pr?xima Parte ---------- Um anexo n?o-texto foi limpo... Nome: src.tar.gz Tipo: application/x-gzip Tamanho: 4469 bytes Descri??o: n?o dispon?vel URL: From john.stowers.lists at gmail.com Tue Feb 21 16:54:11 2012 From: john.stowers.lists at gmail.com (John Stowers) Date: Tue, 21 Feb 2012 09:54:11 +0100 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Message-ID: GTK is not threadsafe. If opencv shows a gtk mainwindow in cv.ShowImage, and that occurs in a different thread to the one running gtk_main, then unpredictable crashes and odd behaviour will result. Please check the pygtk FAQ for how to use threading and pygtk. I suggest displaying the image yourself in by getting the data from the IPL image and copying it into a GtkImage. Or be much more careful with which operations you do in which thread (i.e. cv.ShowImage, cv.WaitKey) John 2012/2/21 Joseph S. Alc?ntara : > Hi, Thank you for response to me. > > See, can I sand you my program to you see what I am making? I've used > Thread, but seems like is not working like I want. > > You must run from main.py > > Joseph Soares Alc?ntara > Engenharia da Computa??o - 8? semestre > Universidade Federal do Cear? - UFC > Sobral - Cear? > > +--------------------------------------------------------------------------+ > .| - ?v?...A liberdade n?o pode ser comprada e sim? ?? | > .| -/(_)\..conquistada. Conquiste a sua tamb?m use?? | > .| - ^^? ? ? ? ? ? ? ? ? G N U / L I N U X? ? ? ? ? ? ? ? ? ? ? ? ? | > +--------------------------------------------------------------------------+ > > > > 2012/2/19 Hart's Antler >> >> Hi Joseph, >> I got GTK and OpenCV working together using threads. ?This example works >> with CPython2, CPython3 and PyPy, see my blog post. >> http://pyppet.blogspot.com/2011/12/rpythonic-044.html >> >> -brett- >> >> ________________________________ >> From: Joseph S. Alc?ntara >> To: pygtk at daa.com.au >> Sent: Sunday, February 19, 2012 9:46 AM >> Subject: [pygtk] PyGTK + OpenCV >> >> hi, I'm writing a application that uses pygtk and opencv. and I had a >> problem. When I run the program it shows a gui. So far so good. But, when? I >> click in a menuitem, it should call a functino that runs the famous routine >> to show a video from webcam. But in this moment, the app freezes. I have >> tried to use thread, but opencv gui runs just after I call gtk.main_quit(). >> What could solve my problem? Thanks. >> >> Estou escrevendo um programa em python, usando pygtk e opencv. Quando rodo >> o programa, aparece uma janela e at? a?, beleza. Mas quando eu clico em um >> menuitem, ele deve chamar uma fun??o que roda a famosa rotina que exibe um >> v?deo a partir da webcam. No entanto, neste momento, o programa trava. >> Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois que eu >> fecho a janela, chamando gtk.main_quit(). O que poderia ser? Obrigado desde >> j?. >> >> Joseph Soares Alc?ntara >> Engenharia da Computa??o - 8? semestre >> Universidade Federal do Cear? - UFC >> Sobral - Cear? >> >> >> +--------------------------------------------------------------------------+ >> .| - ?v?...A liberdade n?o pode ser comprada e sim? ?? | >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use?? | >> .| - ^^? ? ? ? ? ? ? ? ? G N U / L I N U X? ? ? ? ? ? ? ? ? ? ? ? ? | >> >> +--------------------------------------------------------------------------+ >> >> >> _______________________________________________ >> pygtk mailing list? pygtk at daa.com.au >> http://www.daa.com.au/mailman/listinfo/pygtk >> Read the PyGTK FAQ: http://faq.pygtk.org/ >> > > > _______________________________________________ > pygtk mailing list ? pygtk at daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ From josephseraos at gmail.com Tue Feb 21 23:02:43 2012 From: josephseraos at gmail.com (=?ISO-8859-1?Q?Joseph_S=2E_Alc=E2ntara?=) Date: Tue, 21 Feb 2012 12:02:43 -0300 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Message-ID: Even if I don't use, ie, if I comment the lines where NamedWindow, ShowImage and WaitKey appear it freezes too. *Joseph Soares Alc?ntara* Engenharia da Computa??o - 8? semestre Universidade Federal do Cear? - UFC Sobral - Cear? +--------------------------------------------------------------------------+ .| - ?v?...A liberdade n?o pode ser comprada e sim | .| -/(_)\..conquistada. Conquiste a sua tamb?m use | .| - ^^ G N U / L I N U X | +--------------------------------------------------------------------------+ 2012/2/21 John Stowers > GTK is not threadsafe. > > If opencv shows a gtk mainwindow in cv.ShowImage, and that occurs in a > different thread to the one running gtk_main, then unpredictable > crashes and odd behaviour will result. > > Please check the pygtk FAQ for how to use threading and pygtk. > > I suggest displaying the image yourself in by getting the data from > the IPL image and copying it into a GtkImage. Or be much more careful > with which operations you do in which thread (i.e. cv.ShowImage, > cv.WaitKey) > > John > > 2012/2/21 Joseph S. Alc?ntara : > > Hi, Thank you for response to me. > > > > See, can I sand you my program to you see what I am making? I've used > > Thread, but seems like is not working like I want. > > > > You must run from main.py > > > > Joseph Soares Alc?ntara > > Engenharia da Computa??o - 8? semestre > > Universidade Federal do Cear? - UFC > > Sobral - Cear? > > > > > +--------------------------------------------------------------------------+ > > .| - ?v?...A liberdade n?o pode ser comprada e sim | > > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > > .| - ^^ G N U / L I N U X | > > > +--------------------------------------------------------------------------+ > > > > > > > > 2012/2/19 Hart's Antler > >> > >> Hi Joseph, > >> I got GTK and OpenCV working together using threads. This example works > >> with CPython2, CPython3 and PyPy, see my blog post. > >> http://pyppet.blogspot.com/2011/12/rpythonic-044.html > >> > >> -brett- > >> > >> ________________________________ > >> From: Joseph S. Alc?ntara > >> To: pygtk at daa.com.au > >> Sent: Sunday, February 19, 2012 9:46 AM > >> Subject: [pygtk] PyGTK + OpenCV > >> > >> hi, I'm writing a application that uses pygtk and opencv. and I had a > >> problem. When I run the program it shows a gui. So far so good. But, > when I > >> click in a menuitem, it should call a functino that runs the famous > routine > >> to show a video from webcam. But in this moment, the app freezes. I have > >> tried to use thread, but opencv gui runs just after I call > gtk.main_quit(). > >> What could solve my problem? Thanks. > >> > >> Estou escrevendo um programa em python, usando pygtk e opencv. Quando > rodo > >> o programa, aparece uma janela e at? a?, beleza. Mas quando eu clico em > um > >> menuitem, ele deve chamar uma fun??o que roda a famosa rotina que exibe > um > >> v?deo a partir da webcam. No entanto, neste momento, o programa trava. > >> Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois que > eu > >> fecho a janela, chamando gtk.main_quit(). O que poderia ser? Obrigado > desde > >> j?. > >> > >> Joseph Soares Alc?ntara > >> Engenharia da Computa??o - 8? semestre > >> Universidade Federal do Cear? - UFC > >> Sobral - Cear? > >> > >> > >> > +--------------------------------------------------------------------------+ > >> .| - ?v?...A liberdade n?o pode ser comprada e sim | > >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > >> .| - ^^ G N U / L I N U X | > >> > >> > +--------------------------------------------------------------------------+ > >> > >> > >> _______________________________________________ > >> pygtk mailing list pygtk at daa.com.au > >> http://www.daa.com.au/mailman/listinfo/pygtk > >> Read the PyGTK FAQ: http://faq.pygtk.org/ > >> > > > > > > _______________________________________________ > > pygtk mailing list pygtk at daa.com.au > > http://www.daa.com.au/mailman/listinfo/pygtk > > Read the PyGTK FAQ: http://faq.pygtk.org/ > -------------- Pr?xima Parte ---------- Um anexo em HTML foi limpo... URL: From john.stowers.lists at gmail.com Tue Feb 21 23:39:19 2012 From: john.stowers.lists at gmail.com (John Stowers) Date: Tue, 21 Feb 2012 16:39:19 +0100 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Message-ID: IIRC opecv starts a mainloop when create window is called. In general, don't use threads unless you have read the FAQ and understand what you are doing. John 2012/2/21 Joseph S. Alc?ntara : > Even if I don't use, ie, if I comment the lines where NamedWindow, ShowImage > and WaitKey appear it freezes too. > > Joseph Soares Alc?ntara > Engenharia da Computa??o - 8? semestre > Universidade Federal do Cear? - UFC > Sobral - Cear? > > +--------------------------------------------------------------------------+ > .| - ?v?...A liberdade n?o pode ser comprada e sim? ?? | > .| -/(_)\..conquistada. Conquiste a sua tamb?m use?? | > .| - ^^? ? ? ? ? ? ? ? ? G N U / L I N U X? ? ? ? ? ? ? ? ? ? ? ? ? | > +--------------------------------------------------------------------------+ > > > > 2012/2/21 John Stowers >> >> GTK is not threadsafe. >> >> If opencv shows a gtk mainwindow in cv.ShowImage, and that occurs in a >> different thread to the one running gtk_main, then unpredictable >> crashes and odd behaviour will result. >> >> Please check the pygtk FAQ for how to use threading and pygtk. >> >> I suggest displaying the image yourself in by getting the data from >> the IPL image and copying it into a GtkImage. Or be much more careful >> with which operations you do in which thread (i.e. cv.ShowImage, >> cv.WaitKey) >> >> John >> >> 2012/2/21 Joseph S. Alc?ntara : >> > Hi, Thank you for response to me. >> > >> > See, can I sand you my program to you see what I am making? I've used >> > Thread, but seems like is not working like I want. >> > >> > You must run from main.py >> > >> > Joseph Soares Alc?ntara >> > Engenharia da Computa??o - 8? semestre >> > Universidade Federal do Cear? - UFC >> > Sobral - Cear? >> > >> > >> > +--------------------------------------------------------------------------+ >> > .| - ?v?...A liberdade n?o pode ser comprada e sim? ?? | >> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use?? | >> > .| - ^^? ? ? ? ? ? ? ? ? G N U / L I N U X? ? ? ? ? ? ? ? ? ? ? ? ? | >> > >> > +--------------------------------------------------------------------------+ >> > >> > >> > >> > 2012/2/19 Hart's Antler >> >> >> >> Hi Joseph, >> >> I got GTK and OpenCV working together using threads. ?This example >> >> works >> >> with CPython2, CPython3 and PyPy, see my blog post. >> >> http://pyppet.blogspot.com/2011/12/rpythonic-044.html >> >> >> >> -brett- >> >> >> >> ________________________________ >> >> From: Joseph S. Alc?ntara >> >> To: pygtk at daa.com.au >> >> Sent: Sunday, February 19, 2012 9:46 AM >> >> Subject: [pygtk] PyGTK + OpenCV >> >> >> >> hi, I'm writing a application that uses pygtk and opencv. and I had a >> >> problem. When I run the program it shows a gui. So far so good. But, >> >> when? I >> >> click in a menuitem, it should call a functino that runs the famous >> >> routine >> >> to show a video from webcam. But in this moment, the app freezes. I >> >> have >> >> tried to use thread, but opencv gui runs just after I call >> >> gtk.main_quit(). >> >> What could solve my problem? Thanks. >> >> >> >> Estou escrevendo um programa em python, usando pygtk e opencv. Quando >> >> rodo >> >> o programa, aparece uma janela e at? a?, beleza. Mas quando eu clico em >> >> um >> >> menuitem, ele deve chamar uma fun??o que roda a famosa rotina que exibe >> >> um >> >> v?deo a partir da webcam. No entanto, neste momento, o programa trava. >> >> Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois que >> >> eu >> >> fecho a janela, chamando gtk.main_quit(). O que poderia ser? Obrigado >> >> desde >> >> j?. >> >> >> >> Joseph Soares Alc?ntara >> >> Engenharia da Computa??o - 8? semestre >> >> Universidade Federal do Cear? - UFC >> >> Sobral - Cear? >> >> >> >> >> >> >> >> +--------------------------------------------------------------------------+ >> >> .| - ?v?...A liberdade n?o pode ser comprada e sim? ?? | >> >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use?? | >> >> .| - ^^? ? ? ? ? ? ? ? ? G N U / L I N U X? ? ? ? ? ? ? ? ? ? ? ? ? | >> >> >> >> >> >> +--------------------------------------------------------------------------+ >> >> >> >> >> >> _______________________________________________ >> >> pygtk mailing list? pygtk at daa.com.au >> >> http://www.daa.com.au/mailman/listinfo/pygtk >> >> Read the PyGTK FAQ: http://faq.pygtk.org/ >> >> >> > >> > >> > _______________________________________________ >> > pygtk mailing list ? pygtk at daa.com.au >> > http://www.daa.com.au/mailman/listinfo/pygtk >> > Read the PyGTK FAQ: http://faq.pygtk.org/ > > From josephseraos at gmail.com Wed Feb 22 05:26:42 2012 From: josephseraos at gmail.com (=?ISO-8859-1?Q?Joseph_S=2E_Alc=E2ntara?=) Date: Tue, 21 Feb 2012 18:26:42 -0300 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Message-ID: I cannot access FAQ, I think it's not working now. Don't you have any example how could I solve that? Yes, I'd like to show image from cv.QueryFrame in a gtk.Image, But I am new in this, I'm learning a little slow. It's a project to the university. We have an Open Source Study Group, and I have to create a program using python + opencv + gtk. Thank you *Joseph Soares Alc?ntara* Engenharia da Computa??o - 8? semestre Universidade Federal do Cear? - UFC Sobral - Cear? +--------------------------------------------------------------------------+ .| - ?v?...A liberdade n?o pode ser comprada e sim | .| -/(_)\..conquistada. Conquiste a sua tamb?m use | .| - ^^ G N U / L I N U X | +--------------------------------------------------------------------------+ 2012/2/21 John Stowers > IIRC opecv starts a mainloop when create window is called. > > In general, don't use threads unless you have read the FAQ and > understand what you are doing. > > John > > 2012/2/21 Joseph S. Alc?ntara : > > Even if I don't use, ie, if I comment the lines where NamedWindow, > ShowImage > > and WaitKey appear it freezes too. > > > > Joseph Soares Alc?ntara > > Engenharia da Computa??o - 8? semestre > > Universidade Federal do Cear? - UFC > > Sobral - Cear? > > > > > +--------------------------------------------------------------------------+ > > .| - ?v?...A liberdade n?o pode ser comprada e sim | > > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > > .| - ^^ G N U / L I N U X | > > > +--------------------------------------------------------------------------+ > > > > > > > > 2012/2/21 John Stowers > >> > >> GTK is not threadsafe. > >> > >> If opencv shows a gtk mainwindow in cv.ShowImage, and that occurs in a > >> different thread to the one running gtk_main, then unpredictable > >> crashes and odd behaviour will result. > >> > >> Please check the pygtk FAQ for how to use threading and pygtk. > >> > >> I suggest displaying the image yourself in by getting the data from > >> the IPL image and copying it into a GtkImage. Or be much more careful > >> with which operations you do in which thread (i.e. cv.ShowImage, > >> cv.WaitKey) > >> > >> John > >> > >> 2012/2/21 Joseph S. Alc?ntara : > >> > Hi, Thank you for response to me. > >> > > >> > See, can I sand you my program to you see what I am making? I've used > >> > Thread, but seems like is not working like I want. > >> > > >> > You must run from main.py > >> > > >> > Joseph Soares Alc?ntara > >> > Engenharia da Computa??o - 8? semestre > >> > Universidade Federal do Cear? - UFC > >> > Sobral - Cear? > >> > > >> > > >> > > +--------------------------------------------------------------------------+ > >> > .| - ?v?...A liberdade n?o pode ser comprada e sim | > >> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > >> > .| - ^^ G N U / L I N U X | > >> > > >> > > +--------------------------------------------------------------------------+ > >> > > >> > > >> > > >> > 2012/2/19 Hart's Antler > >> >> > >> >> Hi Joseph, > >> >> I got GTK and OpenCV working together using threads. This example > >> >> works > >> >> with CPython2, CPython3 and PyPy, see my blog post. > >> >> http://pyppet.blogspot.com/2011/12/rpythonic-044.html > >> >> > >> >> -brett- > >> >> > >> >> ________________________________ > >> >> From: Joseph S. Alc?ntara > >> >> To: pygtk at daa.com.au > >> >> Sent: Sunday, February 19, 2012 9:46 AM > >> >> Subject: [pygtk] PyGTK + OpenCV > >> >> > >> >> hi, I'm writing a application that uses pygtk and opencv. and I had a > >> >> problem. When I run the program it shows a gui. So far so good. But, > >> >> when I > >> >> click in a menuitem, it should call a functino that runs the famous > >> >> routine > >> >> to show a video from webcam. But in this moment, the app freezes. I > >> >> have > >> >> tried to use thread, but opencv gui runs just after I call > >> >> gtk.main_quit(). > >> >> What could solve my problem? Thanks. > >> >> > >> >> Estou escrevendo um programa em python, usando pygtk e opencv. Quando > >> >> rodo > >> >> o programa, aparece uma janela e at? a?, beleza. Mas quando eu clico > em > >> >> um > >> >> menuitem, ele deve chamar uma fun??o que roda a famosa rotina que > exibe > >> >> um > >> >> v?deo a partir da webcam. No entanto, neste momento, o programa > trava. > >> >> Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois > que > >> >> eu > >> >> fecho a janela, chamando gtk.main_quit(). O que poderia ser? Obrigado > >> >> desde > >> >> j?. > >> >> > >> >> Joseph Soares Alc?ntara > >> >> Engenharia da Computa??o - 8? semestre > >> >> Universidade Federal do Cear? - UFC > >> >> Sobral - Cear? > >> >> > >> >> > >> >> > >> >> > +--------------------------------------------------------------------------+ > >> >> .| - ?v?...A liberdade n?o pode ser comprada e sim | > >> >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > >> >> .| - ^^ G N U / L I N U X | > >> >> > >> >> > >> >> > +--------------------------------------------------------------------------+ > >> >> > >> >> > >> >> _______________________________________________ > >> >> pygtk mailing list pygtk at daa.com.au > >> >> http://www.daa.com.au/mailman/listinfo/pygtk > >> >> Read the PyGTK FAQ: http://faq.pygtk.org/ > >> >> > >> > > >> > > >> > _______________________________________________ > >> > pygtk mailing list pygtk at daa.com.au > >> > http://www.daa.com.au/mailman/listinfo/pygtk > >> > Read the PyGTK FAQ: http://faq.pygtk.org/ > > > > > -------------- Pr?xima Parte ---------- Um anexo em HTML foi limpo... URL: From giuspen at gmail.com Wed Feb 22 07:00:48 2012 From: giuspen at gmail.com (Giuseppe Penone) Date: Wed, 22 Feb 2012 00:00:48 +0100 Subject: [pygtk] pygtk i18n problem with windows and glade sentences In-Reply-To: References: Message-ID: Thank you very much. what solved my problem on windows os is (from your code): from ctypes import cdll libintl = cdll.intl libintl.bindtextdomain(domain, localedir) Best regards, Giuseppe. On Mon, Feb 20, 2012 at 09:21, Dieter Verfaillie wrote: > On Mon, 20 Feb 2012 00:08:13 +0100, Giuseppe Penone wrote: > >> does anybody know if there's a way to have glade sentences translated >> on windows? >> > > Yep, I've pointed out a possible solution here: > https://bugzilla.gnome.org/**show_bug.cgi?id=574520#c36 > > mvg, > Dieter > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From josephseraos at gmail.com Wed Feb 22 07:44:07 2012 From: josephseraos at gmail.com (=?ISO-8859-1?Q?Joseph_S=2E_Alc=E2ntara?=) Date: Tue, 21 Feb 2012 20:44:07 -0300 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Message-ID: How do I show a IplImage in a gtk.Image? *Joseph Soares Alc?ntara* Engenharia da Computa??o - 8? semestre Universidade Federal do Cear? - UFC Sobral - Cear? +--------------------------------------------------------------------------+ .| - ?v?...A liberdade n?o pode ser comprada e sim | .| -/(_)\..conquistada. Conquiste a sua tamb?m use | .| - ^^ G N U / L I N U X | +--------------------------------------------------------------------------+ 2012/2/21 Joseph S. Alc?ntara > I cannot access FAQ, I think it's not working now. > Don't you have any example how could I solve that? > Yes, I'd like to show image from cv.QueryFrame in a gtk.Image, But I am > new in this, I'm learning a little slow. > It's a project to the university. We have an Open Source Study Group, and > I have to create a program using python + opencv + gtk. > > Thank you > > *Joseph Soares Alc?ntara* > Engenharia da Computa??o - 8? semestre > Universidade Federal do Cear? - UFC > Sobral - Cear? > > > +--------------------------------------------------------------------------+ > .| - ?v?...A liberdade n?o pode ser comprada e sim | > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > .| - ^^ G N U / L I N U X | > > +--------------------------------------------------------------------------+ > > > > 2012/2/21 John Stowers > >> IIRC opecv starts a mainloop when create window is called. >> >> In general, don't use threads unless you have read the FAQ and >> understand what you are doing. >> >> John >> >> 2012/2/21 Joseph S. Alc?ntara : >> > Even if I don't use, ie, if I comment the lines where NamedWindow, >> ShowImage >> > and WaitKey appear it freezes too. >> > >> > Joseph Soares Alc?ntara >> > Engenharia da Computa??o - 8? semestre >> > Universidade Federal do Cear? - UFC >> > Sobral - Cear? >> > >> > >> +--------------------------------------------------------------------------+ >> > .| - ?v?...A liberdade n?o pode ser comprada e sim | >> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> > .| - ^^ G N U / L I N U X | >> > >> +--------------------------------------------------------------------------+ >> > >> > >> > >> > 2012/2/21 John Stowers >> >> >> >> GTK is not threadsafe. >> >> >> >> If opencv shows a gtk mainwindow in cv.ShowImage, and that occurs in a >> >> different thread to the one running gtk_main, then unpredictable >> >> crashes and odd behaviour will result. >> >> >> >> Please check the pygtk FAQ for how to use threading and pygtk. >> >> >> >> I suggest displaying the image yourself in by getting the data from >> >> the IPL image and copying it into a GtkImage. Or be much more careful >> >> with which operations you do in which thread (i.e. cv.ShowImage, >> >> cv.WaitKey) >> >> >> >> John >> >> >> >> 2012/2/21 Joseph S. Alc?ntara : >> >> > Hi, Thank you for response to me. >> >> > >> >> > See, can I sand you my program to you see what I am making? I've used >> >> > Thread, but seems like is not working like I want. >> >> > >> >> > You must run from main.py >> >> > >> >> > Joseph Soares Alc?ntara >> >> > Engenharia da Computa??o - 8? semestre >> >> > Universidade Federal do Cear? - UFC >> >> > Sobral - Cear? >> >> > >> >> > >> >> > >> +--------------------------------------------------------------------------+ >> >> > .| - ?v?...A liberdade n?o pode ser comprada e sim | >> >> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> >> > .| - ^^ G N U / L I N U X | >> >> > >> >> > >> +--------------------------------------------------------------------------+ >> >> > >> >> > >> >> > >> >> > 2012/2/19 Hart's Antler >> >> >> >> >> >> Hi Joseph, >> >> >> I got GTK and OpenCV working together using threads. This example >> >> >> works >> >> >> with CPython2, CPython3 and PyPy, see my blog post. >> >> >> http://pyppet.blogspot.com/2011/12/rpythonic-044.html >> >> >> >> >> >> -brett- >> >> >> >> >> >> ________________________________ >> >> >> From: Joseph S. Alc?ntara >> >> >> To: pygtk at daa.com.au >> >> >> Sent: Sunday, February 19, 2012 9:46 AM >> >> >> Subject: [pygtk] PyGTK + OpenCV >> >> >> >> >> >> hi, I'm writing a application that uses pygtk and opencv. and I had >> a >> >> >> problem. When I run the program it shows a gui. So far so good. But, >> >> >> when I >> >> >> click in a menuitem, it should call a functino that runs the famous >> >> >> routine >> >> >> to show a video from webcam. But in this moment, the app freezes. I >> >> >> have >> >> >> tried to use thread, but opencv gui runs just after I call >> >> >> gtk.main_quit(). >> >> >> What could solve my problem? Thanks. >> >> >> >> >> >> Estou escrevendo um programa em python, usando pygtk e opencv. >> Quando >> >> >> rodo >> >> >> o programa, aparece uma janela e at? a?, beleza. Mas quando eu >> clico em >> >> >> um >> >> >> menuitem, ele deve chamar uma fun??o que roda a famosa rotina que >> exibe >> >> >> um >> >> >> v?deo a partir da webcam. No entanto, neste momento, o programa >> trava. >> >> >> Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois >> que >> >> >> eu >> >> >> fecho a janela, chamando gtk.main_quit(). O que poderia ser? >> Obrigado >> >> >> desde >> >> >> j?. >> >> >> >> >> >> Joseph Soares Alc?ntara >> >> >> Engenharia da Computa??o - 8? semestre >> >> >> Universidade Federal do Cear? - UFC >> >> >> Sobral - Cear? >> >> >> >> >> >> >> >> >> >> >> >> >> +--------------------------------------------------------------------------+ >> >> >> .| - ?v?...A liberdade n?o pode ser comprada e sim | >> >> >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> >> >> .| - ^^ G N U / L I N U X >> | >> >> >> >> >> >> >> >> >> >> +--------------------------------------------------------------------------+ >> >> >> >> >> >> >> >> >> _______________________________________________ >> >> >> pygtk mailing list pygtk at daa.com.au >> >> >> http://www.daa.com.au/mailman/listinfo/pygtk >> >> >> Read the PyGTK FAQ: http://faq.pygtk.org/ >> >> >> >> >> > >> >> > >> >> > _______________________________________________ >> >> > pygtk mailing list pygtk at daa.com.au >> >> > http://www.daa.com.au/mailman/listinfo/pygtk >> >> > Read the PyGTK FAQ: http://faq.pygtk.org/ >> > >> > >> > > -------------- Pr?xima Parte ---------- Um anexo em HTML foi limpo... URL: From josephseraos at gmail.com Wed Feb 22 19:19:03 2012 From: josephseraos at gmail.com (=?ISO-8859-1?Q?Joseph_S=2E_Alc=E2ntara?=) Date: Wed, 22 Feb 2012 08:19:03 -0300 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Message-ID: Hi, now I get access to FAQ PyGTK talking about threads. It seems a little complicated, and I didn't get it to work yet. Like there teaches, I put at the begin, before anything be called, gtk.threads_init() (that my python says it's deprecated and suggest me to use gtk.gdk.threads_init, as well as threads_enter/leave) So, I put gtk.main() between thrads_enter/leave and every part of code I want to be a thread, I put into this code (enter/leave) but it continue working the same. ie, it's now working. I'm did something like this, into a class: gtk.gdk.threads_enter self.th = Thread(target=self.camera.runvideo) self.th.start() gtk.gdk.threads_leave It's a class that calls a gtk.Window. After, in self.camera.runvideo, it calls famous routine to show images from webcam *Joseph Soares Alc?ntara* Engenharia da Computa??o - 8? semestre Universidade Federal do Cear? - UFC Sobral - Cear? +--------------------------------------------------------------------------+ .| - ?v?...A liberdade n?o pode ser comprada e sim | .| -/(_)\..conquistada. Conquiste a sua tamb?m use | .| - ^^ G N U / L I N U X | +--------------------------------------------------------------------------+ 2012/2/21 Joseph S. Alc?ntara > How do I show a IplImage in a gtk.Image? > > *Joseph Soares Alc?ntara* > Engenharia da Computa??o - 8? semestre > Universidade Federal do Cear? - UFC > Sobral - Cear? > > > +--------------------------------------------------------------------------+ > .| - ?v?...A liberdade n?o pode ser comprada e sim | > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > .| - ^^ G N U / L I N U X | > > +--------------------------------------------------------------------------+ > > > > 2012/2/21 Joseph S. Alc?ntara > > I cannot access FAQ, I think it's not working now. >> Don't you have any example how could I solve that? >> Yes, I'd like to show image from cv.QueryFrame in a gtk.Image, But I am >> new in this, I'm learning a little slow. >> It's a project to the university. We have an Open Source Study Group, and >> I have to create a program using python + opencv + gtk. >> >> Thank you >> >> *Joseph Soares Alc?ntara* >> Engenharia da Computa??o - 8? semestre >> Universidade Federal do Cear? - UFC >> Sobral - Cear? >> >> >> +--------------------------------------------------------------------------+ >> .| - ?v?...A liberdade n?o pode ser comprada e sim | >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> .| - ^^ G N U / L I N U X | >> >> +--------------------------------------------------------------------------+ >> >> >> >> 2012/2/21 John Stowers >> >>> IIRC opecv starts a mainloop when create window is called. >>> >>> In general, don't use threads unless you have read the FAQ and >>> understand what you are doing. >>> >>> John >>> >>> 2012/2/21 Joseph S. Alc?ntara : >>> > Even if I don't use, ie, if I comment the lines where NamedWindow, >>> ShowImage >>> > and WaitKey appear it freezes too. >>> > >>> > Joseph Soares Alc?ntara >>> > Engenharia da Computa??o - 8? semestre >>> > Universidade Federal do Cear? - UFC >>> > Sobral - Cear? >>> > >>> > >>> +--------------------------------------------------------------------------+ >>> > .| - ?v?...A liberdade n?o pode ser comprada e sim | >>> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >>> > .| - ^^ G N U / L I N U X | >>> > >>> +--------------------------------------------------------------------------+ >>> > >>> > >>> > >>> > 2012/2/21 John Stowers >>> >> >>> >> GTK is not threadsafe. >>> >> >>> >> If opencv shows a gtk mainwindow in cv.ShowImage, and that occurs in a >>> >> different thread to the one running gtk_main, then unpredictable >>> >> crashes and odd behaviour will result. >>> >> >>> >> Please check the pygtk FAQ for how to use threading and pygtk. >>> >> >>> >> I suggest displaying the image yourself in by getting the data from >>> >> the IPL image and copying it into a GtkImage. Or be much more careful >>> >> with which operations you do in which thread (i.e. cv.ShowImage, >>> >> cv.WaitKey) >>> >> >>> >> John >>> >> >>> >> 2012/2/21 Joseph S. Alc?ntara : >>> >> > Hi, Thank you for response to me. >>> >> > >>> >> > See, can I sand you my program to you see what I am making? I've >>> used >>> >> > Thread, but seems like is not working like I want. >>> >> > >>> >> > You must run from main.py >>> >> > >>> >> > Joseph Soares Alc?ntara >>> >> > Engenharia da Computa??o - 8? semestre >>> >> > Universidade Federal do Cear? - UFC >>> >> > Sobral - Cear? >>> >> > >>> >> > >>> >> > >>> +--------------------------------------------------------------------------+ >>> >> > .| - ?v?...A liberdade n?o pode ser comprada e sim | >>> >> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >>> >> > .| - ^^ G N U / L I N U X >>> | >>> >> > >>> >> > >>> +--------------------------------------------------------------------------+ >>> >> > >>> >> > >>> >> > >>> >> > 2012/2/19 Hart's Antler >>> >> >> >>> >> >> Hi Joseph, >>> >> >> I got GTK and OpenCV working together using threads. This example >>> >> >> works >>> >> >> with CPython2, CPython3 and PyPy, see my blog post. >>> >> >> http://pyppet.blogspot.com/2011/12/rpythonic-044.html >>> >> >> >>> >> >> -brett- >>> >> >> >>> >> >> ________________________________ >>> >> >> From: Joseph S. Alc?ntara >>> >> >> To: pygtk at daa.com.au >>> >> >> Sent: Sunday, February 19, 2012 9:46 AM >>> >> >> Subject: [pygtk] PyGTK + OpenCV >>> >> >> >>> >> >> hi, I'm writing a application that uses pygtk and opencv. and I >>> had a >>> >> >> problem. When I run the program it shows a gui. So far so good. >>> But, >>> >> >> when I >>> >> >> click in a menuitem, it should call a functino that runs the famous >>> >> >> routine >>> >> >> to show a video from webcam. But in this moment, the app freezes. I >>> >> >> have >>> >> >> tried to use thread, but opencv gui runs just after I call >>> >> >> gtk.main_quit(). >>> >> >> What could solve my problem? Thanks. >>> >> >> >>> >> >> Estou escrevendo um programa em python, usando pygtk e opencv. >>> Quando >>> >> >> rodo >>> >> >> o programa, aparece uma janela e at? a?, beleza. Mas quando eu >>> clico em >>> >> >> um >>> >> >> menuitem, ele deve chamar uma fun??o que roda a famosa rotina que >>> exibe >>> >> >> um >>> >> >> v?deo a partir da webcam. No entanto, neste momento, o programa >>> trava. >>> >> >> Ent?o, eu tentei usar Thread, mas a parte do opencv s? roda depois >>> que >>> >> >> eu >>> >> >> fecho a janela, chamando gtk.main_quit(). O que poderia ser? >>> Obrigado >>> >> >> desde >>> >> >> j?. >>> >> >> >>> >> >> Joseph Soares Alc?ntara >>> >> >> Engenharia da Computa??o - 8? semestre >>> >> >> Universidade Federal do Cear? - UFC >>> >> >> Sobral - Cear? >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> +--------------------------------------------------------------------------+ >>> >> >> .| - ?v?...A liberdade n?o pode ser comprada e sim | >>> >> >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >>> >> >> .| - ^^ G N U / L I N U X >>> | >>> >> >> >>> >> >> >>> >> >> >>> +--------------------------------------------------------------------------+ >>> >> >> >>> >> >> >>> >> >> _______________________________________________ >>> >> >> pygtk mailing list pygtk at daa.com.au >>> >> >> http://www.daa.com.au/mailman/listinfo/pygtk >>> >> >> Read the PyGTK FAQ: http://faq.pygtk.org/ >>> >> >> >>> >> > >>> >> > >>> >> > _______________________________________________ >>> >> > pygtk mailing list pygtk at daa.com.au >>> >> > http://www.daa.com.au/mailman/listinfo/pygtk >>> >> > Read the PyGTK FAQ: http://faq.pygtk.org/ >>> > >>> > >>> >> >> > -------------- Pr?xima Parte ---------- Um anexo em HTML foi limpo... URL: From timomlists at gmail.com Thu Feb 23 01:16:19 2012 From: timomlists at gmail.com (Timo) Date: Wed, 22 Feb 2012 18:16:19 +0100 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> Message-ID: <4F4522E3.1080206@gmail.com> Op 22-02-12 12:19, Joseph S. Alc?ntara schreef: > Hi, now I get access to FAQ PyGTK talking about threads. It seems a > little complicated, and I didn't get it to work yet. > Like there teaches, I put at the begin, before anything be called, > gtk.threads_init() (that my python says it's deprecated and suggest me > to use gtk.gdk.threads_init, as well as threads_enter/leave) > > So, I put gtk.main() between thrads_enter/leave and every part of code > I want to be a thread, I put into this code (enter/leave) but it > continue working the same. ie, it's now working. > > I'm did something like this, into a class: > > gtk.gdk.threads_enter > self.th = Thread(target=self.camera.runvideo) > self.th.start() > gtk.gdk.threads_leave > > It's a class that calls a gtk.Window. After, in self.camera.runvideo, > it calls famous routine to show images from webcam > I think it's also in the FAQ, but you shouldn't do any GUI stuff in a thread, and if you do so, call it with gobject.idle_add(). Cheers, Timo > *Joseph Soares Alc?ntara* > Engenharia da Computa??o - 8? semestre > Universidade Federal do Cear? - UFC > Sobral - Cear? > > +--------------------------------------------------------------------------+ > .| - ?v?...A liberdade n?o pode ser comprada e sim | > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > .| - ^^ G N U / L I N U X | > +--------------------------------------------------------------------------+ > > > > 2012/2/21 Joseph S. Alc?ntara > > > How do I show a IplImage in a gtk.Image? > > *Joseph Soares Alc?ntara* > Engenharia da Computa??o - 8? semestre > Universidade Federal do Cear? - UFC > Sobral - Cear? > > +--------------------------------------------------------------------------+ > .| - ?v?...A liberdade n?o pode ser comprada e sim | > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > .| - ^^ G N U / L I N U X | > +--------------------------------------------------------------------------+ > > > > 2012/2/21 Joseph S. Alc?ntara > > > I cannot access FAQ, I think it's not working now. > Don't you have any example how could I solve that? > Yes, I'd like to show image from cv.QueryFrame in a gtk.Image, > But I am new in this, I'm learning a little slow. > It's a project to the university. We have an Open Source Study > Group, and I have to create a program using python + opencv + gtk. > > Thank you > > *Joseph Soares Alc?ntara* > Engenharia da Computa??o - 8? semestre > Universidade Federal do Cear? - UFC > Sobral - Cear? > > +--------------------------------------------------------------------------+ > .| - ?v?...A liberdade n?o pode ser comprada e sim | > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > .| - ^^ G N U / L I N U X > | > +--------------------------------------------------------------------------+ > > > > 2012/2/21 John Stowers > > > IIRC opecv starts a mainloop when create window is called. > > In general, don't use threads unless you have read the FAQ and > understand what you are doing. > > John > > 2012/2/21 Joseph S. Alc?ntara >: > > Even if I don't use, ie, if I comment the lines where > NamedWindow, ShowImage > > and WaitKey appear it freezes too. > > > > Joseph Soares Alc?ntara > > Engenharia da Computa??o - 8? semestre > > Universidade Federal do Cear? - UFC > > Sobral - Cear? > > > > > +--------------------------------------------------------------------------+ > > .| - ?v?...A liberdade n?o pode ser comprada e sim | > > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > > .| - ^^ G N U / L I N U X > | > > > +--------------------------------------------------------------------------+ > > > > > > > > 2012/2/21 John Stowers > > >> > >> GTK is not threadsafe. > >> > >> If opencv shows a gtk mainwindow in cv.ShowImage, and > that occurs in a > >> different thread to the one running gtk_main, then > unpredictable > >> crashes and odd behaviour will result. > >> > >> Please check the pygtk FAQ for how to use threading and > pygtk. > >> > >> I suggest displaying the image yourself in by getting > the data from > >> the IPL image and copying it into a GtkImage. Or be > much more careful > >> with which operations you do in which thread (i.e. > cv.ShowImage, > >> cv.WaitKey) > >> > >> John > >> > >> 2012/2/21 Joseph S. Alc?ntara >: > >> > Hi, Thank you for response to me. > >> > > >> > See, can I sand you my program to you see what I am > making? I've used > >> > Thread, but seems like is not working like I want. > >> > > >> > You must run from main.py > >> > > >> > Joseph Soares Alc?ntara > >> > Engenharia da Computa??o - 8? semestre > >> > Universidade Federal do Cear? - UFC > >> > Sobral - Cear? > >> > > >> > > >> > > +--------------------------------------------------------------------------+ > >> > .| - ?v?...A liberdade n?o pode ser comprada e sim | > >> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > >> > .| - ^^ G N U / L I N U X > | > >> > > >> > > +--------------------------------------------------------------------------+ > >> > > >> > > >> > > >> > 2012/2/19 Hart's Antler > > >> >> > >> >> Hi Joseph, > >> >> I got GTK and OpenCV working together using threads. > This example > >> >> works > >> >> with CPython2, CPython3 and PyPy, see my blog post. > >> >> http://pyppet.blogspot.com/2011/12/rpythonic-044.html > >> >> > >> >> -brett- > >> >> > >> >> ________________________________ > >> >> From: Joseph S. Alc?ntara > > >> >> To: pygtk at daa.com.au > >> >> Sent: Sunday, February 19, 2012 9:46 AM > >> >> Subject: [pygtk] PyGTK + OpenCV > >> >> > >> >> hi, I'm writing a application that uses pygtk and > opencv. and I had a > >> >> problem. When I run the program it shows a gui. So > far so good. But, > >> >> when I > >> >> click in a menuitem, it should call a functino that > runs the famous > >> >> routine > >> >> to show a video from webcam. But in this moment, the > app freezes. I > >> >> have > >> >> tried to use thread, but opencv gui runs just after > I call > >> >> gtk.main_quit(). > >> >> What could solve my problem? Thanks. > >> >> > >> >> Estou escrevendo um programa em python, usando pygtk > e opencv. Quando > >> >> rodo > >> >> o programa, aparece uma janela e at? a?, beleza. Mas > quando eu clico em > >> >> um > >> >> menuitem, ele deve chamar uma fun??o que roda a > famosa rotina que exibe > >> >> um > >> >> v?deo a partir da webcam. No entanto, neste momento, > o programa trava. > >> >> Ent?o, eu tentei usar Thread, mas a parte do opencv > s? roda depois que > >> >> eu > >> >> fecho a janela, chamando gtk.main_quit(). O que > poderia ser? Obrigado > >> >> desde > >> >> j?. > >> >> > >> >> Joseph Soares Alc?ntara > >> >> Engenharia da Computa??o - 8? semestre > >> >> Universidade Federal do Cear? - UFC > >> >> Sobral - Cear? > >> >> > >> >> > >> >> > >> >> > +--------------------------------------------------------------------------+ > >> >> .| - ?v?...A liberdade n?o pode ser comprada e sim | > >> >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | > >> >> .| - ^^ G N U / L I N U X > | > >> >> > >> >> > >> >> > +--------------------------------------------------------------------------+ > >> >> > >> >> > >> >> _______________________________________________ > >> >> pygtk mailing list pygtk at daa.com.au > > >> >> http://www.daa.com.au/mailman/listinfo/pygtk > >> >> Read the PyGTK FAQ: http://faq.pygtk.org/ > >> >> > >> > > >> > > >> > _______________________________________________ > >> > pygtk mailing list pygtk at daa.com.au > > >> > http://www.daa.com.au/mailman/listinfo/pygtk > >> > Read the PyGTK FAQ: http://faq.pygtk.org/ > > > > > > > > > > > _______________________________________________ > pygtk mailing list pygtk at daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ From josephseraos at gmail.com Sat Feb 25 03:26:21 2012 From: josephseraos at gmail.com (=?ISO-8859-1?Q?Joseph_S=2E_Alc=E2ntara?=) Date: Fri, 24 Feb 2012 16:26:21 -0300 Subject: [pygtk] PyGTK + OpenCV In-Reply-To: <4F4522E3.1080206@gmail.com> References: <1329706662.92475.YahooMailNeo@web114009.mail.gq1.yahoo.com> <4F4522E3.1080206@gmail.com> Message-ID: Where do I have put gobject.idle_add? See the program: http://paste.debian.net/157481/ *Joseph Soares Alc?ntara* Engenharia da Computa??o - 8? semestre Universidade Federal do Cear? - UFC Sobral - Cear? +--------------------------------------------------------------------------+ .| - ?v?...A liberdade n?o pode ser comprada e sim | .| -/(_)\..conquistada. Conquiste a sua tamb?m use | .| - ^^ G N U / L I N U X | +--------------------------------------------------------------------------+ 2012/2/22 Timo > Op 22-02-12 12:19, Joseph S. Alc?ntara schreef: > >> Hi, now I get access to FAQ PyGTK talking about threads. It seems a >> little complicated, and I didn't get it to work yet. >> Like there teaches, I put at the begin, before anything be called, >> gtk.threads_init() (that my python says it's deprecated and suggest me to >> use gtk.gdk.threads_init, as well as threads_enter/leave) >> >> So, I put gtk.main() between thrads_enter/leave and every part of code I >> want to be a thread, I put into this code (enter/leave) but it continue >> working the same. ie, it's now working. >> >> I'm did something like this, into a class: >> >> gtk.gdk.threads_enter >> self.th = Thread(target=self.camera.**runvideo) >> >> self.th.start() >> gtk.gdk.threads_leave >> >> It's a class that calls a gtk.Window. After, in self.camera.runvideo, it >> calls famous routine to show images from webcam >> >> I think it's also in the FAQ, but you shouldn't do any GUI stuff in a > thread, and if you do so, call it with gobject.idle_add(). > > Cheers, > Timo > > *Joseph Soares Alc?ntara* >> >> Engenharia da Computa??o - 8? semestre >> Universidade Federal do Cear? - UFC >> Sobral - Cear? >> >> +-----------------------------**------------------------------** >> ---------------+ >> .| - ?v?...A liberdade n?o pode ser comprada e sim | >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> .| - ^^ G N U / L I N U X | >> +-----------------------------**------------------------------** >> ---------------+ >> >> >> >> 2012/2/21 Joseph S. Alc?ntara > josephseraos at gmail.com**>> >> >> >> How do I show a IplImage in a gtk.Image? >> >> *Joseph Soares Alc?ntara* >> >> Engenharia da Computa??o - 8? semestre >> Universidade Federal do Cear? - UFC >> Sobral - Cear? >> >> +-----------------------------**------------------------------** >> ---------------+ >> .| - ?v?...A liberdade n?o pode ser comprada e sim | >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> .| - ^^ G N U / L I N U X | >> +-----------------------------**------------------------------** >> ---------------+ >> >> >> >> 2012/2/21 Joseph S. Alc?ntara > > >> >> >> I cannot access FAQ, I think it's not working now. >> Don't you have any example how could I solve that? >> Yes, I'd like to show image from cv.QueryFrame in a gtk.Image, >> But I am new in this, I'm learning a little slow. >> It's a project to the university. We have an Open Source Study >> Group, and I have to create a program using python + opencv + gtk. >> >> Thank you >> >> *Joseph Soares Alc?ntara* >> >> Engenharia da Computa??o - 8? semestre >> Universidade Federal do Cear? - UFC >> Sobral - Cear? >> >> +-----------------------------**------------------------------** >> ---------------+ >> .| - ?v?...A liberdade n?o pode ser comprada e sim | >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> .| - ^^ G N U / L I N U X >> | >> +-----------------------------**------------------------------** >> ---------------+ >> >> >> >> 2012/2/21 John Stowers > >> >> >> >> >> IIRC opecv starts a mainloop when create window is called. >> >> In general, don't use threads unless you have read the FAQ and >> understand what you are doing. >> >> John >> >> 2012/2/21 Joseph S. Alc?ntara > >: >> >> > Even if I don't use, ie, if I comment the lines where >> NamedWindow, ShowImage >> > and WaitKey appear it freezes too. >> > >> > Joseph Soares Alc?ntara >> > Engenharia da Computa??o - 8? semestre >> > Universidade Federal do Cear? - UFC >> > Sobral - Cear? >> > >> > >> +-----------------------------**------------------------------ >> **---------------+ >> > .| - ?v?...A liberdade n?o pode ser comprada e sim | >> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> > .| - ^^ G N U / L I N U X >> | >> > >> +-----------------------------**------------------------------ >> **---------------+ >> > >> > >> > >> > 2012/2/21 John Stowers > >> >> >> >> >> >> >> GTK is not threadsafe. >> >> >> >> If opencv shows a gtk mainwindow in cv.ShowImage, and >> that occurs in a >> >> different thread to the one running gtk_main, then >> unpredictable >> >> crashes and odd behaviour will result. >> >> >> >> Please check the pygtk FAQ for how to use threading and >> pygtk. >> >> >> >> I suggest displaying the image yourself in by getting >> the data from >> >> the IPL image and copying it into a GtkImage. Or be >> much more careful >> >> with which operations you do in which thread (i.e. >> cv.ShowImage, >> >> cv.WaitKey) >> >> >> >> John >> >> >> >> 2012/2/21 Joseph S. Alc?ntara > >: >> >> >> > Hi, Thank you for response to me. >> >> > >> >> > See, can I sand you my program to you see what I am >> making? I've used >> >> > Thread, but seems like is not working like I want. >> >> > >> >> > You must run from main.py >> >> > >> >> > Joseph Soares Alc?ntara >> >> > Engenharia da Computa??o - 8? semestre >> >> > Universidade Federal do Cear? - UFC >> >> > Sobral - Cear? >> >> > >> >> > >> >> > >> +-----------------------------**------------------------------ >> **---------------+ >> >> > .| - ?v?...A liberdade n?o pode ser comprada e sim | >> >> > .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> >> > .| - ^^ G N U / L I N U X >> | >> >> > >> >> > >> +-----------------------------**------------------------------ >> **---------------+ >> >> > >> >> > >> >> > >> >> > 2012/2/19 Hart's Antler > > >> >> >> >> >> >> >> Hi Joseph, >> >> >> I got GTK and OpenCV working together using threads. >> This example >> >> >> works >> >> >> with CPython2, CPython3 and PyPy, see my blog post. >> >> >> http://pyppet.blogspot.com/**2011/12/rpythonic-044.html >> >> >> >> >> >> -brett- >> >> >> >> >> >> ______________________________**__ >> >> >> From: Joseph S. Alc?ntara > > >> >> >> To: pygtk at daa.com.au >> >> >> >> Sent: Sunday, February 19, 2012 9:46 AM >> >> >> Subject: [pygtk] PyGTK + OpenCV >> >> >> >> >> >> hi, I'm writing a application that uses pygtk and >> opencv. and I had a >> >> >> problem. When I run the program it shows a gui. So >> far so good. But, >> >> >> when I >> >> >> click in a menuitem, it should call a functino that >> runs the famous >> >> >> routine >> >> >> to show a video from webcam. But in this moment, the >> app freezes. I >> >> >> have >> >> >> tried to use thread, but opencv gui runs just after >> I call >> >> >> gtk.main_quit(). >> >> >> What could solve my problem? Thanks. >> >> >> >> >> >> Estou escrevendo um programa em python, usando pygtk >> e opencv. Quando >> >> >> rodo >> >> >> o programa, aparece uma janela e at? a?, beleza. Mas >> quando eu clico em >> >> >> um >> >> >> menuitem, ele deve chamar uma fun??o que roda a >> famosa rotina que exibe >> >> >> um >> >> >> v?deo a partir da webcam. No entanto, neste momento, >> o programa trava. >> >> >> Ent?o, eu tentei usar Thread, mas a parte do opencv >> s? roda depois que >> >> >> eu >> >> >> fecho a janela, chamando gtk.main_quit(). O que >> poderia ser? Obrigado >> >> >> desde >> >> >> j?. >> >> >> >> >> >> Joseph Soares Alc?ntara >> >> >> Engenharia da Computa??o - 8? semestre >> >> >> Universidade Federal do Cear? - UFC >> >> >> Sobral - Cear? >> >> >> >> >> >> >> >> >> >> >> >> >> +-----------------------------**------------------------------ >> **---------------+ >> >> >> .| - ?v?...A liberdade n?o pode ser comprada e sim | >> >> >> .| -/(_)\..conquistada. Conquiste a sua tamb?m use | >> >> >> .| - ^^ G N U / L I N U X >> | >> >> >> >> >> >> >> >> >> >> +-----------------------------**------------------------------ >> **---------------+ >> >> >> >> >> >> >> >> >> ______________________________**_________________ >> >> >> pygtk mailing list pygtk at daa.com.au >> >> >> >> >> http://www.daa.com.au/mailman/**listinfo/pygtk >> >> >> Read the PyGTK FAQ: http://faq.pygtk.org/ >> >> >> >> >> > >> >> > >> >> > ______________________________**_________________ >> >> > pygtk mailing list pygtk at daa.com.au >> >> >> >> > http://www.daa.com.au/mailman/**listinfo/pygtk >> >> > Read the PyGTK FAQ: http://faq.pygtk.org/ >> > >> > >> >> >> >> >> >> >> ______________________________**_________________ >> pygtk mailing list pygtk at daa.com.au >> http://www.daa.com.au/mailman/**listinfo/pygtk >> Read the PyGTK FAQ: http://faq.pygtk.org/ >> > > ______________________________**_________________ > pygtk mailing list pygtk at daa.com.au > http://www.daa.com.au/mailman/**listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ > -------------- Pr?xima Parte ---------- Um anexo em HTML foi limpo... URL: From otsaloma at iki.fi Sun Feb 26 09:51:25 2012 From: otsaloma at iki.fi (Osmo Salomaa) Date: Sun, 26 Feb 2012 03:51:25 +0200 Subject: [pygtk] Painting in text view margin and the "draw" signal Message-ID: <4F49901D.2030009@iki.fi> Hi, With Gtk2 and the old static bindings I made use of the text view right margin by painting a pango layout there. Now I'm trying to port my code to Gtk3 and the introspection bindings. Documentation [1] tells me that I should be using the "draw" signal instead of "expose-event", but my callback for the "draw" signal doesn't even seem to get called. Is there some significant difference between these two signals? Anyone yet ported similar code? Below is my non-working half-ported minimal example. https://gist.github.com/1912166 [1] http://developer.gnome.org/gtk3/3.3/ch25s02.html -- Osmo Salomaa From timomlists at gmail.com Sun Feb 26 19:20:37 2012 From: timomlists at gmail.com (Timo) Date: Sun, 26 Feb 2012 12:20:37 +0100 Subject: [pygtk] Painting in text view margin and the "draw" signal In-Reply-To: <4F49901D.2030009@iki.fi> References: <4F49901D.2030009@iki.fi> Message-ID: <4F4A1585.4080309@gmail.com> Op 26-02-12 02:51, Osmo Salomaa schreef: > Hi, > > With Gtk2 and the old static bindings I made use of the text view right > margin by painting a pango layout there. Now I'm trying to port my code > to Gtk3 and the introspection bindings. Documentation [1] tells me that > I should be using the "draw" signal instead of "expose-event", but my > callback for the "draw" signal doesn't even seem to get called. Callback works ok here, well, after removing everything after the print function. Ubuntu 11.10 with GTK 3.2.0 and PyGObject 3.0.0. Cheers, Timo > Is there > some significant difference between these two signals? Anyone yet ported > similar code? Below is my non-working half-ported minimal example. > > https://gist.github.com/1912166 > > [1] http://developer.gnome.org/gtk3/3.3/ch25s02.html > From otsaloma at iki.fi Wed Feb 29 03:38:07 2012 From: otsaloma at iki.fi (Osmo Salomaa) Date: Tue, 28 Feb 2012 21:38:07 +0200 Subject: [pygtk] Painting in text view margin and the "draw" signal In-Reply-To: <4F4A1585.4080309@gmail.com> References: <4F49901D.2030009@iki.fi> <4F4A1585.4080309@gmail.com> Message-ID: <4F4D2D1F.2040202@iki.fi> 26.02.2012 13:20, Timo wrote: > Callback works ok here, well, after removing everything after the print > function. Ubuntu 11.10 with GTK 3.2.0 and PyGObject 3.0.0. Thanks. I guess I better file another bug report. -- Osmo Salomaa From lotan_rm at hotmail.com Thu Feb 2 20:04:12 2012 From: lotan_rm at hotmail.com (=?UTF-8?Q?G=C3=BCnter_Merz?=) Date: Thu, 02 Feb 2012 12:04:12 -0000 Subject: [pygtk] Very weird Gio write_async behaviour In-Reply-To: <1325786925.3113.13.camel@debiousci.pietrobattiston.it> References: <1325786925.3113.13.camel@debiousci.pietrobattiston.it> Message-ID: <27938268.395.1328184246618.JavaMail.geo-discussion-forums@vbue14> I can confirm this behaviour. My application is slightly different in that it downloads data from a web page and appends it (using append_to_async()) to a file. The result is the same: Garbage at the beginning of the file. And the garbage data becomes longer in later attempts. I've tried this on a native stable Gentoo system and a native Arch system. Both up-to-date and both show the same garbage. However, I've also tried it on a vmware guest Arch on a Windows host (also up-to-date) and there is no garbage. I also did a debug print on the data just before the write_async() call. The data seems to be alright. And I decoded the utf-8 stream after load_contents_async() and encoded to utf-8 before write_async() as I was working on the data. But it didn't help with the garbage. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebp at k-d-w.org Tue Feb 7 02:49:37 2012 From: sebp at k-d-w.org (=?UTF-8?B?U2ViYXN0aWFuIFDDtmxzdGVybA==?=) Date: Mon, 06 Feb 2012 18:49:37 -0000 Subject: [pygtk] PyGObject 3.1.0 released Message-ID: <4F301CBA.8020400@k-d-w.org> I am pleased to announce version 3.1.0 of the Python bindings for GObject. This is the first release of the unstable branch, which will eventually result in the stable 3.2.x series. Download ======== The new release is available from ftp.gnome.org: http://download.gnome.org/sources/pygobject/3.1/pygobject-3.1.0.tar.xz sha256sum: a5b36eff7c4b14f161bc9ba2ae09a03ddb47d9f2c769589b8f389ae3a92cc92e What?s new since PyGObject 3.0.3? ================================= - Revert "Convert all strings to utf-8 encoding when retrieving from TreeModel" (Sebastian P?lsterl) - tests: Fixed issues with python3 (Sebastian P?lsterl) - Properly distinguish between different integer types for properties (Sebastian P?lsterl) - Distinguish between GArray and GPtrArray when cleaning up (Sebastian P?lsterl) - Add null_gerror_callback unit test (Paolo Borelli) - pyglib_error_check: Re-add missing NULL check (Martin Pitt) - Add tests/runtests-windows.py to source tarball (Michael Culbertson) - Don't issue a depreciation warning for GtkDialog's NO_SEPARATOR flag, even when unused (Sebastian P?lsterl) - Fix bool() operations on GLib.Variant objects (Nirbheek Chauhan) - Fix hash() and __eq__() for GLib.Variant objects (Nirbheek Chauhan) - Fix method names of callback tests (Martin Pitt) - Cairo: add missing braces around array-of-struct definition (Will Thompson) - g_instance_init: cast to PyGObject * as needed (Will Thompson) - Fix a few set-but-not-used warnings. (Will Thompson) - pygmainloop: allow for extra arguments in 'quit' method (Stefano Facchini) - Fix bytearray test compatibility with python3 (Alexandre Rostovtsev) - Respect transfer-type when demarshalling GErrors (Alberto Mardegan) - Support GHashTable and GError as callback/closure arguments (Alberto Mardegan) - Don't leak when marshalling GErrors to C (Will Thompson) - Support functions which return GError (Will Thompson) - Fix indentation of _pygi_argument_to_object() (Alberto Mardegan) - Avoid C99 syntax. (Paolo Borelli) - Connect to first action of a radio group. (Paolo Borelli) - Use g_slist_free_full in pygi-closure. (Paolo Borelli) - Avoid O(n^2) behavior when marshalling lists (Paolo Borelli) - Handle NULL as a valid case of a char** array (Paolo Borelli) - Branching, bump version to 3.1.0 (Tomeu Vizoso) - Add notes about branching to HACKING (Tomeu Vizoso) - Fixed bug where GObject.property did not respect minimum and maximum values (Sebastian P?lsterl) - Remove mention of removed option --enable-docs (Tomeu Vizoso) About PyGObject =============== GObject is a object system used by GTK+, GStreamer and other libraries. PyGObject provides a convenient wrapper for use in Python programs when accessing GObject libraries. Like the GObject library itself PyGObject is licensed under the GNU LGPL, so is suitable for use in both free software and proprietary applications. It is already in use in many applications ranging from small single purpose scripts up to large full featured applications. PyGObject now dynamically accesses any GObject libraries that uses GObject Introspection. It replaces the need for separate modules such as PyGTK, GIO and python-gnome to build a full GNOME 3.0 application. Once new functionality is added to gobject library it is instantly available as a Python API without the need for intermediate Python glue. -- Sebastian P?lsterl -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 900 bytes Desc: OpenPGP digital signature URL: From sebp at k-d-w.org Thu Feb 9 17:10:21 2012 From: sebp at k-d-w.org (=?UTF-8?B?U2ViYXN0aWFuIFDDtmxzdGVybA==?=) Date: Thu, 09 Feb 2012 09:10:21 -0000 Subject: [pygtk] PyGObject 3.0.4 released Message-ID: <4F338D71.9060008@k-d-w.org> I am pleased to announce version 3.0.4 of the Python bindings for GObject. This is a bug fix release for the stable series. Download ======== The new release is available from ftp.gnome.org: http://download.gnome.org/sources/pygobject/3.0/pygobject-3.0.4.tar.xz sha256sum: f457b1d7f6b8bfa727593c3696d2b405da66b4a8d34cd7d3362ebda1221f0661 What?s new since PyGObject 3.0.3? ================================= - Revert "Convert all strings to utf-8 encoding when retrieving from TreeModel" (Martin Pitt) - Fixed bug where GObject.property did not respect minimum and maximum values (Sebastian P?lsterl) - Remove mention of removed option --enable-docs (Tomeu Vizoso) About PyGObject =============== GObject is a object system used by GTK+, GStreamer and other libraries. PyGObject provides a convenient wrapper for use in Python programs when accessing GObject libraries. Like the GObject library itself PyGObject is licensed under the GNU LGPL, so is suitable for use in both free software and proprietary applications. It is already in use in many applications ranging from small single purpose scripts up to large full featured applications. PyGObject now dynamically accesses any GObject libraries that uses GObject Introspection. It replaces the need for separate modules such as PyGTK, GIO and python-gnome to build a full GNOME 3.0 application. Once new functionality is added to gobject library it is instantly available as a Python API without the need for intermediate Python glue. -- Sebastian P?lsterl -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 900 bytes Desc: OpenPGP digital signature URL: From jsonacc at gmail.com Sun Feb 19 08:56:59 2012 From: jsonacc at gmail.com (malco) Date: Sun, 19 Feb 2012 00:56:59 -0000 Subject: [pygtk] Can't get a list of windows on gnome Message-ID: <1329612054664-4484375.post@n6.nabble.com> I'm trying to get a list of windows on gnome2 but this is having an odd behaviour. Here's the code I came up with so far: dm = gtk.gdk.DisplayManager() dm.get_default_display().get_screen(0).get_root_window().get_children() The results are strange. I don't get all the windows listed, nor the list appears to change if I open or close some windows and run this snippet again. However, sometimes, if I open a new python console the results are different. I can't understand which criteria is being used. I tried to inspect the results but with so many attributes and so many possibilities for many of them, it becomes difficult to know what's what. What am I doing wrong? what is the above snippet supposed to return? -- View this message in context: http://python.6.n6.nabble.com/Can-t-get-a-list-of-windows-on-gnome-tp4484375p4484375.html Sent from the Gtk+ - Python mailing list archive at Nabble.com. From sebp at k-d-w.org Tue Feb 21 02:40:36 2012 From: sebp at k-d-w.org (=?UTF-8?B?U2ViYXN0aWFuIFDDtmxzdGVybA==?=) Date: Mon, 20 Feb 2012 18:40:36 -0000 Subject: [pygtk] PyGObject 3.1.0 released Message-ID: <4F429394.4040303@k-d-w.org> I am pleased to announce version 3.1.1 of the Python bindings for GObject. This is a bug fix release of the unstable branch, which will eventually result in the stable 3.2.x series. Download ======== The new release is available from ftp.gnome.org: http://download.gnome.org/sources/pygobject/3.1/pygobject-3.1.1.tar.xz sha256sum: ae6da0f95c0d6b93694191133a3b046f7811ba047e3bd5e9c13c9e6907f71515 What?s new since PyGObject 3.1.0? ================================= - Don't use C99 style (Sebastian P?lsterl) - Add test for GPtrArray with transfer full (Martin Pitt) - Drop obsolete g_thread_init() (Martin Pitt) - Fix deprecated g_source_get_current_time() (Martin Pitt) - Fix deprecated g_value_[gs]et_char() (Martin Pitt) - Make pygiconvert.sh correctly convert gtk.gdk.x11_* (Simon Schampijer) - Raise required glib version to 2.31 because of g_value_(get|set)_schar (Sebastian P?lsterl) - Fix cset_first typo (Dieter Verfaillie) - pygi-convert: Handle Clutter and Cogl (Bastian Winkler) - Provide access to gpointer struct values (C?dric Krier) - Add some GType tests (Paolo Borelli) - Split GStrv and array variant tests in their own classes (Paolo Borelli) - Add unit test for builder's connect_after (Paolo Borelli) - fix GtkBuilder signal connection 'after' logic (Ryan Lortie) - test(1) uses '=' to test if strings are identical (Patrick Welche) - pygspawn: improve error checking (Ryan Lortie) About PyGObject =============== GObject is a object system used by GTK+, GStreamer and other libraries. PyGObject provides a convenient wrapper for use in Python programs when accessing GObject libraries. Like the GObject library itself PyGObject is licensed under the GNU LGPL, so is suitable for use in both free software and proprietary applications. It is already in use in many applications ranging from small single purpose scripts up to large full featured applications. PyGObject now dynamically accesses any GObject libraries that uses GObject Introspection. It replaces the need for separate modules such as PyGTK, GIO and python-gnome to build a full GNOME 3.0 application. Once new functionality is added to gobject library it is instantly available as a Python API without the need for intermediate Python glue. -- Sebastian P?lsterl -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 900 bytes Desc: OpenPGP digital signature URL: From ianrosswilliams at gmail.com Wed Feb 22 06:07:00 2012 From: ianrosswilliams at gmail.com (Ian Williams) Date: Tue, 21 Feb 2012 22:07:00 -0000 Subject: [pygtk] Site down In-Reply-To: <4EC6ABF1.4040105@optionexplicit.be> References: <1321455567.5180.1.camel@cristian-desktop> <4EC6ABF1.4040105@optionexplicit.be> Message-ID: <1329861104027-4493072.post@n6.nabble.com> Hi Dieter, It looks like the www.pygtk.org site is down as viewed from England anyway. Looks like DNS problems again (nslookup fails). At least Google cache comes to the rescue. Ian -- View this message in context: http://python.6.n6.nabble.com/Site-down-tp1948908p4493072.html Sent from the Gtk+ - Python mailing list archive at Nabble.com.