+bool wxStaticBox::Create( wxWindow *parent,
+ wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name )
+{
+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+ {
+ wxFAIL_MSG( wxT("wxStaticBox creation failed") );
+ return false;
+ }
+
+ m_widget = GTKCreateFrame(label);
+ wxControl::SetLabel(label);
+
+ m_parent->DoAddChild( this );
+
+ PostCreation(size);
+
+ // need to set non default alignment?
+ gfloat xalign;
+ if ( style & wxALIGN_CENTER )
+ xalign = 0.5;
+ else if ( style & wxALIGN_RIGHT )
+ xalign = 1.0;
+ else // wxALIGN_LEFT
+ xalign = 0.0;
+
+ if ( style & (wxALIGN_RIGHT | wxALIGN_CENTER) ) // left alignment is default
+ gtk_frame_set_label_align(GTK_FRAME( m_widget ), xalign, 0.5);
+
+ // in order to clip the label widget, we must connect to the size allocate
+ // signal of this GtkFrame after the default GTK+'s allocate size function
+ g_signal_connect_after (m_widget, "size_allocate",
+ G_CALLBACK (gtk_frame_size_allocate), this);
+
+ return TRUE;
+}