logo       

Problems getting the TreeIter data for a custom TreeModel: msg#00177

Subject: Problems getting the TreeIter data for a custom TreeModel
Hi,

For the past couple of weeks, I've been working on a custom TreeModel
that's essentially a proxy for a SQL database.  I've managed to get it
more or less working (I can actually see the whole tree structure :o) but
I'm still having some trouble with TreeIters.

For instance, I've got a set method that looks like this:

sub set {
  my $self = shift;
  my $iter = shift;
        
  die "not my iterator" unless $iter->[0] == $self->{_stamp};

  my %vals = @_;

  while (my ($col, $val) = each %vals) {
    if ($col == NAME_COL) {
      my $sql = "UPDATE list SET name = $val WHERE id = " . $iter->[1];
      $self->{_dbh}->do($sql);
    }
  }
}

But this doesn't seem to work, because the code that calls $model->set
uses an actual Gtk2::TreeIter.  The binding code for the TreeModel
interface converts between array references and GtkTreeIters as necessary
using the iter_from_sv and sv_from_iter functions; is there any way I can
specifically request this conversion from Perl code?  If not, is there
some other way I can get at the data inside the TreeIter?

Any help you can give me would be much appreciated!  I've tried to include
all the information I have about the problem, but if I missed something,
feel free to ask for it :o)

I've also got another TreeIter problem, but it's not related to this, so
I'll put it in another mail.

Thanks!
Zach

-- 
And I say, Give me back my memory, or I'll rip you into three boy scouts
and a watchband!
                                           ---Aaron in "Remind Me Again"
------------------------------------------------------------------------
Zach Bean, zb@xxxxxxxxxx, web@xxxxxxxxxx          http://www.forty2.com

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe