View previous topic :: View next topic |
Author |
Message |
maelp
Joined: 23 Sep 2007 Posts: 12
|
Posted: Sun Jun 22, 2008 9:32 am Post subject: Widget allocation |
|
|
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 |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Sun Jun 22, 2008 1:54 pm Post subject: |
|
|
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 |
|
|
maelp
Joined: 23 Sep 2007 Posts: 12
|
Posted: Mon Jun 23, 2008 11:03 am Post subject: |
|
|
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 |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Mon Jun 23, 2008 12:32 pm Post subject: |
|
|
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 |
|
|
|