Gtk2 InfoBar class

Hello

I have pushed an implementation for gtk infobar (cf: Gtk::InfoBar
class).
A sample code is given in gtk2/sample/misc/infobar.rb file.

Gtk::InfoBar#add_buttons is not implemented as I was not sure how to
write
this method.
But Gtk::InfoBar#add_button can be called several times.

cool - nice one!

  • j

Great!

I love those examples - they are short and to the point of what a widget
does. I learned a great deal about ruby-gtk that way. :slight_smile:

Le 24 fvrier 2012 17:11, Marc H. [email protected]
a
crit :

Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/


ruby-gnome2-devel-en mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en

Jake and Marc, you are most welcome.
I am glad you like this piece of work.

On Sat, Feb 25, 2012 at 12:19 AM, grant schoep [email protected]
wrote:

I’m on CentOS 5.7
gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
Ruby 1.9.2p290

Note, that I am on a 64 bit machine, and I see it did compile all with
-fPIC. I did a bit of google to trying to figure out what this message
means. Saw some things that hinted at issues with global name space
issues,
but nothing helped. I can drop out the 3 changes from your commit and
all
builds fine.

Hi, Vincent.

Great work!

A few comments though:

  • I think GTK_TYPE_MESSAGE_TYPE should be defined as Gtk::MessageType.
    (similar to Gtk::PositionType and others)
    Just for your information, I’ve attached enum list.

  • I think GTK_TYPE_RESPONSE_TYPE should be defined as Gtk::ResponseType.

Sorry for too late reply.

I get a link problem now with this addition. Everything gets done
compiling, then at the link step it bombs

/usr/bin/ld: init.o: relocation R_X86_64_PC32 against `Init_gtk_infobar’
can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[1]: *** [gtk2.so] Error 1

I’m on CentOS 5.7
gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
Ruby 1.9.2p290

Le 25 fvrier 2012 01:19, grant schoep [email protected] a crit :

I’m on CentOS 5.7


ruby-gnome2-devel-en mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en

Hi Grant

Thank for this report. I have no clue at the moment on how to fix this
error.
Futhermore I am on a 32 bits machine.
Which kernel are you using ? (uname -a)
Did you try to compile from a clean tree?
(
make realclean
ruby1.9 extconf.rb gtk2
make
)

Can someone using a 64 bits machine confirm this bug ?

Le 25 fvrier 2012 07:20, Masaaki A. [email protected] a crit
:

Hi Masaaki

Thanks for your compliment.
I agree that GTK_TYPE_MESSAGE_TYPE should be defined as Gtk::MessageType
but they are all ready defined as Gtk::MessageDialog::Type that is why I
redefined it as Gtk::InfoBar::Type.
I propose to define GTK_TYPE_MESSAGE_TYPE as Gtk::MessageType,
keep Gtk::MessageDialog::Type for compatibility sake and remove
Gtk::InfoBar::Type as no one except me should have write code
including this constant.

I agree that GTK_TYPE_MESSAGE_TYPE should be defined as Gtk::MessageType
but they are all ready defined as Gtk::MessageDialog::Type that is why I
redefined it as Gtk::InfoBar::Type.
I propose to define GTK_TYPE_MESSAGE_TYPE as Gtk::MessageType,
keep Gtk::MessageDialog::Type for compatibility sake and remove
Gtk::InfoBar::Type as no one except me should have write code
including this constant.

I agree with you.

Thanks,

Le 26 fvrier 2012 01:24, Masaaki A. [email protected] a crit
:

/usr/bin/ld: final link failed: Bad value

make
@@ -117,10 +117,12 @@ rg_response(VALUE self, VALUE response_id)
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_INFO_BAR,
+}

Thanks,

I have taken into your comment and upload changes (GTK_CHECK_VERSION patch
and constant definition).
Thanks for time.

Grant can you confirm your problem is fixed?

Hi,

2012/2/25 Vincent C. [email protected]:

also focuses on allowing computing to be delivered as a service.
error.
Futhermore I am on a 32 bits machine.
Which kernel are you using ? (uname -a)
Did you try to compile from a clean tree?
(
make realclean
ruby1.9 extconf.rb gtk2
make
)

Can someone using a 64 bits machine confirm this bug ?

I think need to be changed as follows:

diff --git a/gtk2/ext/gtk2/rbgtkinfobar.c b/gtk2/ext/gtk2/rbgtkinfobar.c
index 30227a0…5d2e44e 100644
— a/gtk2/ext/gtk2/rbgtkinfobar.c
+++ b/gtk2/ext/gtk2/rbgtkinfobar.c
@@ -117,10 +117,12 @@ rg_response(VALUE self, VALUE response_id)
gtk_info_bar_response(_SELF(self), RVAL2GENUM(response_id,
GTK_TYPE_RESPONSE_TYPE));
return self;
}
+#endif

void
Init_gtk_infobar(VALUE mGtk)
{
+#if GTK_CHECK_VERSION(2,18,0)
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_INFO_BAR,
“InfoBar”, mGtk);

 RG_DEF_METHOD(initialize, -1);

@@ -148,5 +150,5 @@ Init_gtk_infobar(VALUE mGtk)
/* GtkResponseType. Allready defined in rbgtkdialog.c */
G_DEF_CLASS(GTK_TYPE_RESPONSE_TYPE, “ResponseType”,
RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_RESPONSE_TYPE,
“GTK_”);
-}
#endif
+}

Thanks,

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