pike.git / src / post_modules / GTK2 / source / gtktreeviewcolumn.pre

version» Context lines:

pike.git/src/post_modules/GTK2/source/gtktreeviewcolumn.pre:19:   //! int sort-order CONST(GTK_SORT_)   //! int spacing   //! string title   //! int visible   //! GTK2.Widget widget   //! int width      signal clicked;      void create(string|mapping(string:mixed)|void title_or_props, -  ?GTK2.CellRenderer renderer, ?string property, ?int col) - //! Creates a new W(TreeViewColumn). +  GTK2.CellRenderer renderer, string property, int col, +  int|string ... moreprops) + //! Creates a new W(TreeViewColumn). At least one property/col pair must be + //! specified; any number of additional pairs can also be given.   {    pgtk2_verify_not_inited();    pgtk2_verify_setup();    if (args) {    if (args==1) {    INIT_WITH_PROPS(GTK_TYPE_TREE_VIEW_COLUMN);    } else {    char *title,*prop;    struct object *o1;    INT_TYPE col;    GtkTreeViewColumn *gt; -  get_all_args("create",args,"%s%o%s%i",&title,&o1,&prop,&col); +  GtkCellRenderer *rend; +  int i; +  get_all_args(NULL,args,"%s%o%s%i",&title,&o1,&prop,&col); +  rend = GTK_CELL_RENDERER(get_gobject(o1));    gt=gtk_tree_view_column_new_with_attributes(    title, -  GTK_CELL_RENDERER(get_gobject(o1)), +  rend,    prop,col,NULL); -  +  /* Any additional (pairs of) arguments get added as attributes. */ +  /* CJA note to self: Is there a better way to do variadic GTK functions? */ +  for (i = 4; i < args; i += 2) { +  /* Note that errors from get_all_args here will look a little odd */ +  get_all_args(NULL, args-i, "%s%i", &prop, &col); +  gtk_tree_view_column_add_attribute(gt, rend, prop, col); +  }    THIS->obj=G_OBJECT(gt);    }    pgtk2_pop_n_elems(args);    } else {    GtkTreeViewColumn *gt;    gt=gtk_tree_view_column_new();    THIS->obj=G_OBJECT(gt);    }    pgtk2__init_this_object();   }      void pack_start(GTK2.CellRenderer cell, int expand);   //! Packs the cell into the beginning of the column. If expand is false, then   //! the cell is allocated no more space than it needs. Any unused space is - //! divied evenly between cels for which expand is true. + //! divied evenly between cells for which expand is true.      void pack_end(GTK2.CellRenderer cell, int expand);   //! Packs the cell to the end of the column.      void clear();   //! Unsets all the mappings on all renderers.      array get_cell_renderers()   //! Returns an array of all the cell renderers in the column, in no partciular   //! order.
pike.git/src/post_modules/GTK2/source/gtktreeviewcolumn.pre:245:    int is_expander, int is_expanded)   //! Sets the cell renderer based on the model and iter. That is, for every   //! attribute mapping in this column, it will get a value from the set column   //! on the iter, and use that value to set the attribute on the cell renderer.   //! This is used primarily by the W(TreeView).   {    pgtk2_verify_inited();    {    struct object *o1,*o2;    INT_TYPE expander,expanded; -  get_all_args("cell_set_cell_data",args,"%o%o%i%i",&o1,&o2,&expander, +  get_all_args(NULL,args,"%o%o%i%i",&o1,&o2,&expander,    &expanded);    gtk_tree_view_column_cell_set_cell_data(GTK_TREE_VIEW_COLUMN(THIS->obj),    GTK_TREE_MODEL(get_gobject(o1)),    (GtkTreeIter *)get_pg2object(o2,pgtk2_tree_iter_program),expander,expanded);    }    RETURN_THIS();   }      mapping(string:int) cell_get_size(GDK2.Rectangle cell_area)   //! Obtains the width and height needed to render the column.   {    pgtk2_verify_inited();    {    struct object *o1;    gint x_offset,y_offset,width,height; -  get_all_args("cell_get_size",args,"%o",&o1); +  get_all_args(NULL,args,"%o",&o1);    gtk_tree_view_column_cell_get_size(GTK_TREE_VIEW_COLUMN(THIS->obj),    (GdkRectangle *)get_gdkobject(o1,rectangle),    &x_offset,&y_offset,&width,&height);    pgtk2_pop_n_elems(args);    ref_push_string(_STR("x_offset")); push_int(x_offset);    ref_push_string(_STR("y_offset")); push_int(y_offset);    ref_push_string(_STR("width")); push_int(width);    ref_push_string(_STR("height")); push_int(height);    f_aggregate_mapping(8);    }
pike.git/src/post_modules/GTK2/source/gtktreeviewcolumn.pre:284:   require gtk22;   mapping cell_get_position(GTK2.CellRenderer cell_renderer)   //! Obtains the horizontal position and size of a cell in a column. If the   //! cell is not found in the column, returns -1 for start_pos and width.   {    pgtk2_verify_inited();    {    gint start_pos,width;    struct object *o1;    int res; -  get_all_args("cell_get_position",args,"%o",&o1); +  get_all_args(NULL,args,"%o",&o1);    res=gtk_tree_view_column_cell_get_position(GTK_TREE_VIEW_COLUMN(THIS->obj),    GTK_CELL_RENDERER(get_gobject(o1)),&start_pos,&width);    pgtk2_pop_n_elems(args);    ref_push_string(_STR("start_pos")); push_int(start_pos);    ref_push_string(_STR("width")); push_int(width);    f_aggregate_mapping(4);    }   }   endrequire;