Recent

Author Topic: Finding source of an invalid cast  (Read 2248 times)

timppl

  • Jr. Member
  • **
  • Posts: 83
Finding source of an invalid cast
« on: August 21, 2012, 11:01:34 am »
Hello all

A while ago I posted about an invalid cast  http://lazarus.freepascal.org/index.php/topic,17736.msg98671.html#msg98671 . I have done a bit more investigation, and with the command
Code: [Select]
writeln ( 'Object type is ' , LCLObject.ClassName ); at gtk2CellRenderer line 95 the following output appears

Quote
(SPECTRA:32126): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(SPECTRA:32126): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed
Object type is TComboBox.

As you can see, the object is a TComboBox, and the command ( at line 96 )
Code: [Select]
Result := LCLObject as TWinControl;should succeed, but fails with an invalid cast exception.

Any suggestions as to how I can find the name of the offending component?

using Laz + fpc from svn each day on mandriva linux

Regards

Tim

Mageia 9 Linux on x86_64

 

TinyPortal © 2005-2018