LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2004, 06:13 PM   #1
flamesrock
Member
 
Registered: Aug 2003
Distribution: Gentoo 2006.1
Posts: 405

Rep: Reputation: 30
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
 
Old 12-10-2004, 11:45 PM   #2
Dodgeram01
Member
 
Registered: Jun 2003
Distribution: Gentoo and Ubuntu
Posts: 95

Rep: Reputation: 15
You can use py2exe to create a windows executable of your wxPython script.
 
Old 12-11-2004, 10:31 AM   #3
Dodgeram01
Member
 
Registered: Jun 2003
Distribution: Gentoo and Ubuntu
Posts: 95

Rep: Reputation: 15
Perhaps you could provide the image maps?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wxPython GUI input/output simple question Hal Programming 0 04-14-2005 03:17 PM
wxPython merchtemeagle Linux - Software 3 02-23-2005 10:50 AM
wxPython xlord Programming 0 05-23-2004 04:12 PM
wxPython. vexer Slackware 5 09-22-2003 03:11 PM
wxPython Filsta Linux - Software 0 08-20-2002 03:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration