TreeView? (and: conceptual docs on Gtk2?)



Hello,

how to use the TreeView-Stuff?


My first thing I need, is a listing of columns/rows
that I get from a database.

If the output looks like that of a filesystem-viewer
(which normally shows filename, permissions, and some other things)
this would be fine.
Additionally in the first column I want a button for each
row, so that I for example can click on it, to delete the
item from the database.

What I found out so far from examples, is,
that there must be a data-model and a view
be created and then the data inserted into the
data-model, and the view must be udated.
(Is this update done automatically by gtk? Can it be
done with/without automatic update? Is this possible to change?)


I have no complete working example, only tried some things and got this
minimal stuff here:

===============================

my $renderer = Gtk2::CellRendererText->new;

my $column = Gtk2::TreeViewColumn -> new_with_attributes ("Nachname",
$renderer);
$view->append_column($column);

$column = Gtk2::TreeViewColumn -> new_with_attributes ("Vorname",
$renderer);
$view->append_column($column);

$column = Gtk2::TreeViewColumn -> new_with_attributes ("Vorwahl",
$renderer);
$view->append_column($column);

$column = Gtk2::TreeViewColumn -> new_with_attributes ("Telefon-Nummer",
$renderer);
$view->append_column($column);

$globvbox->pack_start($view, FALSE, FALSE, 0);

===============================

At least I got some coulmn-headers on the screen,
but that's all.

My question is now: how to insert data into the model,
how to access that stuff?

What kinds of "CellRenderer"s are available?
Is there an overview on the many possibilities?

The same questions for the Models: what different Models are
available?

Is there a tutorial, that makes it easy to start with that stuff?
I'm relatively new to Gtk2-Perl (and Gtk2), so this is not just
another widget for me. I'm also loking for documentations on the
concepts of Gtk2, because I have not found a conceptual paper on it.

There are tutorials, but they are not explaining the whole concept in a
way, that one can understand, why one usese some methods and others
not... So, independent of a help for the TreeView-Widget-Stuff,
I'm also looking for some more overvieww documentation.


TIA,
  Oliver



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