Re: [pygtk] Another threading/progressbar Question
Dirk Maass wrote: > > > I found some discussion of threading problems with pygtk in the list > archive and also some hints, but i am trying to solve this issue for > days without success. My system is Red Hat 8.0. I also updated to the > newest packages i found (rawhide) and recompiled the pygtk2.src.rpm > ("./configure --enable-thread" was neccessary). > Forgot to tell: the same effect i have with latest pygtk2 CVS (checked out yesterday), too :-( Dirk ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] getting data from a sorted TreeView
How can I get the data from the cells in a sorted TreeView by specifying the row? Thanks, -- Anthony ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] select_cursor_row
On Tue, Feb 18, 2003 at 07:00:27PM -0500, Anthony Tekatch wrote: > I cannot find any reference to that on the GtkTreeSelection documentation page? > > http://www.gnome.org/~james/pygtk-docs/class-gtktreeselection.html > > Where is that documented? See the bottom of http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeSelection.html Dave Cook ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] understanding documentation
I hope I'm not nitpicking too much but I'm having some difficulty understanding the documentation at: http://www.gnome.org/~james/pygtk-docs/class-gtktreeview.html Since pygtk is being discussed ... should C functions be referenced? For example, under the gtk.TreeView.set_cursor section: "... followed by gtk_widget_grab_focus (tree_view) in order ..." might make more sense if shown as: "... followed by tree_view.grab_focus() in order ..." Thanks, -- Anthony ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] select_cursor_row
> > What TreeView signal can I use to replace "select_row"? > > Try the GtkTreeSelection "changed" signal. I cannot find any reference to that on the GtkTreeSelection documentation page? http://www.gnome.org/~james/pygtk-docs/class-gtktreeselection.html Where is that documented? -- Anthony ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] gtk.Text()
tis 2003-02-18 klockan 15.54 skrev Met @ Uber: > I'm trying to use the GtkText widget without any luck. > > text = gtk.Text() You're using pygtk2. In PyGtk2, GtkText is deprecated and superseded by GtkTextView. Look at the documentation for GtkTextView: http://developer.gnome.org/doc/API/2.0/gtk/GtkTextView.html -- Johan Dahlin <[EMAIL PROTECTED]> Async Open Source ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] gtk.Text()
I'm trying to use the GtkText widget without any luck. text = gtk.Text() This return "AttributeError: 'module' object has no attribute 'Text'". Is there a different name for this widget? I've seen a few tutorials/examples making use of this widget as seen above. Suggestions? ~ Metnetsky ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] draw on TextView borders
Here's a partial conversion of testtext to PyGTK. Hope this helps. John Pier Carteri wrote: Hi to all, I would like to know if it's possible to draw somethings on TextView borders. According with testtext example it can be done with the C version of gtk but I can't undestand how to do it with pygtk. (with draw I mean the possibility to add small images or line numbers...) Has anyone already done this? How? Any tips or code example will be great Thank you! Pier Carteri ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ testtext.tgz Description: GNU Zip compressed data
Re: [pygtk] Porting of wrapper from pygtk1 to pygtk2
tis 2003-02-18 klockan 09.42 skrev Roberto Cavada: > Hi all, >I am currently trying to port the python wrapper for a gtk widget > (gtkscintilla2). Nice, the more bindings, the better :-) > > *** SOME CONTEXT: > Original wrapper works with pygtk1 (say 'W1'). > > Since the gtk widget is now available for gtk2, I am trying to modify > W1 in order to make it working with pygtk2 (say 'W2'). > > I have to say I am not sure about the result, since I am not as much > familiar with pygtk c-side as I'd like, and in general with gtk. In > particular in W1 I found many references to functions PyGtk_{New, Get, > Type}, defined by pygtk.h. There are unfortunately not lots of documentation. But if you have experience with the old bindings, you can look at the code in either way gtk.c (auto-generated) eller gtk.override > In W2 pygtk.h does no longer export like that functions. Instead, > pygobject.h exports similar functions, and I tried to guess the > matching as follows (don't know if this is correct): > > #define PyGtk_New pygobject_new > #define PyGtk_Get pygobject_get or self->obj > #define PyGtk_Type PyGPointer_Type PyGObject_Type for GObject based object, or even better PyGtkWidget_Type (PyGtkContainer_Type etc) > *** THE PROBLEM: > W2 initialization code simply calls init_pygtk(). > After initialization, every time W2's code calls PyGtk_New > (=pygobject_new) a segfault occurs. Do you have a traceback? Do you have the code somewhere, so I can help you debug what's wrong? -- Johan Dahlin <[EMAIL PROTECTED]> Async Open Source ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] Another threading/progressbar Question
Hi, i'm new to this list and a newbie in programming with pygtk so please forgive this stupid question. I'm trying to write an python app which copies a file over a network. While the coping will take place in a separate thread, i want to observe the progress with a progressbar using a timeout. So for testing the usage of progressbars i wrote the little piece of code below (observing a counter). The timeout function does it's job very well but there is a problem in my thread. The programm hangs without an error message when i remove the timeout. I must have misunderstood something (gtk.threads_{enter/leave} or so). Could you please give me hint? I found some discussion of threading problems with pygtk in the list archive and also some hints, but i am trying to solve this issue for days without success. My system is Red Hat 8.0. I also updated to the newest packages i found (rawhide) and recompiled the pygtk2.src.rpm ("./configure --enable-thread" was neccessary). gtk+-1.2.10-23 gtk2-2.1.5-1 gtk2-devel-2.1.5-1 gtk2-engines-1.9.0-6 gtk+-devel-1.2.10-23 gtk-engines-0.11-14 pygtk2-1.99.14-4 pygtk2-debuginfo-1.99.14-4 pygtk2-devel-1.99.14-4 pygtk2-libglade-1.99.14-4 Any help would be appreciated. Dirk #!/usr/bin/env python2 import gtk, thread from gtk import glade from threading import * xml = glade.XML('copy.glade') progressbar = xml.get_widget('aktuell') def gtk_main_quit(*args): gtk.main_quit() xml.signal_autoconnect(locals()) def progress(): global c newfrac = c[0]/10.0 if newfrac >=1: newfrac=0 print 'progress', newfrac gtk.threads_enter() progressbar.set_fraction(newfrac) gtk.threads_leave() return 1 def t(): global progress_timeout, c while c[0]<10: #print 't', c c[0]=c[0]+1 gtk.threads_enter() gtk.timeout_remove(progress_timeout) # here it hangs; "test" isn't printed: print "test" gtk.threads_leave() c=[0] gtk.threads_init() thread.start_new_thread(t,()) progress_timeout=gtk.timeout_add(100,progress) gtk.main() ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] select_cursor_row
On Tue, Feb 18, 2003 at 07:18:38AM -0500, Anthony Tekatch wrote: > GTK used to have a CList widget with a "select_row" signal that was sent > when a row was click upon. GTK2 only has a TreeView "select_cursor_row" > signal which I cannot get to do anything. I have had to use the > "cursor_changed" signal which emits two signal on the first click because > no row was initially selected. > > What TreeView signal can I use to replace "select_row"? Try the GtkTreeSelection "changed" signal. Dave Cook ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] select_cursor_row
Anthony Tekatch wrote: GTK used to have a CList widget with a "select_row" signal that was sent when a row was click upon. GTK2 only has a TreeView "select_cursor_row" signal which I cannot get to do anything. I have had to use the "cursor_changed" signal which emits two signal on the first click because no row was initially selected. What TreeView signal can I use to replace "select_row"? Is there a place that I can read a description about what causes each signal to be emitted? With the new tree widget, the selection is abstracted as a separate object, which can be obtained with: selection = treeview.get_selection() (I think the original reason for this was to allow two views of one model to share a selection). For single selection tree views, you can call selection.get_selected() to retrieve the selected row. For notification of changes to the selection, connect to the selection's "changed" signal. James. -- Email: [EMAIL PROTECTED] WWW: http://www.daa.com.au/~james/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] Porting of wrapper from pygtk1 to pygtk2
Hi all, I am currently trying to port the python wrapper for a gtk widget (gtkscintilla2). *** SOME CONTEXT: Original wrapper works with pygtk1 (say 'W1'). Since the gtk widget is now available for gtk2, I am trying to modify W1 in order to make it working with pygtk2 (say 'W2'). I have to say I am not sure about the result, since I am not as much familiar with pygtk c-side as I'd like, and in general with gtk. In particular in W1 I found many references to functions PyGtk_{New, Get, Type}, defined by pygtk.h. In W2 pygtk.h does no longer export like that functions. Instead, pygobject.h exports similar functions, and I tried to guess the matching as follows (don't know if this is correct): #define PyGtk_New pygobject_new #define PyGtk_Get pygobject_get #define PyGtk_Type PyGPointer_Type *** THE PROBLEM: W2 initialization code simply calls init_pygtk(). After initialization, every time W2's code calls PyGtk_New (=pygobject_new) a segfault occurs. Don't know if I provided information enough, but can someone understand what am I missing? More in general, there exist documents or tutorials that explain how to build pygtk wrappers for gtk widgets? Thank you, roberto -- -- Roberto Cavada ITC-irst Institute for Scientific and Technological Research Automated Reasoning Systems - Formal Methods Group Via Sommarive, 18 - 38050 Povo (TN) - Italy Tel: +39 0461 314 321 Fax: +39 0461 302 040 [EMAIL PROTECTED] http://sra.itc.it/people/cavada/ -- ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] select_cursor_row
GTK used to have a CList widget with a "select_row" signal that was sent when a row was click upon. GTK2 only has a TreeView "select_cursor_row" signal which I cannot get to do anything. I have had to use the "cursor_changed" signal which emits two signal on the first click because no row was initially selected. What TreeView signal can I use to replace "select_row"? Is there a place that I can read a description about what causes each signal to be emitted? Thanks, -- Anthony ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/