1

I am building a GUI and I am using wxribbon for wxpython. I want to have only one tab(ribbon page) in when user starts my app, from where user can dynamically add more pages or can add panels and buttons to a page. I am able to achieve all the dynamic parts of ribbon. The only problem I have is that I am unable to start with only one ribbon page. When I define only one page, I don't see the ribbon bar(tab bar), what I see is only the page. Now, when I define two page in the beginning, then I see the bar. Can someone tell me what I code have to change in wxribbon so that I am able to have a tab bar visible with only one page in it. Any help would be great. Thanks!. The sample code I am using to add a page is as follows :

import wxRibbon as RB

self._ribbon = RB.RibbonBar(self, id = wx.ID_ANY)

page_1 = RB.RibbonPage(self._ribbon, WORKPIECE, "Workpiece", Bitmap("eye.xpm"))

page_2 = RB.RibbonPage(self._ribbon, wx.ID_ANY, "New Tab", Bitmap("empty.xpm"))

Samyak
  • 109
  • 2
  • 8

1 Answers1

2

You need the flag RIBBON_BAR_ALWAYS_SHOW_TABS

try this:

self._ribbon = RB.RibbonBar(self, wx.ID_ANY, agwStyle = RB.RIBBON_BAR_DEFAULT_STYLE | RB.RIBBON_BAR_ALWAYS_SHOW_TABS)
Jerry_Y
  • 1,724
  • 12
  • 9
  • Thanks a lot !! That works like a charm.... That is exactly what I wanted. But I got one more problem which is similar, now when I display my GUI with only one ribbon page(with no panels and buttons), what I see is only tab bar and no page, but when I add a panel, page becomes visible. I believe there must be a flag for that also, I searched a lot for it but I am not able to find it. It would be really great if you could help me with this part too. Thanks a lot.... The code for page is there above on my question. – Samyak Jan 30 '14 at 18:04
  • Not able to find a solution for this. I don't think it make sense to display a panel if there is no panel added. – Jerry_Y Jan 31 '14 at 14:41