I am trying to steal this code from the wxpython demo but it appears that mb comes from nowhere and I am having errors because of it -
import wx
-
-
#---------------------------------------------------------------------------
-
-
class MySplitter(wx.SplitterWindow):
-
def __init__(self, parent, ID, log):
-
wx.SplitterWindow.__init__(self, parent, ID,
-
style = wx.SP_LIVE_UPDATE
-
)
-
self.log = log
-
-
self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnSashChanged)
-
self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGING, self.OnSashChanging)
-
-
def OnSashChanged(self, evt):
-
self.log.WriteText("sash changed to %s\n" % str(evt.GetSashPosition()))
-
-
def OnSashChanging(self, evt):
-
self.log.WriteText("sash changing to %s\n" % str(evt.GetSashPosition()))
-
# uncomment this to not allow the change
-
#evt.SetSashPosition(-1)
-
-
-
#---------------------------------------------------------------------------
-
-
def runTest(frame, nb, log):
-
splitter = MySplitter(nb, -1, log)
-
-
#sty = wx.BORDER_NONE
-
#sty = wx.BORDER_SIMPLE
-
sty = wx.BORDER_SUNKE
-
-
p1 = wx.Window(splitter, style=sty)
-
p1.SetBackgroundColour("pink")
-
wx.StaticText(p1, -1, "Panel One", (5,5))
-
-
p2 = wx.Window(splitter, style=sty)
-
p2.SetBackgroundColour("sky blue")
-
wx.StaticText(p2, -1, "Panel Two", (5,5))
-
-
splitter.SetMinimumPaneSize(20)
-
splitter.SplitVertically(p1, p2, -100)
-
-
return splitter
-
-
-
#---------------------------------------------------------------------------
-
-
-
overview = """\
-
This class manages up to two subwindows. The current view can be split
-
into two programmatically (perhaps from a menu command), and unsplit
-
either programmatically or via the wx.SplitterWindow user interface.
-
"""
-
-
if __name__ == '__main__':
-
import sys,os
-
import run
-
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
-
File "C:\Python25\wx-2.6-msw-ansi\wx\_windows.py", line 1013, in __init__
newobj = _windows_.new_SplitterWindow(*args, **kwargs)
TypeError: argument number 1: a 'wxWindow *' is expected, 'int(-1)' is received
2 2015
to extend and revise it is in the run test code. When I try to cut and paste this where would I get the value from??
Here is what I was wanting to split in two (I don't know that I need a splitter but I have buttons that go one under the other and when I change that I get wierd glitches) -
):
-
-
wx.Frame.__init__(self, parent, -1, "Dex Tracker Score Editor", size=(640,480))
-
p = wx.Panel(self, -1, style=0)
-
self.grid = WordGrid(p, log)
-
b = wx.Button(p, -1, "Save Grid") #b gets numbered per button and then description set
-
b2 = wx.Button(p, 100, "Add Line")
-
b3 = wx.Button(p, -1, "Insert Line")
-
b4 = wx.Button(p, -1, "Delete Line")
-
b5 = wx.Button(p, -1, "Play from line to line")
-
-
b.SetDefault()
-
self.Bind(wx.EVT_BUTTON, self.OnButton, b) #bind to the button I am numbering them
-
self.Bind(wx.EVT_BUTTON, self.OnButton2, b2)
-
self.Bind(wx.EVT_BUTTON, self.OnButton3, b3)
-
self.Bind(wx.EVT_BUTTON, self.OnButton4, b4)
-
self.Bind(wx.EVT_BUTTON, self.OnButton5, b5)
-
b.Bind(wx.EVT_SET_FOCUS, self.OnButtonFocus) #bind button focus if needed
-
#bs = wx.BoxSizer(wx.ALIGN_BOTTOM)
-
#bs = wx.StaticBoxSizer(wx.
-
bs = wx.BoxSizer(wx.HORIZONTAL)#(wx.VERTICAL)#|wx.ALIGN_BOTTOM) #(wx.HORIZONTAL_HATCH) #(wx.VERTICAL)
-
#bs.Add(self.grid, 1, wx.GROW|wx.ALL, 5)
-
bs.Add(b) #add the button here numbered in par
-
bs.Add(b2)
-
bs.Add(b3)
-
bs.Add(b4)
-
bs.Add(b5)
-
#p.placed
-
bs = wx.BoxSizer(wx.VERTICAL)
-
bs.Add(self.grid, 1, wx.GROW|wx.ALL, 5)
-
p.SetSizer(bs)
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: chauhan |
last post by:
Hi,
I am new to pogramming.
I have written a small program which retrieves emails from server,
unless all the messages are loaded only then it...
|
by: Andre Loker |
last post by:
Hi!
For my current application I'm looking for a four-way-(cross) splitter
control (as often seen in 3D-editors). The .NET Splitter-class is...
|
by: MFRASER |
last post by:
How do I move the splitter inside of code.
if(TypeA)
{
this.pnlHXMLList.Visible = false;
this.splTop.is.Top = 65;
}
else
|
by: BBM |
last post by:
I'm trying to set up a form with two panels divided by a Splitter control.
I can make the Splitter work in the situations described in the...
|
by: Peter |
last post by:
Hi,
Does anyone know how to drag a splitter by coding.
I will put three controls on form1,two panels and a splitter. The first
panel's dock...
|
by: Sam |
last post by:
Hi,
I have a panel docked to the bottom of my form. This panel can be
expanded vertically by clicking on a button. When the user click on the...
|
by: aroraamit81 |
last post by:
Hi,
I am facing a trouble. I have some Session variables in my code and
somehow my session variables are getting mixed up with other users.
...
|
by: JDeats |
last post by:
I have a simple WinForm with a WinForms splitter down the middle. I
would like to make it so when the user clicks on a button inside the
left...
|
by: JDeats |
last post by:
I have a WinForm with three Splitter controls on it. The form divides
up in this order: Tab Control (docked to the left): Splitter1:
RichTextBox...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
| |