Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. void setButton(Php::Parameters &params) {
  2. // Php::Value callback = params[0];
  3. _button = gtk_button_new_with_label(_buttonTitle);
  4. gtk_container_add(GTK_CONTAINER(_window), _button);
  5. g_signal_connect(G_OBJECT(_button), "clicked", G_CALLBACK(callback), NULL);
  6. }
  7.  
  8. void callback(GtkButton *button, gpointer data) {
  9. g_print("testing");
  10. }
  11.  
  12. In file included from /usr/include/glib-2.0/gobject/gobject.h:28:0,
  13. from /usr/include/glib-2.0/gobject/gbinding.h:29,
  14. from /usr/include/glib-2.0/glib-object.h:23,
  15. from /usr/include/glib-2.0/gio/gioenums.h:28,
  16. from /usr/include/glib-2.0/gio/giotypes.h:28,
  17. from /usr/include/glib-2.0/gio/gio.h:26,
  18. from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
  19. from /usr/include/gtk-2.0/gdk/gdk.h:32,
  20. from /usr/include/gtk-2.0/gtk/gtk.h:32,
  21. from main.cpp:3:
  22. main.cpp: In member function ‘void Gtk::setButton(Php::Parameters&)’:
  23. /usr/include/glib-2.0/gobject/gclosure.h:70:41: error: invalid use of member function (did you forget the ‘()’ ?)
  24. #define G_CALLBACK(f) ((GCallback) (f))
  25. ^
  26. /usr/include/glib-2.0/gobject/gsignal.h:475:60: note: in definition of macro ‘g_signal_connect’
  27. g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)
  28. ^
  29. main.cpp:46:49: note: in expansion of macro ‘G_CALLBACK’
  30. g_signal_connect(G_OBJECT(_button), "clicked", G_CALLBACK(callback), NULL);
  31. ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement