Thread: GTK+ 2.0 with C++

  1. #1
    Registered User
    Join Date
    Jul 2002

    GTK+ 2.0 with C++

    I've noticed that g_signal_connect() refuses to take functions declared in classes as the callback argument. Is there a way to get around this?



  2. #2
    Registered User
    Join Date
    Nov 2002
    Since functions are per instance, you need to create a static function. This static function can take 'this' as an argument and then call this->function_you_want_it_to_call, if that works (I havn't looked at the functin you are asking about). But because the function you are askig it to use is part of an INSTANCE variable, you cannot pass it as a callback function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 09-22-2008, 04:49 AM
  2. Compile to 1.1 got 2.0
    By Coder87C in forum Windows Programming
    Replies: 0
    Last Post: 04-19-2006, 03:13 AM
  3. Replies: 1
    Last Post: 10-24-2005, 06:35 AM
  4. Gtk
    By curlious in forum A Brief History of
    Replies: 8
    Last Post: 01-01-2005, 12:05 PM
  5. QT or GTK
    By mart_man00 in forum Linux Programming
    Replies: 4
    Last Post: 03-24-2003, 10:42 PM