Re: Gtk::HPaned size and divider



Vladislav Grinchenko wrote:
On Tue, 2005-04-12 at 17:47, Matthias Kaeppler wrote:

Hi,

I want to set the position of the divider in a pane to always be centered. So I tried the obvious:

pane.set_position( pane.get_width() / 2 );

Problem is, get_width() always returns 1.
I also tried to resize the pane with set_size_request() but that didn't have any effect.

Am I missing something?


pane.signal_value_changed ().connect (
             mem_fun (*foobar, &FooBar::geom_changed_cb));

void FooBar::geom_change_cb ()
{
 	pane.set_position( pane.get_width() / 2 );
}


Hmm, you didn't tell me why get_width() always returned 1 in my case :)
Why should/does it return a sane value when called in a signal handler?

--
Matthias Kaeppler




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