RE: lookup_widget



  Dear Soren,

1: How do I get the state of the togglebutton called 'route'?

  I think you can just use...

  gtk_toggle_button_get_active ()

  Documentation at:
 
http://developer.gnome.org/doc/API/gtk/gtktogglebutton.html#GTK-TOGGLE-BUTTO
N-GET-ACTIVE


2. Host is an 'entry-box'; count, wait, timeout, packet are spinbuttons;
output is a 'textbox'. This tell's me that GTK_WIDGET(button) in the
lookup_widget lines should be something else. Isn't that correct?

  I'm not sure what you mean;

  I'm looking at the lookup_widget function.
  It seems like you are climbing the tree of the button up to the topmost
level, and then pulling object data.
  If that is indeed the case, it shouldn't matter really what the button is.
  As long as it is in the tree, the root node should be the same.
  I don't know much about this code... =^_^=

----------------------
GtkWidget*
lookup_widget                          (GtkWidget       *widget,
                                        const gchar     *widget_name)
{
  GtkWidget *parent, *found_widget;

  for (;;)
    {
      if (GTK_IS_MENU (widget))
        parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
      else
        parent = widget->parent;
      if (parent == NULL)
        break;
      widget = parent;
    }

  found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget),
                                                   widget_name);
  if (!found_widget)
    g_warning ("Widget not found: %s", widget_name);
  return found_widget;
}
----------------------

  If you're having problems in here, I'd step through with gdb, or add a
debug statement around the found_widget = blahblah; line. I suspect your
problem is there.

  Take care,
    Lion {:)}=






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