problem the window "hides"

I got the following screen in wxpython:

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantallazo1.png

when u start filling it up, i use a panel.Refresh() and a
panel.Layout() so it behaves correctly ... well the problem comes when
the static texts get more and more screen space the rest of the panel
"hides" and the scrollbar cant scroll it down ... if i resize the
window then its correctly shown (and scrollbar resized also).

here is a second screenshot so you can see it by yourselves (english
isnt my mother tongue)

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantallazo2.png

Well i know there should be some trick i cant figure, thanks for the
help!

Hi,

Sorry, I'm not too sure what you are asking, exactly?

Also, not to sound too harsh here, but you may think how else you could implement that interface. I'm positive that a user would find that UI quite cluttered and hard to use. Nothing personal, just an observation!

···

On 17/06/2010 19:32, monobot wrote:

I got the following screen in wxpython:

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantallazo1.png

when u start filling it up, i use a panel.Refresh() and a
panel.Layout() so it behaves correctly ... well the problem comes when
the static texts get more and more screen space the rest of the panel
"hides" and the scrollbar cant scroll it down ... if i resize the
window then its correctly shown (and scrollbar resized also).

here is a second screenshot so you can see it by yourselves (english
isnt my mother tongue)

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantallazo2.png

Well i know there should be some trick i cant figure, thanks for the
help!

--
Steven Sproat, BSc
http://www.whyteboard.org/

Which widget are you using? ScrolledWindow? ScrolledPanel? Or are you
doing the scrolling yourself? Also, which platform and wx version?

I almost wonder if you need to call Fit() somewhere in here...maybe
put the main panel in a sizer and then Fit it to the frame or
something...

···

On Jun 17, 1:32 pm, monobot <hector...@gmail.com> wrote:

I got the following screen in wxpython:

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantal

when u start filling it up, i use a panel.Refresh() and a
panel.Layout() so it behaves correctly ... well the problem comes when
the static texts get more and more screen space the rest of the panel
"hides" and the scrollbar cant scroll it down ... if i resize the
window then its correctly shown (and scrollbar resized also).

here is a second screenshot so you can see it by yourselves (english
isnt my mother tongue)

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantal

Well i know there should be some trick i cant figure, thanks for the
help!

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Also check that you're calling Layout on the correct sizer

···

On 17/06/2010 20:23, Mike Driscoll wrote:

On Jun 17, 1:32 pm, monobot<hector...@gmail.com> wrote:
   

I got the following screen in wxpython:

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantal

when u start filling it up, i use a panel.Refresh() and a
panel.Layout() so it behaves correctly ... well the problem comes when
the static texts get more and more screen space the rest of the panel
"hides" and the scrollbar cant scroll it down ... if i resize the
window then its correctly shown (and scrollbar resized also).

here is a second screenshot so you can see it by yourselves (english
isnt my mother tongue)

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantal

Well i know there should be some trick i cant figure, thanks for the
help!
     

Which widget are you using? ScrolledWindow? ScrolledPanel? Or are you
doing the scrolling yourself? Also, which platform and wx version?

I almost wonder if you need to call Fit() somewhere in here...maybe
put the main panel in a sizer and then Fit it to the frame or
something...

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

--
Steven Sproat, BSc
http://www.whyteboard.org/

@STEVEN
coments are allways wellcomed but maybe looks dificult for you since
its in 1other tongue (spanish in this case)beside that the soft is
specific for architects so they know exactly what its spected, anyway
ill think about it. thanks

the problme is how you can see on the 1st picture there is a grabar
(save) button on the bottom of the panel, but on the second picture
its "hidden" and the scroll is the lowest so u cant scroll down.

@MIKE
wxPython 2.8,
its a scrollpanel and im on windows.

@STEVEN (2nd post)
yes, the layout is on the correct panel.

Since Mike is my personal wxGuru(tm) i'll play around with the Fit
method to see if i can find a solution ... ill keep the list informed.

hello..

Am having troubles binding the wx.EVT_BUTTON event of a wx.BitmapButton..

I've tried the Bind(wx.EVT_BUTTON, FUNCT, BUTTON) and button.Bind(wx.EVT_BUTTON, FUNCT) and neither of them works..

I dont know if the problems is that the button is in a third level panel (I think this is how you call when you have a panel that is a child of a window that is a child of another panel, but you get the idea) but I put a normal button in that panel and the normal button works fine..

heres the code:

import wx

class MainFrame(wx.Frame):
     def __init__(self, parent, id, title):
         wx.Frame.__init__(self, parent, id, title, size=(800, 800))
         self.mainPanel = self.panel()
         self.leftWindow = self.scrolledWindow(self.mainPanel)
         self.rightWindow = self.bareWindow(self.mainPanel)

         box = wx.BoxSizer(wx.HORIZONTAL)
         box.Add(self.leftWindow, 1, wx.EXPAND)
         box.Add(self.rightWindow, 0)

         self.mainPanel.SetSizer(box)
         self.Centre()

     def panel(self):
         self.panel = wx.Panel(self, id=-1)
         return self.panel

     def scrolledWindow(self, parent):
         self.window = wx.ScrolledWindow(parent, -1)
         self.window.SetVirtualSize((2000, 2000))
         self.window.SetScrollRate(10, 10)
         return self.window

     def bareWindow(self, parent):
         self.window = wx.Window(parent, -1, style=wx.RAISED_BORDER)
         self.panel = wx.Panel(self.window, -1)
         sizer = wx.GridSizer(rows=0, cols=2, hgap=1, vgap=1)
         botonprueba = wx.BitmapButton(self.panel, wx.NewId(), wx.Bitmap("img/180bendS.png"))
         botonprueba.Bind = (wx.EVT_BUTTON, self.On180BendS)
         boton = wx.Button(self.panel, label="test", size=(38, 33))
         boton.Bind(wx.EVT_BUTTON, self.OnTest)
         sizer.Add(botonprueba, 0, 0)
         sizer.Add(boton, 0, 0)
         self.panel.SetSizer(sizer)
         self.panel.Fit()
         return self.window

     def OnTest(self, evt): print "Test"
     def On180BendS(self, evt): print "On 180 bendS"

     def rightButtonsData(self):
         return (("180bendS.png", self.On180BendS))

