Re: [pygtk] CList

2004-09-14 Thread Christian Robottom Reis
On Tue, Sep 14, 2004 at 02:37:40PM -0400, Jamey Cribbs wrote:
> Every few months, I grab the latest version of pygtk and attempt to 
> duplicate the CList functionality using TreeView, but to no avail.  I 
> have done a lot of reading, attempted to use 

You should also grab an updated version of GTK+ -- that's where the
important Treeview speedups would happen, not inside PyGTK.

> Liststore/TreeModelSort/TreeView combinations, read up on how to handle 
> large datasets, etc..  Not only does this seem WAY more complicated than 
> it needs to be, it also is slower than the CList.

It's way more complicated in part because it needs to do a lot more. It
would certainly be possible to write a CList-compatible Treeview wrapper
in Python that took care of the gory details for you (without slowing
it down in any way significant IMO); I think that's something that's
definitely missing.

You say you have a sorting problem with Treeview that doesn't exist in
CList -- can you be more specific about that?

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
___
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] PyGTK + glade + freeze

2004-09-14 Thread Luca Masini
On Tue, 14 Sep 2004 15:10:41 -0400 (EDT), Stuart Brorson <[EMAIL PROTECTED]> 
wrote:

I have written a PyGTK app using glade, and am now trying to freeze
it.  I installed the freeze package from Python 2.2.3, and build the
executable using the instructions included in the README.  However,
when I run the executable, it throws an exception when I do "import
pygtk" and/or "import glade".  The app works fine when run as a Python
script.
While investigating this problem, I have learned that freeze isn't
that useful when your app calls shared libraries.  Therefore, I have
tried rebuilding everything -- PyGTK and Python -- using static libs,
and have tried static links to their .a libraries.  HOwever, this
still doesn't work.
Questions:
[snipped]
*  Has anybody here frozen a PyGTK app?  Do you have any pointers,
suggestions, or things to look for?
I have successfully frozen a PyGTK application using cx_Freeze.
Take a look at this URL:
  http://freshmeat.net/projects/cx_freeze/?topic_id=46
___
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] listviews

2004-09-14 Thread Doug Quale
Keir Lawson <[EMAIL PROTECTED]> writes:

> im trying to use a list view to show a simple two-collumed list, how
> ever im finding it extremly difficult to perform this simple task,
> throughout the documentation i cannot find a fully worked example of a
> listveiw, only a treeview, could someone point me at an example of give
> me one please.

Strictly speaking, GTK+ doesn't have a listview.  It has a single
TreeView widget that can be associated with a tree model or a list
model.  The standard list model in GTK+ is the ListStore.

This means that from the TreeView side, a 2-column list looks exactly
like a 2-column tree.  The TreeView and TreeColumns are set up the
same in either case.  The only difference is in the type of model you
use.

There is some help available in the pygtk FAQ.  If you search the FAQ
for "ListStore" you'll get several hits.  All of them are worth
reading.  (Actually it's worthwhile to read the entire FAQ section on
TreeView.)  FAQ 13.6 How do I put icons in a TreeView? provides a
simple complete example using a ListStore.

You can find another example in the pygtk distribution itself in
examples/pygtk-demo/demos/list_store.py

If you find these examples lacking let us know how they can be
improved.  Maybe new examples should be added.
___
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] PyGTK + glade + freeze

2004-09-14 Thread Stuart Brorson
Hi PyGTKkers --

I have written a PyGTK app using glade, and am now trying to freeze
it.  I installed the freeze package from Python 2.2.3, and build the
executable using the instructions included in the README.  However,
when I run the executable, it throws an exception when I do "import
pygtk" and/or "import glade".  The app works fine when run as a Python
script.  

While investigating this problem, I have learned that freeze isn't
that useful when your app calls shared libraries.  Therefore, I have
tried rebuilding everything -- PyGTK and Python -- using static libs,
and have tried static links to their .a libraries.  HOwever, this
still doesn't work.  

Questions:

*  Are there any useful docs on the web discussing specifically how to
freeze PyGTK apps?  I've Googled around, but haven't found anything
specific to PyGTK.

*  Does anybody know if Tkinter is lurking around in the background of
GTK?  I have read a lot about TCL/Tk problems encountered while
freezing Python apps.  If this stuff is not used by GTK, I will just
try deleting it from my -L path 'cause it's a .so.

*  Has anybody here frozen a PyGTK app?  Do you have any pointers,
suggestions, or things to look for?

Thanks for any and all hints,

Stuart
___
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] listviews

2004-09-14 Thread Danny Milosavljevic
Hi,

