Re: [gtk-list] Pixmap



On Tue, 07 Mar 2000 01:18:39 +0000, Pedro Medeiros wrote:
> 
> What should I do to set a GDK_BUTTON_PRESS_MASK signal for a GtkPixmap?
> 
>       GtkWidget *pixmap;
>       (...)
>       gtk_widget_show (GTK_WIDGET (pixmap));
>       gtk_fixed_put (GTK_FIXED (widget), GTK_WIDGET (pixmap), x, y);
>       gtk_widget_set_uposition (GTK_WIDGET (pixmap), x, y);
>       gtk_widget_set_events (GTK_WIDGET (pixmap),
>                              GDK_BUTTON_PRESS_MASK);
>       gtk_signal_connect (GTK_OBJECT (pixmap),
>                           "clicked", GTK_SIGNAL_FUNC (click_cell),
> NULL);
> 
> Gtk-CRITICAL **: file gtkwidget.c: line 3819 (gtk_widget_set_events):
> assertion
> `!GTK_WIDGET_NO_WINDOW (widget)' failed.
> 
> Gtk-WARNING **: gtk_signal_connect(): could not find signal "clicked" in
> the
> `GtkPixmap' class ancestry

The pixmap widget doesn't come with its own window, it draws on its
parent. If you want it to be clickable, put it in a gtk_event_box. The
GTK+ turorial has some information about event boxes.


Erik

-- 
"software industry, the: unique industry where selling substandard goods is
legal and you can charge extra for fixing the problems."
  -- Duncan Simpson on BugTraq





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