Re: [Tutor] PyGTK: is there a library for both Linux and Windows
Forwarding to the list with my reply... On Wed, Oct 21, 2009 at 1:21 PM, Chris Fuller wrote: > > There are workarounds. The point is that they aren't necessary in Linux, and > usually involve something fishy, like sleeping a (more or less) arbitrary > period to get the synchronization right, which might work some of the time, > but not under unusual circumstances (but who cares if its just a GUI update?) > > Possibly, the Linux environment is more forgiving, but I don't have similar > problems in Tkinter, and special treatment isn't necessary if you only access > the GUI via the main thread. > > http://faq.pygtk.org/index.py?file=faq20.006.htp&req=show Oh, OK. Accessing the GUI only from the GUI thread is (in my experience) a pretty common requirement. I'm currently using WinForms which requires that GUI elements be accessed from the thread that created them, and IIRC Java Swing has the same limitation. Kent > It may be that the last time I tangled with the issue, I was missing some key > docs. In any case, its a potential pitfall to watch out for. > > Cheers > > On Wednesday 21 October 2009 10:38, you wrote: >> On Wed, Oct 21, 2009 at 10:43 AM, Chris Fuller >> >> wrote: >> > on differences: >> > >> > The downloads include binaries, so there have to be distinct files for >> > Linux and Windoze. If you download the same versions, there shouldn't be >> > any noticeable differences, with one big exception: multithreading and >> > PyGTK don't mix well on Windows. Your application might run perfectly >> > (and look correct) on Linux, but in Windoze it's a mess. >> >> Wow. You can't make a multithreaded Windows GUI app using PyGTK? That >> is a huge limitation - in my experience most large GUI programs do use >> threads to allow the GUI to be responsive during long-running tasks. >> >> Kent > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] PyGTK: is there a library for both Linux and Windows
On Wed, Oct 21, 2009 at 10:43 AM, Chris Fuller wrote: > > on differences: > > The downloads include binaries, so there have to be distinct files for Linux > and Windoze. If you download the same versions, there shouldn't be any > noticeable differences, with one big exception: multithreading and PyGTK > don't mix well on Windows. Your application might run perfectly (and look > correct) on Linux, but in Windoze it's a mess. Wow. You can't make a multithreaded Windows GUI app using PyGTK? That is a huge limitation - in my experience most large GUI programs do use threads to allow the GUI to be responsive during long-running tasks. Kent ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] PyGTK: is there a library for both Linux and Windows
-Original Message- >From: Chris Fuller >Sent: Oct 21, 2009 10:43 AM >To: tutor@python.org >Subject: Re: [Tutor] PyGTK: is there a library for both Linux and Windows > > >on differences: > >The downloads include binaries, so there have to be distinct files for Linux >and Windoze. If you download the same versions, there shouldn't be any >noticeable differences, with one big exception: multithreading and PyGTK >don't mix well on Windows. Your application might run perfectly (and look >correct) on Linux, but in Windoze it's a mess. You can find workarounds, but >I haven't come across one that looked reliable. If you have Python 2.6 or >higher, you can use the multiprocessing module (also available separately for >earlier versions) to emulate threads with processes, which will relieve the >problem, but make it a little harder for your threads (processes) to >communicate with each other. > >Cheers In a forum like this why do some presumably intelligent people insist on using insulting and derogatory terminology as above? Flame wars are ugly. . ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] PyGTK: is there a library for both Linux and Windows
on differences: The downloads include binaries, so there have to be distinct files for Linux and Windoze. If you download the same versions, there shouldn't be any noticeable differences, with one big exception: multithreading and PyGTK don't mix well on Windows. Your application might run perfectly (and look correct) on Linux, but in Windoze it's a mess. You can find workarounds, but I haven't come across one that looked reliable. If you have Python 2.6 or higher, you can use the multiprocessing module (also available separately for earlier versions) to emulate threads with processes, which will relieve the problem, but make it a little harder for your threads (processes) to communicate with each other. Cheers ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] PyGTK: is there a library for both Linux and Windows
The version of GTK for windows I like to use is at http://gladewin32.sourceforge.net/, but it is rather out of date. It's main advantage is everything is bundled up in a nice installer. You can also get it from the main site at ftp://ftp.gtk.org/pub/gtk, but you have to grab several files and install manually. I've never tried to figure out which ones, but I expect it wouldn't be hard. You could check the dependencies of the PyGTK shared objects, i.e. with http://www.dependencywalker.com/ You could also just get a more current, but still bundled up runtime from Pidgin (http://www.pidgin.im/), and install glade separately, as its only a single file. Note that you'll need to get PyGTK from the gnome site http://ftp.gnome.org/pub/gnome/binaries/win32/. Get PyGTK, PyObject, and PyCairo. Yes, glade is awesome. You'll need to learn how to hook the signals into your code. There are a lot of tutorials out there, but the ones I used are at the Linux Journal site: http://www.linuxjournal.com/article/6586 http://www.linuxjournal.com/article/7421 http://www.linuxjournal.com/article/4702 There's a bit of a caveat. You will find in most cases that the system Python and GTK (or numpy, PIL, etc) that your distribution provides is lagging somewhat behind what you can easily install on a Windows box, since there's aren't so many interdependencies. I'm just now starting to playing around with ArchLinux to see if I can get aruond this. Cheers On Wednesday 21 October 2009 08:42, Nicola De Quattro wrote: > Hi > I'm starting to design some windows for my little tool. > I've two questions for you: > 1) In this page http://www.pygtk.org/downloads.html there are two > different library for Windows and GNU/Linux, but I want my application > to be executed identically under Windows and under GNU/Linux. Is PyGTK > a good choice? There are some difference between PyGTK library under > Windows and under GNU/Linux, that is have I to develop two different > versions of my tool? > 2) Do you suggest to use Glade to design windows? Note: I'm totally > new both to python and to GUI design (I've always worked on signal > processing, never develop a MMI) so I'm searching something that can > be as much as possible both "educational" and friendly. > > Thank you for your help ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] PyGTK: is there a library for both Linux and Windows
On Wed, Oct 21, 2009 at 8:42 AM, Nicola De Quattro < lead.express...@gmail.com> wrote: > Hi > I'm starting to design some windows for my little tool. > I've two questions for you: > 1) In this page http://www.pygtk.org/downloads.html there are two > different library for Windows and GNU/Linux, but I want my application > to be executed identically under Windows and under GNU/Linux. Is PyGTK > a good choice? There are some difference between PyGTK library under > Windows and under GNU/Linux, that is have I to develop two different > versions of my tool? > There shouldn't be. There might be some decorative differences, but that's due to the different window managers. But yes, PyGTK is a good choice. > 2) Do you suggest to use Glade to design windows? Note: I'm totally > new both to python and to GUI design (I've always worked on signal > processing, never develop a MMI) so I'm searching something that can > be as much as possible both "educational" and friendly. Glade is pretty useful for most people. I don't personally use it because I find that, personally, I spend more time looking up how to adjust something in Glade than just write the code myself. I guess if I were trying to write some large project or had a great desire to learn Glade, I'd find it useful. I know some people prefer it - I guess it should come down to this line of questioning: If you make a webpage do you prefer Arachnophilia/Dreamweaver/WYSIWYG or vi/emacs/notepad? When you regularly program do you prefer IDLE/Codeblocks/Etc. or vi/emacs/notepad? If you lean towards the former, I would recommend Glade. If you lean towards the latter, I would recommend you try out Glade, but you may likely find simply coding in your favourite editor works better for you. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] pygtk
Thanks Patrik, this is what i am searching for. || a j i t || On Wed, Sep 9, 2009 at 1:27 AM, Patrick Sabin wrote: > The official docs > > http://www.pygtk.org/pygtk2tutorial/index.html > http://library.gnome.org/devel/pygtk/stable/ > > worked for me. > > - Patrick > > Ajith Gopinath schrieb: > >> I will appreciate , if somebody guides me to a proper doc. on pygtk for >> 2.5/2.6. I am currently unable to find a good doc for the same :o( >> >> Thanks and regards >> ~|| a j i t || >> >> >> ___ >> Tutor maillist - Tutor@python.org >> To unsubscribe or change subscription options: >> http://mail.python.org/mailman/listinfo/tutor >> >> > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] pygtk
The official docs http://www.pygtk.org/pygtk2tutorial/index.html http://library.gnome.org/devel/pygtk/stable/ worked for me. - Patrick Ajith Gopinath schrieb: I will appreciate , if somebody guides me to a proper doc. on pygtk for 2.5/2.6. I am currently unable to find a good doc for the same :o( Thanks and regards ~|| a j i t || ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] [pygtk] taking image of gtk.drawing area
JPEG doesn't support alpha (transparency), try with PNG or GIF. On 6/19/09, Amit Sethi wrote: > Hi , > I am trying to take image of a gst video playing in the gtk.drawingarea i am > using following code for it : > > def snap_shot(self,widget,data=None): > global file_loc ,pixbuf > self.pipeline.set_state(gst.STATE_PAUSED) > pixbuf = gtk.gdk.Pixbuf( gtk.gdk.COLORSPACE_RGB, False, 8, 640, 480) > pixbuf.get_from_drawable( self.movie_window.window, > self.movie_window.get_colormap(), 0, 0, 0, 0, 640, 480) > file_loc="/tmp/bar%d"%time.time() > pixbuf.save(file_loc,'jpeg', {'quality':'100'}) > self.pipeline.set_state(gst.STATE_PLAYING) > > but the movie seems to momentarily stop and i am left with a dark image > where i might be going wrong?? > > -- > A-M-I-T S|S > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] [pygtk] ListStore question
this is cool, ill give it a shotskOn 10/27/06, euoar <[EMAIL PROTECTED]> wrote: euoar escribió:> mc collilieux escribió:>> euoar wrote:>> I'm learning the use of liststores and treeviews. I have wrotten this litle class as exercice: # name is the name of the new column to add, values is a tuple with the values to add def add_result (self, name, values): self.iter = self.liststore.append (values[0]) for value in values: self.liststore.insert_after(self.iter, value)>> rereading the tutorial, I note "...The row parameter specifies the data>> that should be inserted in the row after it is created ... If row is >> specified it must be a tuple or list containing as many items as the>> number of columns in the ListStore...so self.liststore.insert_after(self.iter, [value])>> >> Hope it's the good answer... PS : sorry for the answer directly to your mail. too quickly clic>>> That's exactly the solution. It has to be a tuple. Thank you very much > for your help!>>> __ LLama Gratis a> cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por> minuto. http://es.voice.yahoo.com> ___> pygtk mailing list pygtk@daa.com.au> http://www.daa.com.au/mailman/listinfo/pygtk> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/>I think I have the solution (I'm answering myself to avoid people to waste time thinking in my question):args = [str, str, str]gtk.ListStore(*args)__LLama Gratis a cualquier PC del Mundo.Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com___Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] [pygtk] ListStore question
euoar escribió: > mc collilieux escribió: >> euoar wrote: >> I'm learning the use of liststores and treeviews. I have wrotten this litle class as exercice: >> >> # name is the name of the new column to add, values is a tuple with the values to add def add_result (self, name, values): self.iter = self.liststore.append(values[0]) for value in values: self.liststore.insert_after(self.iter, value) >> >> >> rereading the tutorial, I note "...The row parameter specifies the data >> that should be inserted in the row after it is created ... If row is >> specified it must be a tuple or list containing as many items as the >> number of columns in the ListStore...so >> >> self.liststore.insert_after(self.iter, [value]) >> >> Hope it's the good answer... >> >> PS : sorry for the answer directly to your mail. too quickly clic >> > That's exactly the solution. It has to be a tuple. Thank you very much > for your help! > > > __ LLama Gratis a > cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por > minuto. http://es.voice.yahoo.com > ___ > pygtk mailing list pygtk@daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ > I think I have the solution (I'm answering myself to avoid people to waste time thinking in my question): args = [str, str, str] gtk.ListStore(*args) __ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] [pygtk] key_press_event
Sandro, That's exactly what I need. Thanks, John. > def callback3(self,data,widget): > > input = data.get_text() > print input > data.set_text("test") If you don't return True, default callback will be called that insert the 'a'. I have something like this: def digits_check_input_cb(self, widget, event): """prevents the possibility of inputting wrong chars""" ## fixme: missing comma, and cut&paste key = gtk.gdk.keyval_name (event.keyval) ONLYDIGITS="([0-9.,]|BackSpace|Left|Right|F1|period|Tab|Up|Down)" if not re.match (ONLYDIGITS, key): return True Not sure whether this is the best way thought... sandro *;-) -- Sandro Dentella *:-) http://www.tksql.orgTkSQL Home page - My GPL work ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] PyGTK on cygwin
There is a PyGTK package for win32, don't know if it uses cygwin or mingw but works pretty well on windows, it only needs the gtk runtime. http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ Altough I might been misunderstanding your question ;) On 6/8/06, Christopher Spears <[EMAIL PROTECTED]> wrote: > Does PyGTK work well on cygwin? > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor