# Gtk2 to gtk3 : create a dialog

**URL:** <https://www.ruby-forum.com/t/gtk2-to-gtk3-create-a-dialog/228258>\
**Category:** Ruby-Gnome 2\
**Created:** [April 15, 2013, 6:26pm UTC](https://www.ruby-forum.com/t/gtk2-to-gtk3-create-a-dialog/228258 "2013-04-15T18:26:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raubarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@raubarede](https://www.ruby-forum.com/u/raubarede)\
**Post date:** [April 15, 2013, 6:26pm UTC](https://www.ruby-forum.com/t/gtk2-to-gtk3-create-a-dialog/228258/1 "2013-04-15T18:26:38Z")

</div>

Hello,

This code come from gtk2 application :

wdlog = Dialog.new(“Logs”,  
nil,  
0,  
[Stock::OK, Dialog::RESPONSE\_NONE])

How to convert it for gtk3 ?  
I try

wdlog = Dialog.new(  
title: “Logs”,  
parent: nil,  
flags: 0,  
buttons: [Stock::OK, Dialog::RESPONSE\_NONE]  
)

But that not work :  
COMPONENT() : not a Gtk::ResponseType: false :  
…/2.0.0/gems/glib2-1.2.6-x86-mingw32/lib/glib2/deprecatable.rb:47:in  
`add_buttons' ..../2.0.0/gems/glib2-1.2.6-x86-mingw32/lib/glib2/deprecatable.rb:47:in`initialize’  
…/2.0.0/gems/glib2-1.2.6-x86-mingw32/lib/glib2/deprecatable.rb:47:in  
`block in define_deprecated_method_by_hash_args' ...Ruiby/lib/ruiby_gtk/ruiby_dsl3.rb:1324:in`new’  
…

Thank you,

---

<div class="post-metadata">

**Author:** ![raubarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@raubarede](https://www.ruby-forum.com/u/raubarede)\
**Post date:** [April 15, 2013, 6:59pm UTC](https://www.ruby-forum.com/t/gtk2-to-gtk3-create-a-dialog/228258/2 "2013-04-15T18:59:28Z")

</div>

Hi,

Am 15.04.2013 18:26, schrieb Regis d’Aubarede:

> How to convert it for gtk3 ?  
> I try
> 
> wdlog = Dialog.new(  
> title: “Logs”,  
> parent: nil,  
> flags: 0,  
> buttons: [Stock::OK, Dialog::RESPONSE\_NONE]  
> )

the stock-id’s and response codes have all together to be enclosed in  
brackets.

[[id1, respons1], [id2, respons2], [id3, respons3]]

Cheers, detlef

---

<div class="post-metadata">

**Author:** ![raubarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@raubarede](https://www.ruby-forum.com/u/raubarede)\
**Post date:** [April 15, 2013, 7:26pm UTC](https://www.ruby-forum.com/t/gtk2-to-gtk3-create-a-dialog/228258/3 "2013-04-15T19:26:06Z")

</div>

that’s work!  
thank you,
