GtkBin-derived widget doesn't show


I have a GstRecParameter widget which is derived from GtkBin. If I
gtk_widget_show() or _show_all() this widget (it has a label in it for
testing), the label doesn't show. The bin-widget is in a table, by the
way. If I add the label to the table directly, it does work, so it's
something in my GtkBin-derived widget that's going wrong. Does anyone
have a clue what obvious mistakes I could have made here?


[usual GObject boiler plate code omitted]

GtkWidget *
gst_rec_parameter_new (GstElement *element,
		       GParamSpec *pspec)
  GstRecParameter *param = g_object_new (GST_REC_TYPE_PARAMETER, NULL);

  param->element = element;
  param->pspec = pspec;

  gst_rec_parameter_set_widget (param);

  return GTK_WIDGET (param);

static void
gst_rec_parameter_set_widget (GstRecParameter *param)
  GParamSpec *pspec = param->pspec;
  GtkWidget *widget = NULL;

  /* which widget? */
  switch (pspec->value_type) {
[here's a lot of cruft that's currently #if 0'ed]

      widget = gtk_label_new (_("unknown"));
      gtk_misc_set_alignment (GTK_MISC (widget), 1.0,
			      GTK_MISC (widget)->yalign);
      gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);

  g_assert (widget);

  gtk_container_add (GTK_CONTAINER (param), widget);
  gtk_widget_show (widget);

Any ideas?

Thanks in advanced,


Ronald Bultje <rbultje ronald bitfreak net>
Linux Video/Multimedia developer

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