flamesrock |
12-10-2004 06:13 PM |
wxPython/wxGlade Question
Hi,
I'm having a tiny problem with a wxPython gui I'm making in wxGlade...
Basically, theres a panel. My program is going to stick an image map into it - a large one. This is where my problem starts.
The UI is split into two slots. I want the top slot which contains the panel (its actually a notebook...) To be by default larger than the bottom slot, and I also want it to be scrollable (the pane containing the image map.) How do I accomplish this?
Oh- and one more question: I can compile wxPython apps into a windows exe, right?
If it helps anyone, here is the code:
Code:
#!/usr/bin/env python
# -*- coding: ANSI_X3.4-1968 -*-
# generated by wxGlade 0.3.5.1 on Sat Dec 11 05:13:12 2004
import wx
class MyFrame1(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame1.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.window_1 = wx.SplitterWindow(self, -1)
self.notebook_5 = wx.Notebook(self.window_1, -1, style=wx.NB_RIGHT)
self.notebook_4 = wx.Notebook(self, -1, style=0)
# Menu Bar
self.frame_1_menubar = wx.MenuBar()
self.SetMenuBar(self.frame_1_menubar)
wxglade_tmp_menu = wx.Menu()
wxglade_tmp_menu_sub = wx.Menu()
wxglade_tmp_menu_sub.Append(wx.NewId(), _("Favourites"), "", wx.ITEM_NORMAL)
wxglade_tmp_menu_sub.Append(wx.NewId(), _("Add/Remove Server"), "", wx.ITEM_NORMAL)
wxglade_tmp_menu.AppendMenu(wx.NewId(), _("Server"), wxglade_tmp_menu_sub, "")
wxglade_tmp_menu.Append(wx.NewId(), _("Profile"), "", wx.ITEM_NORMAL)
wxglade_tmp_menu.Append(wx.NewId(), _("Preferences"), "", wx.ITEM_NORMAL)
self.frame_1_menubar.Append(wxglade_tmp_menu, _("SCORE"))
wxglade_tmp_menu = wx.Menu()
self.frame_1_menubar.Append(wxglade_tmp_menu, _("Region"))
wxglade_tmp_menu = wx.Menu()
self.frame_1_menubar.Append(wxglade_tmp_menu, _("Help"))
# Menu Bar end
self.frame_1_statusbar = self.CreateStatusBar(1, 0)
# Tool Bar
self.frame_1_toolbar = wx.ToolBar(self, -1)
self.SetToolBar(self.frame_1_toolbar)
self.frame_1_toolbar.AddLabelTool(wx.NewId(), _("blah"), wx.Bitmap("/home/flamesrock/score/download.png", wx.BITMAP_TYPE_ANY), wx.Bitmap("/home/flamesrock/score/download.png", wx.BITMAP_TYPE_ANY), wx.ITEM_NORMAL, "", "")
# Tool Bar end
self.notebook_4_pane_1 = wx.ScrolledWindow(self.notebook_4, -1, style=wx.TAB_TRAVERSAL)
self.notebook_4_pane_2 = wx.Panel(self.notebook_4, -1)
self.notebook_4_pane_5 = wx.Panel(self.notebook_4, -1)
self.tree_ctrl_2 = wx.TreeCtrl(self.window_1, -1, style=wx.TR_HAS_BUTTONS|wx.TR_LINES_AT_ROOT|wx.TR_DEFAULT_STYLE|wx.SUNKEN_BORDER)
self.notebook_5_pane_1 = wx.ScrolledWindow(self.notebook_5, -1, style=wx.RAISED_BORDER|wx.TAB_TRAVERSAL)
self.notebook_5_pane_2 = wx.Panel(self.notebook_5, -1)
self.notebook_5_pane_3 = wx.Panel(self.notebook_5, -1)
self.gauge_2 = wx.Gauge(self, -1, 10, style=wx.GA_HORIZONTAL|wx.GA_SMOOTH)
self.__set_properties()
self.__do_layout()
# end wxGlade
def __set_properties(self):
# begin wxGlade: MyFrame1.__set_properties
self.SetTitle(_("frame_2"))
self.SetSize((595, 456))
self.frame_1_statusbar.SetStatusWidths([-1])
# statusbar fields
frame_1_statusbar_fields = [_("frame_1_statusbar")]
for i in range(len(frame_1_statusbar_fields)):
self.frame_1_statusbar.SetStatusText(frame_1_statusbar_fields[i], i)
self.frame_1_toolbar.Realize()
self.notebook_4_pane_1.SetBackgroundColour(wx.Colour(128, 200, 248))
self.notebook_4_pane_1.SetForegroundColour(wx.Colour(24, 144, 248))
self.notebook_4_pane_1.SetScrollRate(10, 10)
self.notebook_5_pane_1.SetScrollRate(10, 10)
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame1.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.notebook_4.AddPage(self.notebook_4_pane_1, _("Region View"))
self.notebook_4.AddPage(self.notebook_4_pane_2, _("Region Status"))
self.notebook_4.AddPage(self.notebook_4_pane_5, _("Game Status"))
sizer_1.Add(wx.NotebookSizer(self.notebook_4), 1, wx.EXPAND, 0)
self.notebook_5.AddPage(self.notebook_5_pane_1, _("View"))
self.notebook_5.AddPage(self.notebook_5_pane_2, _("Stats"))
self.notebook_5.AddPage(self.notebook_5_pane_3, _("SCORE"))
self.window_1.SplitVertically(self.tree_ctrl_2, self.notebook_5)
sizer_1.Add(self.window_1, 1, wx.EXPAND, 0)
sizer_1.Add(self.gauge_2, 0, 0, 0)
self.SetAutoLayout(True)
self.SetSizer(sizer_1)
self.Layout()
self.Centre()
# end wxGlade
# end of class MyFrame1
-Thanks in advance for any help
|