Gtk2::TreeView

Discussion in 'Perl Misc' started by David Green, Oct 22, 2004.

  1. David Green

    David Green Guest

    Hey,
    I've got a problem getting gtk2's tree-view widget to work, not helped by
    the fact the widget is undocumented in the GTK2 api. I can't seem to
    decipher the perl bindings for it either.

    What I'd like to do is create a tree-structure, ie

    Fruit
    |
    |------Apples
    |----Granny Smith
    |----Old English
    |------Pears
    |------Tomatoes

    I'm aware I need to use a tree store,
    --
    David Green ()
    Hands up for human rights!
    http://www.amnesty.org
     
    David Green, Oct 22, 2004
    #1
    1. Advertising

  2. David Green

    David Green Guest

    (appologies for multipart)

    > I'm aware I need to use a tree store,


    # Define a tree store to expect two strings
    my $tree_store = new Gtk2::TreeStore ("Glib::String", "Glib::String");
    # Create the first empty row
    my $iter = $tree_store->append (undef);
    # Add the row
    $tree_store->set_value ($iter, "0", "A string", "1", "Some other string");
    # ... <snip> more rows added via above method
    # Bind the model to the treeView
    my $tree_view = new Gtk2::TreeView($tree_store);

    I then add the treeview to a container (HBox) and a get a white box with
    no content - I've tried various possibilities for set_value but still
    accept I could be wholly wrong here?

    What am I doing wrong or can anyone suggest any further documentation?

    With thanks,
    Dave
    --
    David Green ()
    Hands up for human rights!
    http://www.amnesty.org
     
    David Green, Oct 22, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Basile STARYNKEVITCH
    Replies:
    0
    Views:
    327
    Basile STARYNKEVITCH
    Sep 2, 2003
  2. Basile STARYNKEVITCH

    ANN: Guis 1.4 release (GTK2 scriptable widget server)

    Basile STARYNKEVITCH, Sep 6, 2003, in forum: Python
    Replies:
    2
    Views:
    317
    Basile STARYNKEVITCH
    Sep 6, 2003
  3. Lorenzo Gatti
    Replies:
    0
    Views:
    404
    Lorenzo Gatti
    Apr 2, 2004
  4. netnobbi

    GTK2: no images are displayed

    netnobbi, Feb 23, 2006, in forum: C++
    Replies:
    2
    Views:
    281
    Phlip
    Feb 23, 2006
  5. oxman
    Replies:
    3
    Views:
    93
Loading...

Share This Page