Re: treeview Tab control



Totally correct,

problem is: I just don't know how to get the value in the editable.
That's what I tried:

bool ExampleWindow::on_key_press(GdkEventKey* event)
   {
      std::cout << event->keyval << "\n";
      Gtk::CellRenderer* r=m_TreeView.get_column_cell_renderer (1);
      Gtk::CellRendererText* cr=dynamic_cast<Gtk::CellRendererText*>(r);
      std::cout << cr->gobj()->text << "\n";
   }

I only get the "old" value stored in the treeview. Not the one in the editable.


-------- Original-Nachricht --------
> Datum: Mon, 9 Nov 2009 11:24:18 +0600
> Von: "Галымжан Кожаев" <kozhayev gmail com>
> An: "José Alburquerque" <jaalburquerque cox net>
> CC: Thomas Sommer <mawa15 gmx de>, gtkmm-list gnome org
> Betreff: Re: treeview Tab control

> Hi, Thomas!
> You wrote that hitting Tab erases cell, restoring it to value stored
> in TreeStore. What if you will somehow get the text in edited column
> and manually set the value in TreeStore using that key_pressed
> handler? I think text is getting lost because treeview displays data
> in model (in our case treestore), am I right ?
> 
> 2009/11/5, José Alburquerque <jaalburquerque cox net>:
> > On Wed, 2009-11-04 at 22:03 +0100, Thomas Sommer wrote:
> >> Hi Jose,
> >>
> >> you will find the hacked treeview from the gtkmm examples in the
> >> attachment.
> >>
> >> Basically all I did was attaching on_key_press() to signal_key_pressed.
> >> Funny thing tough: If I add the column
> >>
> >> m_TreeView.get_columns();
> >>
> >> to the attached function, everything works as I would expect it.
> >> It just does not seem to make any sense to me.
> >
> > It doesn't make sense to me either.  What I would suggest is that you
> > guide yourself from the example that you hacked.  On this system the
> > example works fine (with tabs, etc.) as you also want.  I can't tell
> > definitely but, once more, my guess would be that if you handle key
> > presses, I don't think that you need to pay special attention to the tab
> > key.  This is just a guess as I'm going by how the original example
> > works on this system.
> >
> > --
> > José
> >
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser


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