[ruby-gnome2] segfault with Gtk::ListStore.reorder

Hi all.

Now my problem is with function from subject. When I use it in my
programs repeatedly in a table, I get a segmentation and program
terminates.

Example for reordering a 3 lines table:

   table.model.reorder([2,1,3])

If I try:

   table.model.reorder([1,0,2])

It fails too.

I don't know how can I use reorder exactly, but all I have probed
fails with segmentation error after a few uses.

               David

Hi,

--- David Espada <davinciSINSPAM@escomposlinux.org>
wrote:

Hi all.

Now my problem is with function from subject. When
I use it in my
programs repeatedly in a table, I get a
segmentation and program
terminates.

Example for reordering a 3 lines table:

   table.model.reorder([2,1,3])

If I try:

   table.model.reorder([1,0,2])

It fails too.

I don't know how can I use reorder exactly, but all
I have probed
fails with segmentation error after a few uses.

Are you on Windows? What GTK version? What Ruby
version? :slight_smile:

Cheers,
Joao

···

__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

Ops. Sorry, sorry, sorry :slight_smile:

I use ruby 1.8.1 from Debian Linux Sid (unstable).

Thanks for patience.

               David

···

El jueves 24 de junio, Joao Pedrosa escribió:

Now my problem is with function from subject. When I use it in my
programs repeatedly in a table, I get a segmentation and program
terminates.

Are you on Windows? What GTK version? What Ruby version? :slight_smile:

Hi,

--- David Espada <davinciSINSPAM@escomposlinux.org>
wrote:

>> Now my problem is with function from subject.
When I use it in my
>> programs repeatedly in a table, I get a
segmentation and program
>> terminates.
>
> Are you on Windows? What GTK version? What Ruby
version? :slight_smile:

Ops. Sorry, sorry, sorry :slight_smile:

I use ruby 1.8.1 from Debian Linux Sid (unstable).

Good. At least you aren't on Windows. :slight_smile:

If you could supply a short example that demonstrates
the problem, it would be cool.

Meanwhile I will try to reproduce it by creating such
an example.

Cheers,
Joao

···

El jueves 24 de junio, Joao Pedrosa escribió:

__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

I use ruby 1.8.1 from Debian Linux Sid (unstable).

Good. At least you aren't on Windows. :slight_smile:

Of course :wink:

If you could supply a short example that demonstrates the problem,
it would be cool.

Here you have example:

-----------------8<-----------------------------------
#!/usr/bin/ruby

require 'glib2'
require 'gtk2'

def reorder
  @model.reorder([0,1,2])
end

Gtk::init

ventana = Gtk::Window.new
ventana.set_title("Problem with ruby-gnome2")
ventana.signal_connect('delete_event') {exit}

vbox = Gtk::VBox::new(true, 10)

boton = Gtk::Button.new('Reorder', true)
boton.signal_connect('clicked') do reorder end

@model = Gtk::ListStore.new(String)
@tabla = Gtk::TreeView.new(@model)
@tabla.rules_hint = true

render = Gtk::CellRendererText.new
col = Gtk::TreeViewColumn.new('Title', render, {'text' => 0})

@tabla.append_column(col)

a = ['Hello', 'Bye', 'See you']
a.each do |t|
  l = @model.append
  l.set_value(0, t)
end

vbox.pack_start(@tabla, true, true, 0)
vbox.pack_start(boton, true, true, 0)

ventana.add(vbox)

ventana.show_all

Gtk.main
------------------------8<--------------------------------

You only have to press button repeatedly until program segs fault :frowning:

Greets.

               David

···

El jueves 24 de junio, Joao Pedrosa escribió:

Hi,

--- David Espada <davinciSINSPAM@escomposlinux.org>
wrote:

>> I use ruby 1.8.1 from Debian Linux Sid
(unstable).
>
> Good. At least you aren't on Windows. :slight_smile:

Of course :wink:

> If you could supply a short example that
demonstrates the problem,
> it would be cool.

Here you have example:

[snip]

I could reproduce it on Windows with both GTK 2.4.1
and 2.4.3 by Tor.

Windows 2000
Ruby 1.8.2 snapshot
Ruby-GTK from CVS compiled with MinGW against GTK
2.2.1.

Let's wait one of the core developers help us. :slight_smile: The
C function doesn't say anything for me.

PS: I just tried to compile the latest Ruby-GTK
version against the latest GTK binaries (2.4.3) by Tor
and gdkpixbuf still segfaults.

Cheers,
Joao

···

El jueves 24 de junio, Joao Pedrosa escribió:

__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

Hi,

El jueves 24 de junio, Joao Pedrosa escribi__:
>> I use ruby 1.8.1 from Debian Linux Sid (unstable).
>
> Good. At least you aren't on Windows. :slight_smile:

Of course :wink:

> If you could supply a short example that demonstrates the problem,
> it would be cool.

Here you have example:

<snip>

You only have to press button repeatedly until program segs fault :frowning:

Thanks. Your example is really helpful.
I'll try to fix it.

···

On Thu, 24 Jun 2004 20:43:13 +0900 David Espada <davinciSINSPAM@escomposlinux.org> wrote:

--
.:% Masao Mutoh<mutoh@highway.ne.jp>

FYI, on Fedora Core 1, using the system RPM for ruby-1.8.0 and
ruby-gnome2-0.9.1 compiled from source, I can click away without any
signs of trouble.

Lennon

Hi,

···

--- Lennon Day-Reynolds <rcoder@gmail.com> wrote:

FYI, on Fedora Core 1, using the system RPM for
ruby-1.8.0 and
ruby-gnome2-0.9.1 compiled from source, I can click
away without any
signs of trouble.

Thanks. Are you using GTK 2.4.x? Because I think this
method (reorder) is only for the newer GTK versions.
At least, on Windows, it didn't work with GTK 2.2.1.
:slight_smile:

Cheers,
Joao

__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail

Yes, I'm using a 2.4 version of Gtk. That could help to explain the difference.

Lennon

···

On Fri, 25 Jun 2004 10:57:36 +0900, Joao Pedrosa <joaopedrosa@yahoo.com> wrote:

Hi,

--- Lennon Day-Reynolds <rcoder@gmail.com> wrote:
> FYI, on Fedora Core 1, using the system RPM for
> ruby-1.8.0 and
> ruby-gnome2-0.9.1 compiled from source, I can click
> away without any
> signs of trouble.

Thanks. Are you using GTK 2.4.x? Because I think this
method (reorder) is only for the newer GTK versions.
At least, on Windows, it didn't work with GTK 2.2.1.
:slight_smile:

Cheers,
Joao

__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

http://promotions.yahoo.com/new_mail