Re: [gtk-list] GTK-- question (newbie)



Tom Fishwick <tfishwick@coastnet.com> writes:
>         I'm using Gtk-- (on linux), and am trying to insert text into
> 'Gtk_Text'.  I've connected Gtk_Text::changed() to a method that inserts
> some text, and it works fine.  But when I tried doing this
> 'MyGtkText.insert(0, 0, 0, "gg", 2)' inside a method thats connected to
> Gtk_FileSelection.ok_button.pressed then it gives me
> 
> ** WARNING **: invalid class type `(unknown)' in cast to `GtkText'
> 
> ** WARNING **: file gtktext.c: line 694 (gtk_text_insert): "GTK_IS_TEXT
> (text)" 

This means the object passed to gtk is not a GtkText. Under gtk--, this
kind of errors should not happen. Can you give a small example code which
shows this problem? (I dont know how it would be any way different if one
does it inside a callback, shouldnt be..)

> What does this mean?  I have to somehow cast the object?  Or put the
> widget in focus?

Nope, the error happened inside a cast which gtk checks.

Looks like a bug in gtk-- to me, but cant be sure without more information...
(I think I should look into Gtk_Text more later today...)

-- 
-- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]