wxToolBar::GetToolSize() broken on wxGTK2.8.6?

Volker Bartheld dr_versaeg at freenet.de
Wed Oct 10 08:58:14 PDT 2007


Hi Vadim!

Thanks for answering so quick.

> VB> I have found that unter wxGTK2.8.6 wxToolBar::GetToolSize()
> VB> doesn't return the value I expect.

> I'm not sure if we can really get the value you expect from GTK+. Why do
> you need it?

I _believed_ to need it for resizing a wxToolbook according either
its wxToolBar or the largest panel extent as mentioned in the
"Getting (maximal) size of wxToolbook"-thread (Message-ID:
<ualyfl2fybj.p3xvwoue0qt0$.dlg at 40tude.net>), but found this
to fail under wxGTK (the size was always too small).

I now use

  wxSize
    tbarsize=m_toolbook->GetToolBar(),                    // get size of toolbook's toolbar member
    tbooksize=m_toolbook->GetSize(),                      // get size of toolbook itself
    minSize(std::max<int>(tbooksize.x, tbarsize.x), std::max<int>(tbooksize.y, tbarsize.y)); // new minimal size
  m_toolbook->SetMinSize(minSize);

which seems to work much better and should be portable for
all toolbook orientations and OSs.

Cheers,
Volker

-- 
mailto:  V B A R T H E L D at G M X dot D E






More information about the wx-users mailing list