wxNotebook and wxScrolledWindow
Robin Dunn
robin at alldunn.com
Mon Jan 1 11:02:16 PST 2007
Baptiste wrote:
> 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.
You may want to try wx.lib.scrolledpanel as it will set the virtual size
to that needed by the sizer, and will also scroll a child widget into
view when it gets the focus.
> 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 = wx.Font ( size_label,
> wx.FONTFAMILY_DEFAULT , wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL )
> style_tag_cloud = wx.TextAttr ( wx.NamedColour ( "black" ),
> wx.NamedColour ( "white" ), style_tag_cloud_size )
This isn't part of the problem but just a note that you don't need
wx.NamedColour here. wxPython will convert string names to colors
automatically. Hex strings (like "#RRGGBB") and (R,G,B) 3-tuples too.
> tag_list = 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.
On Windows you need wx.TE_RICH style to use styles, and on the other
platforms I think it will only work with multi-line text ctrls.
> tag_list.SetBackgroundColour ( wx.NamedColour ( "black" ) )
> works, but I can change neither the size neither the color of the text
> with this method...
You can if you also use SetForegroundColour and SetFont.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wx-users
mailing list