# GtkMessageType

**URL:** <https://www.ruby-forum.com/t/gtkmessagetype/215969>\
**Category:** Ruby-Gnome 2\
**Created:** [January 20, 2012, 8:32pm UTC](https://www.ruby-forum.com/t/gtkmessagetype/215969 "2012-01-20T20:32:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 20, 2012, 8:32pm UTC](https://www.ruby-forum.com/t/gtkmessagetype/215969/1 "2012-01-20T20:32:10Z")

</div>

Hello

I am working on the implementation of GtkInfoBar [  
[http://developer.gnome.org/gtk/stable/GtkInfoBar.html](http://developer.gnome.org/gtk/stable/GtkInfoBar.html)].  
It uses GtkMessageType [  
[http://developer.gnome.org/gtk/stable/GtkMessageDialog.html#GtkMessageType](http://developer.gnome.org/gtk/stable/GtkMessageDialog.html#GtkMessageType)].  
This types are currently define under Gtk::MessageDialog.  
It seems awkward to use Gtk::MessageDialog::INFO while working  
with Gtk::InfoBar class.  
Should I redefine the type under Gtk::InfoBar (i.e. Gtk::InfoBar::INFO)  
?  
Should we have defined the type under Gtk::Message (non existing) module  
?  
What is the more rubyish way ?

In order not to break compatibility I would go with the redifinition:  
both Gtk::MessageDialog::ERROR Gtk::InfoBar::ERROR set to the same value  
(ERROR of GtkMessageType enum).

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [January 20, 2012, 9:51pm UTC](https://www.ruby-forum.com/t/gtkmessagetype/215969/2 "2012-01-20T21:51:59Z")

</div>

I am looking at Gtk::Dialog#add\_buttons in order to implement  
Gtk::InfoBar#add\_buttons.

Can someone explain me the choices made for this implementation ?

Why using gtk\_dialog\_add\_button and not gtk\_dialog\_add\_buttons ?  
Why freezing the object during the processus ?  
Why using 2 rbgtk\_dialog\_add\_buttons\_internal\_\* functions ?

I would like to avoid a wrong implementation for  
Gtk::InfoBar#add\_buttons  
and to understand a bit better the C code.
