Re: Fwd: Re: [pygtk] button queue

2006-07-31 Thread Tony Nelson
At 5:31 PM -0700 7/31/06, Mr Jason Cupp wrote:
>I don't know if I'm doing this mailing list right, but anyway:
>I tried making a method that either makes a button insensitive or
>sensitive according to the data that I pass it using
>self.button.set_sensitive(True) or self.button.set_sensitive(False).  This
>is what was suggested.  For some reason it didn't work.  The program is
>supposed to make the buttons insensitive, then play the audio file using
>pymedia, and time.sleep() until audio is finished playing, then it makes
>the buttons sensitive again.  But it never makes it insensitive during
>this time.  So I connected 2 other buttons one that makes sensitive, and
>another that makes insensitive, just to see whether the method works or
>not.  It does work when I click the buttons, but it does not work when the
>program automatically tries to turn them off, play audio, then turn them
>back on.  So the method in itself works.  Also in the method I put a 
>print 'sensitive' and print 'insensitive'  to see if the program is
>calling the method when it is supposed to, and it is.  Any more
>suggestions on why this would happen?

Yes.  In order to make GTK seem faster, all the work was moved to idle
time.  You will need to idle a bit before starting the sound.  What I do is:

def gtkeat():
while gtk.events_pending():
gtk.main_iteration(False)

Call gtkeat() after changing the sensitivity, and before starting the sound.

TonyN.:'   
  '  
___
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/


Fwd: Re: [pygtk] button queue

2006-07-31 Thread Mr Jason Cupp
I don't know if I'm doing this mailing list right, but anyway:I tried making a method that either makes a button insensitive or sensitive according to the data that I pass it using self.button.set_sensitive(True) or self.button.set_sensitive(False).  This is what was suggested.  For some reason it didn't work.  The program is supposed to make the buttons insensitive, then play the audio file using pymedia, and time.sleep() until audio is finished playing, then it makes the buttons sensitive again.  But it never makes it insensitive during this time.  So I connected 2 other buttons one that makes sensitive, and another that makes insensitive, just to see whether the method works or not.  It does work when I click the buttons, but it does not work when the program automatically tries to turn them off, play audio, then turn them back on.  So the method in itself works.  Also in the method I put a  print 'sensitive' and print
 'insensitive'  to see if the program is calling the method when it is supposed to, and it is.  Any more suggestions on why this would happen?"David M. Cook" <[EMAIL PROTECTED]> wrote: Date: Mon, 31 Jul 2006 09:21:32 -0700From: "David M. Cook" <[EMAIL PROTECTED]>To: pygtk@daa.com.auSubject: Re: [pygtk] button queue On Mon, Jul 31, 2006 at 07:11:56AM -0700, Mr Jason Cupp wrote:> I am pretty new to pygtk.  I wrote a program where there are severalbuttons that are connected to a method that plays different wav files usingpymedia.  My problem is that if I keep pressing buttons while a wav is beingplayed, it queues the events and just keeps playing audio files for theevents that were racked up.  I want a button to only work when an audio fileis not being
 played.===You should make the button insensitive in your "click" callback, and thenmake it sensitive again when the program is ready.  If the button action isalso a menu item, you can use the action API.  See sections 16.1 and 16.7 ofthe tutorial.Dave Cook___pygtk mailing list   pygtk@daa.com.auhttp://www.daa.com.au/mailman/listinfo/pygtkRead the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ 
		Do you Yahoo!? 
Get on board. You're invited to try the new Yahoo! Mail Beta.___
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/


Re: [pygtk] Re: [OLPC-devel] Pygtk and garbage collecting

2006-07-31 Thread John Finlay

Johan Dahlin wrote:

Philip Van Hoof wrote:
  

This PyGTK bug is going to be important for OLPC as it might slow down
object destruction.

http://bugzilla.gnome.org/show_bug.cgi?id=320428



This is true for all GObject subclasses. GdkPixbufs is another problematic
case, since they're usually quite large.

Without the patch they appear to leak and will not be freed immediately.

The patch could use some wider testing, large applications are known to run
under it, but there may still be some corner cases which are not solved.

