View previous topic :: View next topic |
Author |
Message |
Lysander
Joined: 13 Sep 2011 Posts: 5
|
Posted: Tue Sep 13, 2011 8:18 pm Post subject: casting Widget to ToolItem |
|
|
Hello,
I am trying to populate my Toolbar with gtk.Actions.
the problem ...
Action.createToolItem() returns a Widget.
Toolbar.insert() takes a ToolItem parameter.
Without an explicit cast dmd 2.055 complains of implicit conversions (Widget to ToolItem.)
with cast(ToolItem)Action.createToolItem() I get a segmentation fault (casts to null)
I've worked around it using Toolbar.add() (inherited from gtk.container)
But what am I doing wrong? These functions are designed to work together, right?
So I guess the questions are, how do you cast among inherited classes?
And why do you have to?
Thanks for all your time and effort, I'm having loads of fun learning d, gtkd, and gtk.
btw gtkd rev 895 |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Wed Sep 14, 2011 3:03 pm Post subject: |
|
|
Action.createToolItem should return a ToolItem, changed in svn 897 |
|
Back to top |
|
|
Lysander
Joined: 13 Sep 2011 Posts: 5
|
Posted: Wed Sep 14, 2011 8:07 pm Post subject: |
|
|
Thank you! |
|
Back to top |
|
|
|