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

Widget allocation

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



Joined: 23 Sep 2007
Posts: 12

PostPosted: Sun Jun 22, 2008 9:32 am    Post subject: Widget allocation Reply with quote

Hello,

when creating a widget, and trying to attain it's GtkWidget.allocation GtkAllocation structure, I obtain seemingly random values, and when trying to change them, the application crashes. Someone knows what's going wrong here ? Do I have to call some particular function beside showAll() before I can access the widget and it's allocation structure ?

Thanks
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Sun Jun 22, 2008 1:54 pm    Post subject: Reply with quote

This is because GtkD doesn't wrap the structures properly.

I added get and set functions for the allocation of a widget in svn r503.
Back to top
View user's profile Send private message
maelp



Joined: 23 Sep 2007
Posts: 12

PostPosted: Mon Jun 23, 2008 11:03 am    Post subject: Reply with quote

Okay it's working, yet I don't understand why the naive code Widget.allocation wouldn't work, since D structures ABI should be compatible with C structures ? Why is the code bypassing the access using pointer arith ?
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Mon Jun 23, 2008 12:32 pm    Post subject: Reply with quote

The code in GtkD is generated from the documentation, but not all the struct members are in the documentation. some of them are "private" at least documentation wise.
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