Hi! Someone know what could be happening with my code... I want to use the attribute wxSASH_NONE like that above in my code but when I run my program has a like that "Segmentation fault". I have other widget with this attribute and it works fine.
self.size1=(40,300)
self.leftwin = wxSashLayoutWindow(self,10,wxPoint(0,0),wxSize(self.size1[0],self.size1[1]), wxRAISED_BORDER)
self.leftwin.SetSashVisible(wxSASH_NONE, true)
Diego
Diego Prestes wrote:
Hi! Someone know what could be happening with my code... I want to use
the attribute wxSASH_NONE like that above in my code but when I run my
program has a like that "Segmentation fault". I have other widget with
this attribute and it works fine.
self.size1=(40,300)
self.leftwin =
wxSashLayoutWindow(self,10,wxPoint(0,0),wxSize(self.size1[0],self.size1[1]),
wxRAISED_BORDER)
self.leftwin.SetSashVisible(wxSASH_NONE, true)
For starters, it looks from the docs like SetSashVisible() is a method
of wxSashWindow, not wxSashLayoutWindow, so you probably want
self.SetSashVisible()
Second, SetSashVisible() takes as the first parameter the edge flag. the
options are one of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT,
so I'm not sure if wxSASH_NONE is an option.
Take a look at the demo code for wxSashWindow, and if you are still
having problems, post a bit more code, and we'll have a better idea what
you are trying to do.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
I dont know if Im right but I found this wxSASH_NONE together the others so I use this in the rightwin and it works but in the left dont. Im using this because when I use the wxSASH_RIGHT, for example, always have a <-> (sorry I forgot the name in english hehe), in the right side of the window for rezise this window, but my program dont need this so I want to take out this. I dont know if have other way to do this.
Diego
self.size1=(40,300) #This var is for enter the size of the leftwin self.leftwin=wxSashLayoutWindow(self,10,wxPoint(0,0),wxSize(self.size1[0],self.size1[1]), wxRAISED_BORDER) #30 e largura e 300 a altura
self.leftwin.SetSashVisible(wxSASH_RIGHT, true)
bot1 = wxButton(self.leftwin, 11, "Q", wxPoint(3,3), wxSize(30,30))
bot2 = wxButton(self.leftwin, 12, "C", wxPoint(3,40), wxSize(30,30))
self.rightwin = wxSashLayoutWindow(self,20,wxPoint(self.size1[0],0),wxSize(300,300))
self.rightwin.SetSize(wxSize(200,300))
self.rightwin.SetSashVisible(wxSASH_NONE, true)
mycanvas=MyShape(self.rightwin)
Chris Barker wrote:
···
Diego Prestes wrote:
Hi! Someone know what could be happening with my code... I want to use
the attribute wxSASH_NONE like that above in my code but when I run my
program has a like that "Segmentation fault". I have other widget with
this attribute and it works fine.
self.size1=(40,300)
self.leftwin =
wxSashLayoutWindow(self,10,wxPoint(0,0),wxSize(self.size1[0],self.size1[1]),
wxRAISED_BORDER)
self.leftwin.SetSashVisible(wxSASH_NONE, true)
For starters, it looks from the docs like SetSashVisible() is a method
of wxSashWindow, not wxSashLayoutWindow, so you probably want
self.SetSashVisible()
Second, SetSashVisible() takes as the first parameter the edge flag. the
options are one of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT,
so I'm not sure if wxSASH_NONE is an option.
Take a look at the demo code for wxSashWindow, and if you are still
having problems, post a bit more code, and we'll have a better idea what
you are trying to do.
-Chris
Diego Prestes wrote:
I dont know if Im right but I found this wxSASH_NONE together the others
so I use this in the rightwin and it works but in the left dont. Im
using this because when I use the wxSASH_RIGHT, for example, always have
a <-> (sorry I forgot the name in english hehe), in the right side of
the window for rezise this window, but my program dont need this so I
want to take out this. I dont know if have other way to do this.
I may be misuderstanding what you want, but if you don't want to be able
to re-size the window, then you don't need a SashWindow. You just want
to put a couple of wxPanels on frame. You can use pixel coordinates to
position them, or you can use sizers, but there is no need for the
SashWindow.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov