Re: [pygtk] treeview.scroll_to_cell() has no effect

2009-01-04 Thread Karl Ostmo
On Sat, Sep 13, 2008 at 1:37 PM, Karl Ostmo  wrote:

> Does anyone know what is wrong with my usage of scroll_to_cell( ) ?  When I
> run the program below, after I click on a row and scroll such that it is out
> of view, I would expect that when I click on the "Scroll to highlighted row"
> button that the row would be brought back into view.
>
> Thanks,
> Karl
>
> #!/usr/bin/python
>
> from pygtk import require
> require('2.0')
> import gtk, gobject
>
> class TreeviewTest(gtk.Window):
> def __init__(self):
> gtk.Window.__init__( self, gtk.WINDOW_TOPLEVEL )
> self.connect("destroy", self.destroy)
>
> vbox = gtk.VBox(False, 5)
> self.add( vbox )
>
> button = gtk.Button("Scroll to highlighted row")
> button.connect("clicked", self.cb_scroll)
> vbox.pack_start(button, False, False)
>
> self.tv = gtk.TreeView( gtk.TreeStore(gobject.TYPE_STRING,
> gobject.TYPE_STRING) )
>
> for i, colname in enumerate(["Index", "Name"]):
> self.tv.append_column( gtk.TreeViewColumn(colname,
> gtk.CellRendererText(), text=i) )
>
> for i in range(20):
> self.tv.get_model().append(None, row=(str(i), "Foo"))
>
> scrolled_window = gtk.ScrolledWindow()
> scrolled_window.add_with_viewport(self.tv)
> vbox.pack_start(scrolled_window, True, True)
>
> self.show_all()
>
> def cb_scroll(self, widget):
> selection = self.tv.get_selection()
> tm, tree_iter = selection.get_selected()
> path = tm.get_path(tree_iter)
> print path
> self.tv.scroll_to_cell(path)
> #gobject.idle_add(self.tv.scroll_to_cell, path)# This doesn't
> work either
>
> def destroy(self, widget, data=None):
> gtk.main_quit()
>
> if __name__ == "__main__":
> application = TreeviewTest()
> gtk.main()
>
>
I ran into this problem again recently and finally solved it.  Google turned
up my old post, so I will post the resolution in case it helps someone else.

The error in the above code is my use of the "add_with_viewport" method.
Since a treeview has native scrolling capability, I should have used the
"add" method instead (see
http://www.pygtk.org/docs/pygtk/class-gtkscrolledwindow.html#method-gtkscrolledwindow--add-with-viewport).
 Making that change to the code above fixes it!

HTH,
Karl
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

[pygtk] Seg. fault

2009-01-04 Thread Frédéric
Hello,

First, let me which you all the best for 2009.

Second, my apologies for cross-posting, but I have a problem under PyGTK on 
the maemo plateform, and I need some advices.

As you know, I develop a program to control a panoramic head. This program 
runs under linux/PC, windows/PC and Nokia/maemo (some reported it also 
runs on Openmoko as well).

But I experience a nasty problem: the program now crashes with seg. fault 
under maemo plateform, but runs fine under others. And I can't find what 
is causing this¹.

My question is: how can I find what is causing this problem? Are there some 
tools help? As my Nokia recently died, I can't make tests anymore, so I 
have to ask other people, people who don't know much about linux :o/

So if you have advices...

Thanks,

¹ The only strange thing I found is this warning, just before the crash:

/usr/lib/python2.5/site-packages/papywizard/controller/abstractController.py:120:
  Warning: g_object_get_qdata: assertion `G_IS_OBJECT (object)' failed
self.wTree.signal_autoconnect(self._signalDict)
/usr/lib/python2.5/site-packages/papywizard/controller/abstractController.py:120:
 
  Warning: g_type_get_qdata: assertion `node != NULL' failed
self.wTree.signal_autoconnect(self._signalDict)
Segmentation fault

-- 
Frédéric

http://www.gbiloba.org
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


[pygtk] [Announce] PyGobject 2.16.0 (stable)

2009-01-04 Thread Gian Mario Tagliaretti
I am pleased to announce version 2.16.0 of the Python bindings for GObject.

The new release is available from ftp.gnome.org as and its mirrors
as soon as its synced correctly:

 http://download.gnome.org/sources/pygobject/2.16/

What's new since PyGObject 2.15.4?
- gobject.timeout_add_seconds() not found in docs
  (Paul Pogonyshev, #547119)
- _wrap_g_output_stream_write_async not adding a reference to the
  buffer passed (Paul, #564102)
- gio.VolumeMonitor segfaults (Gian Mario Tagliaretti, #555613)
- Test if `domain' is not-null before using it to avoids segfaults
  (Paul, #561826)
- g_output_stream_write_all use gsize instead of gssize (Gian)
- add __repr__ to gio.Drive, gio.Mount and gio.Volume
  (Paul, #530935)
- Missing AC_CONFIG_MACRO_DIR([m4]) (Loïc Minier, #551227)
- Make codegen not import when corresponding argument types are not
  registered (Paul, #551056)
- Fix typos breaking compilation (Frederic Peters #551212)
- GFile load_contents methods chop data at first \0
  (Jonathan Matthew, #551059)

Blurb:

GObject is a object system library used by GTK+ and GStreamer.

PyGObject provides a convenient wrapper for the GObject library for use
in Python programs, and takes care of many of the boring details such as
managing memory and type casting.  When combined with PyGTK, PyORBit and
gnome-python, it can be used to write full featured Gnome applications.

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 requires glib >= 2.14.0 and Python >= 2.3.5 to build.
GIO bindings require glib >= 2.16.0.

cheers
-- 
Gian Mario Tagliaretti
GNOME Foundation member
gia...@gnome.org
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] need pygtkspell help

2009-01-04 Thread S.Selvam Siva
On Sun, Jan 4, 2009 at 3:26 PM, Gian Mario Tagliaretti wrote:

> On Sun, Jan 4, 2009 at 9:18 AM, S.Selvam Siva 
> wrote:
>
> Hi,
>
> > I am new to gtk and python.I am in a process of developing a spell
> > checker(for my local language-Tamil) plug in for gedit.
> > Recently i came to know about pygtkspell ,which can "underline misspelled
> > words","give suggestions on right clicking the misspelled word".
> > But could not find out any useful links about pygtkspell.
> > It will be helpful, if some one can point out useful links or details
> about
> > pygtkspell(Basically i need small example program)
>
> here we have some docs and examples for (py)gtkspell:
>
> reference:
> http://www.pygtk.org/pygtkspell/class-gtkspell.html
>
> examples:
> http://svn.gnome.org/viewvc/gnome-python-extras/trunk/examples/gtkspell/
>
>
> Thank you Gian Mario Tagliaretti for your response.

The example link was really useful and thanks again.



-- 
Yours,
S.Selvam
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] gtk_accel_groups_activate ()

2009-01-04 Thread Yann Leboulanger
Gian Mario Tagliaretti wrote:
> On Wed, Dec 31, 2008 at 9:55 AM, Yann Le Boulanger  
> wrote:
> 
>> Any idea why this function is not implemented in pygtk?
> 
> It's in the ignore list in gtk.override, I don't know why though.
> 
> If you want to remove it from ignore, recompile pygtk and test it, if
> it works we could fix it later, I suspect there is a reason why
> someone put it in the ignore section.

I'm not very faniliar with python bindings, so I won't be able to debug
anything :/

> please open a bug report.

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

-- 
Yann
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] need pygtkspell help

2009-01-04 Thread Gian Mario Tagliaretti
On Sun, Jan 4, 2009 at 9:18 AM, S.Selvam Siva  wrote:

Hi,

> I am new to gtk and python.I am in a process of developing a spell
> checker(for my local language-Tamil) plug in for gedit.
> Recently i came to know about pygtkspell ,which can "underline misspelled
> words","give suggestions on right clicking the misspelled word".
> But could not find out any useful links about pygtkspell.
> It will be helpful, if some one can point out useful links or details about
> pygtkspell(Basically i need small example program)

here we have some docs and examples for (py)gtkspell:

reference:
http://www.pygtk.org/pygtkspell/class-gtkspell.html

examples:
http://svn.gnome.org/viewvc/gnome-python-extras/trunk/examples/gtkspell/

HTH

cheers
-- 
Gian Mario Tagliaretti
GNOME Foundation member
gia...@gnome.org
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


[pygtk] need pygtkspell help

2009-01-04 Thread S.Selvam Siva
Hi,

I am new to gtk and python.I am in a process of developing a spell
checker(for my local language-Tamil) plug in for gedit.
Recently i came to know about* pygtkspell* ,which can "underline misspelled
words","give suggestions on right clicking the misspelled word".
But could not find out any useful links about pygtkspell.
It will be helpful, if some one can point out useful links or details about
pygtkspell(Basically i need small example program)


-- 
Yours,
S.Selvam
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/