Re: [pygtk] need advises on treeview use for memory puprose

2005-07-05 Thread David M. Cook
On Tue, Jul 05, 2005 at 04:10:25PM +0200, [EMAIL PROTECTED] wrote:

> I'm using lot of treeviews.


> Is it better in memory purpose to:
> 1. use the gtk.treestore as data storage. (have an entry in the model 
> for each simple type str ... or use a more complex object ?).

It's a lot more flexible and easier to manage to append objects (I use
dictionaries) to the store and then use a data_func to display the data.

Also, If you have large amounts of data, consider implementing the UI with
ListStoress instead of TreeStores.  GTK's TreeStore is just not very
efficient for large datasets.

> 2. have an independent data storage. (when a row is selected, we search 
> the name of the selectedComponent, find it in the dataStorage and modify 
> the dataStorage).

Depends on how much data you have and how much the user is expected to
display at any one time.  You would probably want to implement some kind of
lazy loading for a large dataset if they user will only be accessing a small
part of it at any one time.

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] missing function

2005-07-05 Thread Le Boulanger Yann

why is the gtk_widget_list_accel_closures function not wrapped ?
gtk_widget_list_mnemonic_labels is wrapped and it seems it's quite the 
same thing.


maybe there is a good reason ?
Is there a workaround to know if a meuitem has an accelerator ?

Thx in advance
Yann
___
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] need advises on treeview use for memory puprose

2005-07-05 Thread [EMAIL PROTECTED]

Hi list,

I'm using lot of treeviews.

Is it better in memory purpose to:
1. use the gtk.treestore as data storage. (have an entry in the model 
for each simple type str ... or use a more complex object ?).
2. have an independent data storage. (when a row is selected, we search 
the name of the selectedComponent, find it in the dataStorage and modify 
the dataStorage).



Hope my question is clear enough =).
Thanks a lots for you answers,
Philippe Collet



___
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] TextView

2005-07-05 Thread Paul Malherbe
Eric Jardim wrote:

> On 7/4/05, *Paul Malherbe* <[EMAIL PROTECTED]
> > wrote:
>
> What I would like to do, when this occurs, is display a TextView
> widget
> directly under the Entry widget and display each character entered so
> that with the formatting facilities of the TextView the operator would
> be able to view all the text. Once the text has been accepted, the
> TextView would be deleted. 
>
>
> Sounds easy. Lay out your widgets on a VBox, with the Entry above the
> TextView. Set the textview's visibility to false. Connect signal to
> the Entry, so you can detect when it's text length is greater than 150
> chars.
>
> When it happens, copy the text to the textviews buffer and set the
> visibility to true. And it will apear "magicaly" under the Entry.
>
> But this approach might not be intuitive for the user. You should try
> something like a button aside of the Entry which turns it into a
> TextView, or pops up a TextView dialog, or something like that.
>
> Anyway, does this trick help?
>
> [Eric Jardim]

Hello Eric

Yes, thank you, this does help where I can use a vertical box.

In some instances, however, I have a table with many rows and columns
and it is here that I have the width constraints e.g. capturing
transactions where I have the date, reference number, details, amount,
discount etc and the details field can be 150 characters long.

In this case I would like to create a TextView and place it under the
details field as and when required i.e. when the data entered exceeds
the widget width.

Can you think of any way I could achieve this.

Thanks, Paul

___
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] Clearing treeviews...

2005-07-05 Thread Prash
model = treeview.get_model()
model.clear()

This should do it. If it does not then call 
treeview.queue_draw()

after.


On 7/4/05, Rob Marino <[EMAIL PROTECTED]> wrote:
>  Hi.
>  
>  I'm writing an app which uses a tree view/liststore...
>  
>  Can anyone please tell me how to easily/efficiently clear a tree view? I've
> called the clear() method on the liststore but AFAICS it does not work ..
>  
>  thanks.
>  
>  RM
>  -- 
>  O__
>  _/`.\
>  `=( '
> 
> 
>  
> ___
> 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 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] TextView

2005-07-05 Thread Eric Jardim
On 7/4/05, Paul Malherbe <[EMAIL PROTECTED]> wrote:
What I would like to do, when this occurs, is display a TextView widget
directly under the Entry widget and display each character entered sothat with the formatting facilities of the TextView the operator wouldbe able to view all the text. Once the text has been accepted, theTextView would be deleted.

Sounds easy. Lay out your widgets on a VBox, with the Entry above the
TextView. Set the textview's visibility to false. Connect signal to the
Entry, so you can detect when it's text length is greater than 150
chars.

When it happens, copy the text to the textviews buffer and set the
visibility to true. And it will apear "magicaly" under the Entry.

But this approach might not be intuitive for the user. You should try
something like a button aside of the Entry which turns it into a
TextView, or pops up a TextView dialog, or something like that.

Anyway, does this trick help?

[Eric Jardim]
___
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/