FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GtkBuilderConnectFunc definition is wrong

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
jpf2



Joined: 15 Aug 2009
Posts: 7

PostPosted: Thu Dec 31, 2009 9:01 am    Post subject: GtkBuilderConnectFunc definition is wrong Reply with quote

Hi,
I was trying to use Builder.connectSignalsFull but the GtkBuilderConnectFunc definition seems wrong. It's defined in gtktypes.d , line 6687:
Code:
// void (*GtkBuilderConnectFunc) (GtkBuilder *builder,  GObject *object,  const gchar *signal_name,  const gchar *handler_name,  GObject *connect_object,  GConnectFlags flags,  gpointer user_data);
public typedef extern(C) void  function (GtkBuilder*, GObject*, char[], char[], GObject*, GConnectFlags, void*) GtkBuilderConnectFunc;
I think it should be
Code:
public typedef extern(C) void  function (GtkBuilder*, GObject*, char*, char*, GObject*, GConnectFlags, void*) GtkBuilderConnectFunc;
Changing that made my simple test work, but I don't know how to correctly add that to the ApiLookup files.

Proof of concept:
Code:
module main;

import tango.io.Stdout;
import tango.stdc.stringz;
import gtk.Builder;
import gtk.Main;

void main(char[][] args)
{
   Main.init(args);
   
   Builder b = new Builder();
   b.addFromFile("test.ui");
   b.connectSignalsFull(&connectInterface, null);
}

extern(C) void  connectInterface (GtkBuilder* builder, GObject* object, char* signal_name, char* handler_name, GObject* connect_object, GConnectFlags flags, void* user_data)
{
   Stdout.formatln("connect {0} to {1}", fromStringz(signal_name), fromStringz(handler_name));
}
prints
Code:
connect destroy_event to on_window1_destroy_event
connect activate to on_imagemenuitem5_activate
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Fri Jan 01, 2010 9:33 am    Post subject: Reply with quote

It's probably a bug in the wrapper.
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Fri Jan 01, 2010 10:09 am    Post subject: Reply with quote

It was a wrong alias in the main lookup file.

fixed in svn r747.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group