I think we're going to apply it early on in the next PyGObject/PyGTK release
cycle (after GNOME 2.16).

  
Does changing the gc thresholds help as a workaround in the meantime? 
For example gc.set_threshold(10,2,2) to really get collection to run 
frequently.


John
___
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/


[pygtk] Re: [OLPC-devel] Pygtk and garbage collecting

2006-07-31 Thread Johan Dahlin
Philip Van Hoof wrote:
> This PyGTK bug is going to be important for OLPC as it might slow down
> object destruction.
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=320428

This is true for all GObject subclasses. GdkPixbufs is another problematic
case, since they're usually quite large.

Without the patch they appear to leak and will not be freed immediately.

The patch could use some wider testing, large applications are known to run
under it, but there may still be some corner cases which are not solved.

I think we're going to apply it early on in the next PyGObject/PyGTK release
cycle (after GNOME 2.16).

Johan

___
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/


Re: [pygtk] pygtk.org mockup

2006-07-31 Thread John Finlay

Andi Albrecht wrote:


Producing the PDFs is not that easy. Today I've tried to generate 
them, but it results in a bunch of error messages, esp. about TeX's 
internal memory and so on. It's fixable, but if anyone has some 
experiences in converting (huge) DocBook files to PDF would make 
things easier. John, I'm not sure about it, was there a PDF version 
before? FAQ 1.7 says no, but the Makefile does a good job, until a 
certain point.
I have never been able to create a PDF version of the Reference manual 
from the XML sources. Someone has created a PDF from the HTML but it was 
really ugly (imho).


John
___
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/


Re: [pygtk] pygtk.org mockup

2006-07-31 Thread Andi Albrecht
- somebody with good XSLT skills should have a look at how the pdf 
versions of the tutorial and reference are generated from sources. Andi? 
If I recall correctly, someone did some really impressive work to get 
PDF output for some other gnome documentation, and that work is probably 
in the desktop-devel-list or in the gtk-devel-list archives. Something 
in those lines would be amazing.
My XSLT skills are not that good, I try to do some modifications where 
it's possible. Any help would be appreciated.


Generating the HTML pages (reference & tutorial) is not that difficult. 
Wrapping the existing parts in the new header and footer and including 
the new CSS should do it. Maybe a few modifications are necessary (i.e, 
the headers are too large for a reference...).


We should just decide on what's on the left hand menu. In my opinion 
we've got two possibilities:
a) leaving the menu items (LHM) unchanged on all pages, this would be 
consistent,

b) replacing the "standard" menu items with some kind of quick links
to the reference sections (atk, gobject, gtk and so on).

The latter would make it possible to navigate between the reference 
sections without using the back button or the references index page.


Another thing to decide is, if we need a "Back to top" link on the 
bottom of each method; is this user-friendly?


Producing the PDFs is not that easy. Today I've tried to generate them, 
but it results in a bunch of error messages, esp. about TeX's internal 
memory and so on. It's fixable, but if anyone has some experiences in 
converting (huge) DocBook files to PDF would make things easier. John, 
I'm not sure about it, was there a PDF version before? FAQ 1.7 says no, 
but the Makefile does a good job, until a certain point.


Andi
___
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/


Re: [pygtk] button queue

2006-07-31 Thread David M. Cook
On Mon, Jul 31, 2006 at 07:11:56AM -0700, Mr Jason Cupp wrote:

> I am pretty new to pygtk.  I wrote a program where there are several
buttons that are connected to a method that plays different wav files using
pymedia.  My problem is that if I keep pressing buttons while a wav is being
played, it queues the events and just keeps playing audio files for the
events that were racked up.  I want a button to only work when an audio file
is not being played.
===

You should make the button insensitive in your "click" callback, and then
make it sensitive again when the program is ready.  If the button action is
also a menu item, you can use the action API.  See sections 16.1 and 16.7 of
the tutorial.

Dave Cook


___
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/


[pygtk] Pygtk and garbage collecting

2006-07-31 Thread Philip Van Hoof
This PyGTK bug is going to be important for OLPC as it might slow down
object destruction.

http://bugzilla.gnome.org/show_bug.cgi?id=320428

For example in the tinymail-python-test.py*, you will find a
gc.collect(). This is to speed up the destruction of objects in the
situation described in Bug #320428

https://svn.tinymail.org/svn/tinymail/trunk/libtinymail-test/tinymail-python-test.py

In case of tinymail the GtkTreeModel that holds a reference on all the
headers of the current folder, is such an object. 

model = MsgHeaderListModel ()
treeview.set_model (model)

newmodel = MsgHeaderListModel ()
treeview.set_model (newmodel)

Will not immediately mark "model" for garbage collection (when model
goes out of scope). Adding a gc.collect(), however, will. 

That model instance, in case of tinymail, holds a reference to the
headers of your folder. This is where most of the memory tinymail
consumes is located (the summary information). Therefore it's a small
disaster on a device with few memory resources, that Pythons garbage
collector is slow at detecting this.

Applying the patch of Bug #320428 or performing gc.collect() in your
Python code fixes this.

Note that tinymail isn't going to be the only case.


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be

___
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/


[pygtk] button queue

2006-07-31 Thread Mr Jason Cupp
I am pretty new to pygtk.  I wrote a program where there are several buttons that are connected to a method that plays different wav files using pymedia.  My problem is that if I keep pressing buttons while a wav is being played, it queues the events and just keeps playing audio files for the events that were racked up.  I want a button to only work when an audio file is not being played.  I tried making a method to disconnect all of the buttons when I don't want them to work, and another one to reconnect them, but for some reason that didn't work.  Is there a way to clear the event queue when I am ready to accept a button click? __Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.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/


Re: [pygtk] pygtk.org mockup

2006-07-31 Thread Rafael Villar Burke

Panos Laganakos escribió:

I saw that gtkmm.org received a style update, so I thought I'd give a
try at a new look for pygtk.org


Panos, your work looks great, and has improved with all the constructive 
criticism!. Andi's work on the XSLT files for the tutorial and reference 
pages is really nice, too. We definetly need you to improve and keep the 
site rocking!.


I specially like the clean look and the logo design :).

And now, the rough points...

At this year's GUADEC there was a BOF meeting to tackle with a whole 
gnome.org redesign and refactoring driven by the GNOME Foundation and 
it's aimed to be completed for the next release (not the ongoing one) 
aound the end of the year.


We need to talk about this as it will probably involve the site design 
too, wether pygtk.org relates to gnome.org (maybe linking to 
pygtk.gnome.org?) and some other issues.


Much closer integration of some related sites as pygtk.org and gtkmm was 
desired, as one of the problems with the current situation is that a lot 
of information is spread though different sites and their relation with 
the main project and documentation is not always very clear. This makes 
building sinergies between them difficult. Also, the use of a SCM was 
suggested.


As you have proved skills to hack on the web and the XSLT pages, we want 
your help!. There's a lot of information on 
http://live.gnome.org/GnomeWeb and I'm sure you can make it rock.
I have been missing for some time and probably won't have a lot of time 
to follow it all, but I'll try to do my best to help you if you're 
willing to take some responsibility in this regard and make pygtk move 
ahead that road.


Besides this issue of how we will do with the gnome website refactoring, 
there's some more "minor" work pending to do such as:
- adding images (and redesign) to the application list entries (probably 
writing a mail asking for permission to app writers to get their 
screenshots or take new ones)
- redesign the releases page to make it clearer which version to use and 
how to get it all running for the different environments
- add new step-by-step articles in the lines of what Alberto Ruiz, 
Lawrence Oluyede or Marc Mruss have been doing lately.
- The FAQ is hosted in a different server from pygtk.org. Is that ok? 
should we move it?.
- The script used for the GPLv3 discussion, which highlights the most 
commented and thus confusing parts could be used to add some user 
feedback to the existing documentation.
- somebody with good XSLT skills should have a look at how the pdf 
versions of the tutorial and reference are generated from sources. Andi? 
If I recall correctly, someone did some really impressive work to get 
PDF output for some other gnome documentation, and that work is probably 
in the desktop-devel-list or in the gtk-devel-list archives. Something 
in those lines would be amazing.


Regards, and sorry for coming back a bit late with such a disturbing 
information... anyway, I'm sure your work will be very valuable whatever 
path is taken.


Rafael Villar Burke

___
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/