Re: [pygtk] PyGTK+Thread problem (program freezes)

2003-08-07 Thread Christian Reis
On Thu, Jul 31, 2003 at 03:50:03PM -0700, [EMAIL PROTECTED] wrote:
 It would seem that the problem are with these two commands but
 we cannot seem to find the problem.  As you know, threads
 are not the easiest things to debug.
 
 We are wondering if Python threads are unstable.
 Are they??

What version of PyGTK is this? Recent threading fixes have improved the
threading situation a *lot*, but there might be some leftovers..

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] Gobject properties to PyObject attributes mapping

2003-08-07 Thread Christian Reis
On Thu, Aug 07, 2003 at 08:22:06PM +0200, Iñaki García Etxebarria wrote:
 Howdy everyone,
 
 Attached goes a patch against pygtk 1.99.17 that lets you do things like
 ---
 label = gtk.Label()
 label.label = 'Hello World' # Changes the label in the gui
 print label.label # prints 'Hello World'
 ---
 for any gobject. I.e., setting gobject properties as if they were
 regular attributes. I hope this hasn't been decided against before, imho
 it is nice sugar.
 
 I'm a novice with Python and not an expert with gtk2, so I don't expect
 it to be accepted (the method is certainly not optimal and probably not
 Pythonesque in style), but hopefully it will inspire someone to
 implement the feature properly.

+1 by me.

I'm for this change, and I've discussed it with other people on #pygtk
before (Joe Shaw, IIRC, and Johan).

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] textview: how to insert characters?

2003-08-07 Thread Christian Reis
On Fri, Aug 01, 2003 at 01:10:13PM +0200, Riccardo Galli wrote:
 def on_insert_text(self,buffer,textIter,char,*args):
 buffer.disconnect(self.signal_id)
 if textIter.get_chars_in_line()==6 :
 newIter=buffer.get_iter_at_offset(2)
 buffer.insert(newIter,'X')
 buffer.place_cursor(buffer.get_end_iter())
 self.signal_id=buffer.connect('insert-text',self.on_insert_text)
 
 I understand from the warning that I should use marks, but I don't know how.

Not sure about your specific problem, but there's also something I don't
like here, which is disconnecting and connecting in a signal callback.

I'm surprised it even works, actually; if you want to avoid the signal
being emitted, you can use the venerable emit_stop_by_name() method (or
whatever pygtk2 offers with compatible semantics if it's not there).

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] delete selection

2003-08-07 Thread Yang Zheng
Hello,

I am trying to implement a GUI showing a list in TreeView/TreeStore.  I
would like to be able to select a range of values from the list and
press a button to delete it.  However, I keep getting the following
error when trying to delete:

(SimGuiClient.py:20194): Gtk-CRITICAL **: file gtktreeselection.c: line
491 (gtk_tree_selection_selected_foreach): assertion `has_next' failed.
There is a disparity between the internal view of the GtkTreeView,
and the GtkTreeModel.  This generally means that the model has changed
without letting the view know.  Any display from now on is likely to
be incorrect.

#Here is the function attached to the delete button:

def RemoveWatchVariables(button):
  # delete each variable
  def DeleteVar(model,path,iter,data=None):
model.remove(iter)
  # get selection and iterate through
  selection = watchvars_view.get_selection()
  selection.selected_foreach(DeleteVar)  

remove_watchvar_button = xml.get_widget('remove_watchvar_button')
remove_watchvar_button.connect('clicked',RemoveWatchVariables)


Can I not delete iterator like this?

Thank you!
~ yz.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/