Moving rows included on a gtk treeview using a single button

Hello everybody i’m new here :), I’m trying to get handle of gtk
treeviews,
right now, i know how to create rows, columns and some else, but i have
a
problem, i want to move the rows using a button, come on the classic up
and
down, well i don’t an idea to do that =/ i’m learning about ruby + gtk,
i
think this combination is simply wow, here is the code i’m using glade,
libglade can someone let me a little of light?, some example to do that
or
just talk me something about, using glade or simple gtk.

here you can see my screenshot:

http://img214.imageshack.us/img214/9959/treeviewzf4.png

how you can see, i’m following some of your examples.
watch the picture too, to get a better idea.

I extend my regards to everyone greetings.

Julio César Sosa Yeladaqui.

±----------------------
+treeview.rb
±----------------------

#!/usr/bin/env ruby

=begin
treeview.rb - Ruby/Libglade2 sample script.

Copyright © 2002-2006 Ruby-GNOME2 Project Team
This program is licenced under the same licence as Ruby-GNOME2.

$Id: treeview.rb,v 1.5 2006/06/17 14:14:55 mutoh Exp $
=end

Manejo y control de Listas o treeview de gtk mediante glade en Ruby

Crear ---------- Si

Ordenar -------- Si

Eliminar ------- Pendiente

Mover Arriba/Abajo -------Pendiente

require ‘libglade2’

class Treeview
def initialize(path)
@glade = GladeXML.new(path) {|handler| method(handler)}
@treeview = @glade[“treeview1”]
@model = Gtk::TreeStore.new(String, String)

crt = Gtk::CellRendererText.new

column = Gtk::TreeViewColumn.new(“Test”, Gtk::CellRendererText.new,

{:text => 0})

column2 = Gtk:: TreeViewColumn.new(“hola”,

Gtk::CellRendererText.new,
{:text => 1})

column = Gtk::TreeViewColumn.new("Test", crt, {:text => 0})
column2 = Gtk::TreeViewColumn.new("hola", crt, {:text => 1})

#-----------------------------------------

root_iter = @model.append(nil)

rootx_iter = @model.append(nil)

#-------------------------------------
@treeview.append_column (column)

root_iter.set_value(0, "hello guys")

rootx_iter.set_value(0, "moco")

child1 = @model.append(root_iter)

child1.set_value(0, “Child1”)

@treeview.set_model(@model)

#-------------------------------------
@treeview.append_column(column2)

root_iter = @model.append(nil)

root_iter.set_value(1, "jojojo")

rootx_iter.set_value(1, "loco")

hijo_col2 = @model.append(root_iter)

hijo_col2.set_value(1, “yo no jui”)

#--------------------------------------
@treeview.set_model (@model)

@treeview.set_size_request(200, 200)

end
end

Treeview.new(“treeview.glade”)
Gtk.main

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs