Can I stop events for a while ??



I have the next code

class miMaquina : public VBox
{
      Gtk:Label *lbl;
        .....

};
....
....

void miMaquina::on_size_allocate(Gtk::Allocation &alloc)
{
    int alto = alloc.get_height();
    int ancho = alloc.get_width();
    Gtk::VBox::on_size_allocate(alloc);

    Pango::FontDescription fd;
    fd.set_size((alto*Pango::SCALE));
    lbl->modify_font(fd);

}


The problem is that when the events ocurrs the lbl->modify_font(fd) activates
a new on_size_allocate event, because the size of label changes with the size
of new text, and a infinite loop is launchet until X server gets an error.
Can I stop signal emiting for a while, then apply 'lbl->modify_font' and later
activate again the event??


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