class App(wx.App):
      def OnInit(self):
          frame = MainFrame(None, -1, 'Application')
          frame.Show(True)
          return True

if __name__ == "__main__":
     app = App()
     app.MainLoop()

to test the script you need to copy this image [1] in the same folder of the script

[1] http://dl.dropbox.com/u/391810/180bendS.png

I agree, and it has nothing to do with the language it is in. There
should be a better way to display it.

···

On Thu, Jun 17, 2010 at 3:13 PM, Steven Sproat <sproaty@gmail.com> wrote:

On 17/06/2010 19:32, monobot wrote:

I got the following screen in wxpython:

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantallazo1.png

when u start filling it up, i use a panel.Refresh() and a
panel.Layout() so it behaves correctly ... well the problem comes when
the static texts get more and more screen space the rest of the panel
"hides" and the scrollbar cant scroll it down ... if i resize the
window then its correctly shown (and scrollbar resized also).

here is a second screenshot so you can see it by yourselves (english
isnt my mother tongue)

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantallazo2.png

Well i know there should be some trick i cant figure, thanks for the
help!

Hi,

Sorry, I'm not too sure what you are asking, exactly?

Also, not to sound too harsh here, but you may think how else you could
implement that interface. I'm positive that a user would find that UI quite
cluttered and hard to use. Nothing personal, just an observation!

Hi,

hello..
def bareWindow(self, parent):
self.window = wx.Window(parent, -1, style=wx.RAISED_BORDER)
self.panel = wx.Panel(self.window, -1)
sizer = wx.GridSizer(rows=0, cols=2, hgap=1, vgap=1)
botonprueba = wx.BitmapButton(self.panel, wx.NewId(),
wx.Bitmap("img/180bendS.png"))
botonprueba.Bind = (wx.EVT_BUTTON, self.On180BendS)

Take a close look at this line ^ and I think you will see why it doesn't work :wink:

   boton = wx\.Button\(self\.panel, label=&quot;test&quot;, size=\(38, 33\)\)
   boton\.Bind\(wx\.EVT\_BUTTON, self\.OnTest\)

Cody

···

On Thu, Jun 17, 2010 at 3:25 PM, Fidel Sanchez-Bueno <fidellira.6@gmail.com> wrote:

JAJAJAJAJA...

thanks!!, I dont have any excuse for that terrible mistake xD..

El 17/06/2010 05:24 p.m., Cody Precord escribi�:

···

Hi,

On Thu, Jun 17, 2010 at 3:25 PM, Fidel Sanchez-Bueno > <fidellira.6@gmail.com> wrote:
   

hello..
    def bareWindow(self, parent):
        self.window = wx.Window(parent, -1, style=wx.RAISED_BORDER)
        self.panel = wx.Panel(self.window, -1)
        sizer = wx.GridSizer(rows=0, cols=2, hgap=1, vgap=1)
        botonprueba = wx.BitmapButton(self.panel, wx.NewId(),
wx.Bitmap("img/180bendS.png"))
        botonprueba.Bind = (wx.EVT_BUTTON, self.On180BendS)
     

Take a close look at this line ^ and I think you will see why it doesn't work :wink:

        boton = wx.Button(self.panel, label="test", size=(38, 33))
        boton.Bind(wx.EVT_BUTTON, self.OnTest)
     
Cody

When you add new widgets then you need to tell the ScrolledPanel that the virtual size of the form has changed. You can do that by calling SetupScrolling again, passing False for scrollToTop so the scroll position won't change.

···

On 6/17/10 11:32 AM, monobot wrote:

I got the following screen in wxpython:

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantallazo1.png

when u start filling it up, i use a panel.Refresh() and a
panel.Layout() so it behaves correctly ... well the problem comes when
the static texts get more and more screen space the rest of the panel
"hides" and the scrollbar cant scroll it down ... if i resize the
window then its correctly shown (and scrollbar resized also).

here is a second screenshot so you can see it by yourselves (english
isnt my mother tongue)

http://monobotblog.alvarezalonso.es/wp-content/uploads/2010/06/pantallazo2.png

Well i know there should be some trick i cant figure, thanks for the
help!

--
Robin Dunn
Software Craftsman

Take a closer look at this line and see if you can figure it out.

···

On 6/17/10 1:25 PM, Fidel Sanchez-Bueno wrote:

hello..

Am having troubles binding the wx.EVT_BUTTON event of a wx.BitmapButton..

I've tried the Bind(wx.EVT_BUTTON, FUNCT, BUTTON) and
button.Bind(wx.EVT_BUTTON, FUNCT) and neither of them works..

I dont know if the problems is that the button is in a third level panel
(I think this is how you call when you have a panel that is a child of a
window that is a child of another panel, but you get the idea) but I put
a normal button in that panel and the normal button works fine..

heres the code:

botonprueba.Bind = (wx.EVT_BUTTON, self.On180BendS)

--
Robin Dunn
Software Craftsman