Re: GTK Selection owner question.

Jeff Franks <jcf tpg com au> writes:

> Hi,
> As far as I understand a  GtkInvisible widget can be used as the
> "selection owner". If this is correct then there is a minor
> problem. You can't set  a GtkInvisible widget as the selection owner
> unless the GTK_VISIBLE flag is set. This is because of the following
> line near the top of the gtk_selection_owner_set function:
> g_return_val_if_fail (widget == NULL || GTK_WIDGET_REALIZED (widget),
> So, to be able to set a GtkInvisible widget as the "selection owner"
> you have to either call gtk_widget_show() or specifically set the
> GTK_VISIBLE flag and call gtk_widget_realize().
> It seems a bit strange calling gtk_widget_show() or setting the
> GTK_VISIBLE flag on a widget that is supposed to be invisible.
> Is this correct or have I missed something,

I don't see anything about visible in this assertion... why do
you think you have to do this? If you check the GtkClipboard source,
you'll see that it never shows the GtkInvisible widges it creates.

(You do have to gtk_widget_show() a GtkInvisible if you want to use 
it for a  pointer grab, on the other hand.)


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