widths of 1????



hello all,
  i'm trying to create a list, in which each row containse several
editable fields (i'm using list instead of clist because i need this
dynamic behavior in the rows, and as far as understand, clist can just
display text in its rows).  i created an hbox that holds several frames
containing labels that serve as headers for each column, and i'm trying
to use the width value of each frame to set with width of that field in
each row.  i'm using gtk--, but i'm not sure whether to ask there or
here.  anyway, whenever i try to get the width of one of the
aforementioned frames, it always returns 1.

here is an excerpt from my code:

 HBox* attribute_names_box = manage( new HBox() );
  vector<guint8> fields;        // will hold the width of each field in each
row
  for(guint8 i = 0;i < def.num_attributes();i++) {
    Frame* f = manage( new Frame() );
    f->set_shadow_type(GTK_SHADOW_IN);
    Label* a_name = manage( new Label(def[i].get_name()) );
    f->add(*a_name);
    f->show();
    attribute_names_box->pack_start(*f, false, false);
    show_all();
    fields.push_back(f->width());       // always pushes back a 1
  }

can anyone tell me why i'm not getting the 'real' width of my frame?

arrggh! (and thanks),
-tim




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