Forum: Ruby-Gnome 2 gtk2 to gtk3 : create a dialog

B078cb4f4fb473c7a54d1fc36d10c70e?d=identicon&s=25 Regis d'Aubarede (raubarede)
on 2013-04-15 18:26
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,
4913bcb685792f601ae9813b4713abb9?d=identicon&s=25 Detlef Reichl (Guest)
on 2013-04-15 18:59
(Received via mailing list)
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
B078cb4f4fb473c7a54d1fc36d10c70e?d=identicon&s=25 Regis d'Aubarede (raubarede)
on 2013-04-15 19:26
that's work!
thank you,
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.