Re: Where should I put these code?
- From: Steve Lawrence <kfjethro gmail com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Where should I put these code?
- Date: Sun, 07 Jun 2009 15:39:23 -0300
chunlong84 wrote:
For efficiency,i don't want put these codes in MyDrawingArea::on_expose_event().
I need a fixed size window,so i only need execute these code once,not every time.
but i still cann't put them in construction method,where should i put them?
allocation=get_allocation(); //allocation,cr,gc are data members of MyDrawingArea:public Gtk::DrawingArea
cr = get_window()->create_cairo_context();
gc=Gdk::GC::create(get_window());
Put the code in your signal_configure_event() and signal_map_event()
handlers of your MyDrawingArea class.
The gc=Gdk::create()... can probably just go in your signal_map_event()
handler.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]