Re: gtk.TreeView.set_model(TreeStore) expanders do not seem to work?



On 10/17/2009 05:16 PM, Daniel B. Thurman wrote:
In my application, I am populating a treestore with
new children, I then use the following method:

self.treeview.set_mode(treestore)

Apparently the treeview does not show expanders
where there are new children.

Is there something I need to do to show the expanders?

I have tried, with no effect:

self.treeview.expand_row(path, True)

Any suggestions I can try?


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
  
For your information, I finally figured out WHY the expanders
were not working.  There was no data added to them even though
by debug code to examine the the data was saying it was added to
the tree when in reality it was not!  Go figure.  But I did learn
something!  I have code that can be added in when the expander
is opened without resorting to or adding in dummy rows.  But
I am not sure how efficient the code is, but it seems to work.

What is left for me to do is to figure out:

(1) How to get a os.listdir(/) to work when there
      there are permission denied errors,  I am currently
      using the code below, which is probably not what I want:

      files = [f for f in os.listdir(dirname) if len(f[0]) <> 0]

      The problem is from within the os.listdir() method,
      so how is it possible to control this so that I can
      ignore/trap the permission denied or any other thrown
      errors and to continue on?

(2) Making sure that the code recognizes files that were
      deleted/added/moved from outside the application.

(3) How to get the Image/File cell to remain in compact
     form for each row and independently from every row.

(4) Add code so that the proper image file reflects what
     the file is, a pdf, music, device, etc., etc. but this is a
     feature that can be added later.

Basically, I am trying to implement what Nautilus does but
as an addon/plugin application to applications that can use
a tree structure within a window pane.  Filechooser does
not seem to have what I want, as it seems to pop up a dialog
instead of being embedded into a window pane of an integral
part of an application.

Maybe I am re-inventing the wheel?

I am willing to share the code I have for all to peruse and
to comment on so that it can be refined/improved for others
in their applications and if it is of any benefit, but apparently,
posting this code here seems to be blocked even if packed
inside an attached zip file?

Perhaps this is not the place to do this here, in this mailing list?

Any comments?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]