function tips_query_widget_selected($tips_query, $widget, $tip_text, $tip_private, $event) { if ($widget) { print 'Help "'; print $tip_private ? $tip_private : 'None'; print '" requested for <'; print Gtk::type_name($widget->get_type()); print ">\n"; } return true; }
function collect_results() { for ($i = 0; isset($this->widgets[$i]); ++$i) { $set =& $this->widgets[$i]; $widget =& $set['widget']; $val_is_set = False; echo "{$i}: {$set['name']}/{$set['type']}/" . Gtk::type_name($widget->get_type()); switch ($set['type']) { case 'button': // is set to 'pressed' or is '' (not unset !!!) $val_is_set = $val = $this->get_array($this->result, $set['name']); break; case 'int': case 'float': case 'text': case 'textarea': $val = $widget->get_chars(0, -1); $val_is_set = True; break; case 'checkbox': $val = $widget->get_active(); $val_is_set = True; break; case 'radio': if ($widget->get_active()) { $val = $set['set_val']; $val_is_set = True; } break; case 'select': $entry = $widget->entry; $selected = $entry->get_chars(0, -1); $options = $set['set_val']; reset($options); while (list($key, $val) = each($options)) { if ($val == $selected) { $val = $key; $val_is_set = True; break; } } break; case 'date': } echo $val_is_set && !$set['readonly'] ? " = '{$val}'\n" : " NOT SET\n"; $this->set_array($this->result, $set['name'], $val, $val_is_set && !$set['readonly']); } }