Issue with vertically aligned tooblars

I am currently designing an interface for a DIY spectrum analyser with a 5" (800x480) touchscreen running from a Raspberry Pi as the intended recipient.

I’ve began to have problems setting up the controls as a toolbar along the side, with a series of buttons on it.

At the moment (due to sizing issues) I’m planning on using buttons with some text on them: but for some reason these aren’t displaying on the vertically-aligned toolbar.

Am I doing something wrong or missing something? Bitmap-based buttons work fine, but text-based buttons don’t display unless the toolbar is set to wx.TB_HORIZONTAL

Code

def frame_side_bar(self):

self.main_gui_toolbar = wx.ToolBar(self, -1, style=wx.TB_DOCKABLE | wx.TB_VERTICAL)

self.SetToolBar(self.main_gui_toolbar)

self.ID_sync = wx.NewId()

self.ID_step_inc = wx.NewId()

self.main_gui_toolbar.AddControl(wx.Button(self.main_gui_toolbar,self.ID_sync,“TEST”))

self.main_gui_toolbar.AddControl(wx.Button(self.main_gui_toolbar,self.ID_step_inc,“TEST”))

self.main_gui_toolbar.Realize()

``

As a workaround I can use bitmap-buttons, a horizontal toolbar (though this cuts into my vertical screen-space). I can also use a grid sizer and just place them in a panel and change the grid/panel around to get different orientations, but this becomes a bit cumbersome in terms of quick-swapping (doable of course)

Any help would be appreciated!

NB: Python 2.7.10 running WX-3.0

···

On Wednesday, 25 January 2017 14:45:35 UTC, Callum Robertson wrote:

I am currently designing an interface for a DIY spectrum analyser with a 5" (800x480) touchscreen running from a Raspberry Pi as the intended recipient.

I’ve began to have problems setting up the controls as a toolbar along the side, with a series of buttons on it.

At the moment (due to sizing issues) I’m planning on using buttons with some text on them: but for some reason these aren’t displaying on the vertically-aligned toolbar.

Am I doing something wrong or missing something? Bitmap-based buttons work fine, but text-based buttons don’t display unless the toolbar is set to wx.TB_HORIZONTAL

Code

def frame_side_bar(self):

self.main_gui_toolbar = wx.ToolBar(self, -1, style=wx.TB_DOCKABLE | wx.TB_VERTICAL)

self.SetToolBar(self.main_gui_toolbar)

self.ID_sync = wx.NewId()

self.ID_step_inc = wx.NewId()

self.main_gui_toolbar.AddControl(wx.Button(self.main_gui_toolbar,self.ID_sync,“TEST”))

self.main_gui_toolbar.AddControl(wx.Button(self.main_gui_toolbar,self.ID_step_inc,“TEST”))

self.main_gui_toolbar.Realize()

``

As a workaround I can use bitmap-buttons, a horizontal toolbar (though this cuts into my vertical screen-space). I can also use a grid sizer and just place them in a panel and change the grid/panel around to get different orientations, but this becomes a bit cumbersome in terms of quick-swapping (doable of course)

Any help would be appreciated!