After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 108511 - gtk_grab_add/remove isn't wrapped
gtk_grab_add/remove isn't wrapped
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.4
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-03-16 12:07 UTC by Ole Laursen
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds wrappers of the functionality (4.85 KB, patch)
2003-04-12 17:34 UTC, Ole Laursen
none Details | Review
Patch for ChangeLog too (5.72 KB, patch)
2003-04-13 17:05 UTC, Ole Laursen
none Details | Review

Description Ole Laursen 2003-03-16 12:07:24 UTC
gtk_grab_add and friends aren't wrapped. In gtkmm/main.{cc,h}g they are
commented out, unfortunately with no explanation. I'm a bit unsure of why?
It seems removing the commentary signs would work fine.
Comment 1 Murray Cumming 2003-03-18 15:55:51 UTC
I would expect them to be in Gtk::Widget as grab_add() and
grab_remove(). Feel free to patch gtkmm 2.4. But please do grep to
make sure we haven't wrapped them somewhere else.
Comment 2 Ole Laursen 2003-03-18 18:43:20 UTC
I've grepped the source and they aren't wrapped. In fact,
examples/cellrenderercustom/cellrendererpopup.cc is using
gtk_grab_add. I will fix that too.

I can see that it makes some sense to put grab_add/remove in
Gtk::Widget, but what to do with gtk_grab_get_current?

  GtkWidget*  gtk_grab_get_current            (void);

  Queries the current grab. 

A static method in Widget that returns Widget *?

BTW, as Danish translator of Gnome I do have CVS write access in case
it is easier for you that way.
Comment 3 Murray Cumming 2003-03-19 07:07:14 UTC
> but what to do with gtk_grab_get_current?
> GtkWidget*  gtk_grab_get_current            (void);
> A static method in Widget that returns Widget *?

Yes, it doesn't seem perfect, but I suppose that's OK. 

Please post the patch here (for the gtkmm 2.4 module - "gtkmm") and 
then I'll probably ask you to apply it.

 
Comment 4 Murray Cumming 2003-04-01 17:51:17 UTC
An example would be nice too.
Comment 5 Murray Cumming 2003-04-07 12:58:06 UTC
Note that the latest version of Inti has something similar (I'm 99%
sure that he tracks our ChangeLog and mailing lists instead of just
contributing to gtkmm.) so that might help too.
Comment 6 Ole Laursen 2003-04-08 20:27:34 UTC
OK. I do apology that I haven't provided a patch yet, but I have been
extremely busy. Also, my build problem persists. But apparently I can
fix that by running "autoconf" manually. However, now glibmm refused
to build. :-(

g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../glib
-I/usr/lib/sigc++-1.2/include -I/usr/include/sigc++-1.2
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
  -g -O2 -pedantic -W -Wall -Werror -c generate_defs_glib.cc
cc1plus: warnings being treated as errors
generate_defs_glib.cc: In function `int main(int, char**)':
generate_defs_glib.cc:26: warning: unused parameter `int argc'
generate_defs_glib.cc:26: warning: unused parameter `char**argv'
make[3]: *** [generate_defs_glib.o] Fejl 1
make[3]: Leaving directory `/home/ole/cvs/glibmm/tools/extra_defs_gen'
make[2]: *** [all-recursive] Fejl 1
make[2]: Leaving directory `/home/ole/cvs/glibmm/tools'
make[1]: *** [all-recursive] Fejl 1
make[1]: Leaving directory `/home/ole/cvs/glibmm'
make: *** [all-recursive-am] Fejl 2

I will try to reserve some time this week-end to get this bug closed.
Comment 7 Murray Cumming 2003-04-09 07:57:28 UTC
> Also, my build problem persists. But apparently I can
> fix that by running "autoconf" manually. 

If you have a build problem then please discuss it on the list. I 
don't where your information comes from. autogen.sh should work.

> cc1plus: warnings being treated as errors
> generate_defs_glib.cc: In function `int main(int, char**)':
> generate_defs_glib.cc:26: warning: unused parameter `int argc'

It's strange that only you see this, but I haven't built glibmm 2.4 
for a while. It shoudl be easy to fix - just take away the parameter 
names from the main() declaration.
Comment 8 Ole Laursen 2003-04-12 17:33:45 UTC
I'm attaching a patch that puts the grab_add/-remove and get_current
functionality in Gtk::Widget and changes the cellrenderer example to
use the wrapped methods. I called the methods
add_modal_grab/remove_modal_grab and get_current_modal_grab in an
attempt to be less confusing.

There's no specific example yet. Would a window with one button that
said, "Press to grab a key", and then grabbed and wrote the key in a
label be fine? That is just about what I'm using the grabbing for myself.
Comment 9 Ole Laursen 2003-04-12 17:34:39 UTC
Created attachment 15670 [details] [review]
Adds wrappers of the functionality
Comment 10 Murray Cumming 2003-04-13 13:07:15 UTC
I think my comment about Inti was about some other
completely-unrelated unwrapped GTK+ methods, so don't worry about the
specific example.

This looks perfect, but please patch the ChangeLog so I can just mark
this as approved and ready to be committed.
Comment 11 Ole Laursen 2003-04-13 17:04:47 UTC
Forgot that. New patch attached with diff of ChangeLog also.
Comment 12 Ole Laursen 2003-04-13 17:05:32 UTC
Created attachment 15678 [details] [review]
Patch for ChangeLog too
Comment 13 Murray Cumming 2003-04-14 12:08:42 UTC
Great. This should be applied to gtkmm 2.4.
Comment 14 Ole Laursen 2003-04-14 19:24:14 UTC
I've committed the changes to CVS now.