467,925 Members | 2,008 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

Add statusbar in wx.Panel

Hi all,

As I want to add a statusbar to show the x,y coordinates of an image on a panel/dialog.
But I find panel not include the function of SetStatusBar that I found in frame and I dun want to change the structure of it from dialog to frame.
Is there any other appropriate method to show the instant coordinates?

Thanks!

Brs,
Kanis
Nov 16 '07 #1
  • viewed: 1941
Share:
1 Reply
bartonc
Expert 4TB
Hi all,

As I want to add a statusbar to show the x,y coordinates of an image on a panel/dialog.
But I find panel not include the function of SetStatusBar that I found in frame and I dun want to change the structure of it from dialog to frame.
Is there any other appropriate method to show the instant coordinates?

Thanks!

Brs,
Kanis
Panels don't own status bars, frames do:
Expand|Select|Wrap|Line Numbers
  1. #Boa:Frame:Frame1
  2.  
  3. import wx
  4.  
  5. def create(parent):
  6.     return Frame1(parent)
  7.  
  8. [wxID_FRAME1, wxID_FRAME1STATUSBAR1, 
  9. ] = [wx.NewId() for _init_ctrls in range(2)]
  10.  
  11. [wxID_FRAME1MENU1ITEMS0] = [wx.NewId() for _init_coll_menu1_Items in range(1)]
  12.  
  13. class Frame1(wx.Frame):
  14.     def _init_coll_menuBar1_Menus(self, parent):
  15.         # generated method, don't edit
  16.  
  17.         parent.Append(menu=self.menu1, title='Menus0')
  18.  
  19.     def _init_coll_menu1_Items(self, parent):
  20.         # generated method, don't edit
  21.  
  22.         parent.Append(help='', id=wxID_FRAME1MENU1ITEMS0, kind=wx.ITEM_NORMAL, text='Items0')
  23.         self.Bind(wx.EVT_MENU, self.OnMenu1Items0Menu, id=wxID_FRAME1MENU1ITEMS0)
  24.  
  25.     def _init_utils(self):
  26.         # generated method, don't edit
  27.         self.menu1 = wx.Menu(title='')
  28.  
  29.         self.menuBar1 = wx.MenuBar()
  30.  
  31.         self._init_coll_menu1_Items(self.menu1)
  32.         self._init_coll_menuBar1_Menus(self.menuBar1)
  33.  
  34.     def _init_ctrls(self, prnt):
  35.         # generated method, don't edit
  36.         wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt, pos=wx.Point(110, 110),
  37.                 size=wx.Size(400, 250), style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
  38.         self._init_utils()
  39.         self.SetClientSize(wx.Size(392, 223))
  40.         self.SetMenuBar(self.menuBar1)
  41.  
  42.         self.statusBar1 = wx.StatusBar(id=wxID_FRAME1STATUSBAR1, name='statusBar1', parent=self,
  43.                 style=0)
  44.         self.statusBar1.SetStatusText('')
  45.         self.SetStatusBar(self.statusBar1)
  46.  
  47.     def __init__(self, parent):
  48.         self._init_ctrls(parent)
  49.  
  50.     def OnMenu1Items0Menu(self, event):
  51.         event.Skip()
  52.  
Nov 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Tonya | last post: by
reply views Thread by Job Lot | last post: by
1 post views Thread by Oleg Medyanik | last post: by
1 post views Thread by Ahmet | last post: by
10 posts views Thread by Nicolas | last post: by
3 posts views Thread by EricJ | last post: by
7 posts views Thread by Geoff | last post: by
3 posts views Thread by Fred Morrison | last post: by
6 posts views Thread by Anony | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.