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

Cast from Widget to ColorSelection fails with DMD 2.057

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



Joined: 21 May 2007
Posts: 24
Location: Bangalore

PostPosted: Fri Dec 23, 2011 3:48 am    Post subject: Cast from Widget to ColorSelection fails with DMD 2.057 Reply with quote

I've posted this to digitalmars.D also.

gtkD has a ColorSelectionDialog class with a method that returns an associated ColorSelection class as a Widget. In COMPO I used to cast this to a ColorSelection, then I could set the initial color and retrieve the result.

The inheritance sequence is:

Widget -> Container -> Box -> VBox -> ColorSelection
OrientableIF ->

that is, Box is derived from Container and OrientableIF.

I've tried a chain of casts, but just the first one

Widget w = dialog.getColorSelection();
gtk.Container.Container ctr = cast(gtk.Container.Container) w;

gets null.

Any suggestions?

Steve
Back to top
View user's profile Send private message Send e-mail
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Sat Dec 24, 2011 3:56 pm    Post subject: Reply with quote

I don't think that should have ever worked.
I'll change the function to return a ColorSelection.
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Sun Dec 25, 2011 6:53 am    Post subject: Reply with quote

Changed in svn r913.
Back to top
View user's profile Send private message
teales



Joined: 21 May 2007
Posts: 24
Location: Bangalore

PostPosted: Sun Dec 25, 2011 10:51 am    Post subject: Reply with quote

Mike,

You forgot to do:

import gtk.ColorSelection;

Steve
Back to top
View user's profile Send private message Send e-mail
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Tue Dec 27, 2011 4:02 pm    Post subject: Reply with quote

Embarassed
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