Am Dienstag, den 14.09.2004, 17:34 +0100 schrieb Keir Lawson:
> im trying to use a list view to show a simple two-collumed list, how
> ever im finding it extremly difficult to perform this simple task,
> throughout the documentation i cannot find a fully worked example of a
> listveiw, only a treeview, could someone point me at an example of give
> me one please.

isnt a listview just a treeview with a ListModel ?


model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
view = gtk.TreeView()
view.set_model(model)

cell0 = gtk.CellRendererText()
col0 = gtk.TreeViewColumn("stuff", cell0, text = 0) # number of the
column in the model
view.append_column(col0)

cell1 = gtk.CellRendererText()
col1 = gtk.TreeViewColumn("stuff2", cell1, text = 1) # number of the
column in the model
view.append_column(col1)

iter = model.append(None)
model.set_value(iter, 0, "stuff")
model.set_value(iter, 1, "there")

sw = gtk.ScrolledWindow()
sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
sw.add(view)
sw.show_all()

# add sw to your window


Or am I missing something ? :)
> 
> Keir Lawson
> 
> 
> ___
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
> 
-- 
www.keyserver.net key id A334AEA6



signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
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] CList

2004-09-14 Thread Jamey Cribbs
I know that the CList widget is deprecated in pygtk2, but does anyone 
know how long it will actually be around?

The reason I ask is that I am having lots of trouble duplicating it's 
functionality and speed using the TreeView widget.  I have been 
attempting to do this ever since the TreeView widget came out.

Every few months, I grab the latest version of pygtk and attempt to 
duplicate the CList functionality using TreeView, but to no avail.  I 
have done a lot of reading, attempted to use 
Liststore/TreeModelSort/TreeView combinations, read up on how to handle 
large datasets, etc..  Not only does this seem WAY more complicated than 
it needs to be, it also is slower than the CList.

Basically, I use the CList as a multi-column listbox to show rows from a 
database.  I know that this can easily be done using TreeView.  Where it 
gets complicated is when you want to sort the TreeView or refresh the 
data from the database and you want the current sort and selected record 
to be shown.  In other words, when I refresh the view or when I return 
to the view from editing a single record, I want it to be sorted the 
same way it was, with the same selected record showing.

This is very complicated using TreeViews, especially because I have 
resorted to using TreeModelSort in order to try and speed up the very 
slow sort times when refreshing data in a view.

Anyway, sorry to rant.  I really just want to know how long I can count 
on CList being in pygtk2.  CList is a great widget and it handles all of 
my needs just fine.

Thanks.
Jamey
Confidentiality Notice: This email message, including any attachments, is for the sole 
use of the intended recipient(s) and may contain confidential and/or privileged 
information. If you are not the intended recipient(s), you are hereby notified that 
any dissemination, unauthorized review, use, disclosure or distribution of this email 
and any materials contained in any attachments is prohibited. If you receive this 
message in error, or are not the intended recipient(s), please immediately notify the 
sender by email and destroy all copies of the original message, including attachments.
___
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] listviews

2004-09-14 Thread Skip Montanaro

Keir> im trying to use a list view to show a simple two-collumed list,
Keir> how ever im finding it extremly difficult to perform this simple
Keir> task, throughout the documentation i cannot find a fully worked
Keir> example of a listveiw, only a treeview, could someone point me at
Keir> an example of give me one please.

FWIW, I prefer to use Tables for these simple cases.  They are much easier
to use.

-- 
Skip Montanaro
Got spam? http://www.spambayes.org/
[EMAIL PROTECTED]
___
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] listviews

2004-09-14 Thread Keir Lawson
im trying to use a list view to show a simple two-collumed list, how
ever im finding it extremly difficult to perform this simple task,
throughout the documentation i cannot find a fully worked example of a
listveiw, only a treeview, could someone point me at an example of give
me one please.

Keir Lawson


___
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] PyGTK reference, set_search_equal_func, set_search_column

2004-09-14 Thread Thomas Mills Hinkle
I recently used the treeview.set_search_equal_func(func) for the
first time and found its behavior somewhat counterintuitive. The
function you hand it needs to return false for a match and true for a
non-match. It struck me that this would be worth adding to the pygtk
reference entry for that function.

Another question: can anyone think of how one might break
set_search_column(). In my app I couldn't get it to work correctly (the
search column remained 0 even when I called tv.set_search_column(3).
Anyway, when I tried to cook up a simple example, I couldn't reproduce
the behavior. I don't begin to understand where my code could have
thrown this off -- needless to say, the function tv.set_search_column(0)
appears nowhere in the program.

It's not urgent -- I used set_search_equal_func() instead
and that works (and gave me some additional control over the
interactive search).

Thanks for any thoughts, and thanks to John Finlay for maintaining
the excellent docs.

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