wxNotebook and wxScrolledWindow

Baptiste baptiste.goupil at gmail.com
Sun Dec 31 01:15:46 PST 2006


2006/12/31, Vadim Zeitlin <vadim at wxwindows.org>:
>
> On Sat, 30 Dec 2006 23:20:54 +0100 Baptiste <baptiste.goupil at gmail.com>
> wrote:
>
> B> I would like to display scrollbars in one of the tabs of my wxNotebook.
>
> I don't think the problem is related to wxNotebook at all, is it? I.e.
> does it work if you do the same thing without wxNotebook?


The interface is complicated and do not allow me to test without wxNotebook.


B> This is what I tried (python) :
> B>
> B>         pan3 =3D wx.ScrolledWindow ( self )
> B>         box3 =3D wx.BoxSizer ( wx.VERTICAL )
> B>
> B>         cur =3D ["my","list","..."]
> B>
> B>         for i in cur:
> B>             tag_list =3D wx.TextCtrl ( pan3, -1, i[0] ) )
> B>             box3.Add ( tag_list )
> B>
> B>         pan3.SetSizer ( box3 )
> B>         box3.Fit ( pan3 )
> B>         box3.Layout ( )
> B>
> B> It is okay... except for the scrollbars ! They are not displayed and
> several
> B> items can't be seen.
>
> Fit() will always change the size of the window (pan3 in this case) to fit
> the sizer contents, i.e. there will be never any need for scrollbars after
> calling it. I believe you should call FitInside() with scrolled windows
> instead.


Thanks, but it doesn't change anything :-(
I have read the doc and just to say that I have tested, I tried with
pan3.SetScrollbars(20, 20, 50, 50), and surprise... it works ! incredible
;-) And I just have the vertical scrollbar, so it is perfect.
Thanks for your help and sorry but the idiot question...
Now I have an other issue and I must understand why the style is not applied
:

            style_tag_cloud_size =3D wx.Font ( size_label,
wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL )
            style_tag_cloud =3D wx.TextAttr ( wx.NamedColour ( "black" ),
wx.NamedColour ( "white" ), style_tag_cloud_size )
            tag_list =3D wx.TextCtrl ( pan3, -1, i[0] )
            tag_list.SetStyle ( 0, len(i[0])-1, style_tag_cloud )

I have also tried with :

            tag_list.SetDefaultStyle ( style_tag_cloud )
            tag_list.AppendText ( i[0] )

There is no error but also no change.
            tag_list.SetBackgroundColour ( wx.NamedColour ( "black" ) )
works, but I can change neither the size neither the color of the text with
this method...

Thanks for your ideas,
Baptiste.

Regards,
> VZ
>
> --
> TT-Solutions: wxWidgets consultancy and technical support
>                http://www.tt-solutions.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20061231/e25=
d1239/attachment.htm


More information about the wx-users mailing list