Re: how to use get_geometry correctlly
- From: Paul Davis <paul linuxaudiosystems com>
- To: chennanbang陳南邦 <chennanbang gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: how to use get_geometry correctlly
- Date: Mon, 24 Mar 2008 21:27:34 -0400
On Tue, 2008-03-25 at 09:08 +0800, chennanbang陳南邦 wrote:
> Hi, all,
>
> I inherit Gtk::Button, and wonna change the position of my widget
> internally.
> And I use following steps to achieve this, but segmentation fault.
> Please correct me, thanks!
>
> /* in my widget */
> int x, y, tmp=0;
> get_window()->get_geometry( x, y, tmp, tmp, tmp );// get current
> position, but segmentation fault
you can't do this until the widget has been realized, because before
that time get_window() will return a null (ref) ptr.
put that in the realize handler, or make sure you do it post-realize.
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]