problem the window "hides" ( II )

the post was stolen, still having the same problem ... following
Steven Sproat's advice i changed the UI ... i think that now its more
intuitive and less messy.

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

Well i couldnt fix the "hidding" thing ..

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

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

i have to say that im lost :frowning:

Did you try Robin’s suggestion?

···

On Sat, Jun 19, 2010 at 4:40 AM, monobot hector.aa@gmail.com wrote:

the post was stolen, still having the same problem … following

Steven Sproat’s advice i changed the UI … i think that now its more

intuitive and less messy.

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

Well i couldnt fix the “hidding” thing …

@MIKE

wxPython 2.8,

its a scrollpanel and im on windows.

@STEVEN (2nd post)

yes, the layout is on the correct panel.

i have to say that im lost :frowning:

Mike Driscoll

Blog: http://blog.pythonlibrary.org

well i couldnt fin SetupScrolling method ...
now ive looked at it again (after you pointed it) im sure he meant to
SetScrollbars ... and YES ... using that method my problem is
solved ... many thanks to both of you!!

quoting mr Robin Dunn

"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."

well ive looked at the second part of his advice, and sorry i cant
find that scrollToTop method he is talking about, now its very anoying
to see the scroll back to top everytime the user enters data.
here is a small code that reproduces the efect (with the SetScrollbars
thing correctly done)

ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
class MyApp(wx.App):
    def OnInit(self):
        pos=(50,50)
        size=(150,50)
        marco=marcoprincipal('no hace nada', pos = (50,50), size =
(550,350))
        marco.Show(True)
        self.SetTopWindow(marco)
        return True

class marcoprincipal(wx.Frame):
    def __init__(self,title, pos, size):
        wx.Frame.__init__(self,None,-1,title, pos, size)

        self.ventana = wx.ScrolledWindow(self)
        self.ventana.SetBackgroundColour('wheat')
        self.ventana.Show=(True)

        self.ventana.pulsador = wx.Button(self.ventana, -1, 'Press
me', size=(150,50))
        self.ventana.pulsador.Bind(wx.EVT_BUTTON, self.pulsar)

        sizerpral = wx.BoxSizer(wx.VERTICAL)

        sizer1col = wx.FlexGridSizer( cols=1, hgap=15, vgap=5)
        sizer1col.AddGrowableCol(0)
        fuentenegrita = wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.BOLD)

        self.a = wx.StaticText(self.ventana, -1, "Column A")
        self.a.SetFont(fuentenegrita)
        self.abis = wx.StaticText(self.ventana, -1, "")
        self.abis.SetFont(fuentenegrita)
        self.b = wx.StaticText(self.ventana, -1, "Column B")
        self.b.SetFont(fuentenegrita)
        self.bbis = wx.StaticText(self.ventana, -1, "")
        self.bbis.SetFont(fuentenegrita)

        sizer1col.Add(self.a, 0, wx.ALIGN_LEFT)
        sizer1col.Add(self.abis, 0, wx.ALIGN_RIGHT)
        sizer1col.Add(self.b, 0, wx.ALIGN_LEFT)
        sizer1col.Add(self.bbis, 0, wx.ALIGN_RIGHT)
        sizer1col.Add(self.ventana.pulsador, 0, wx.ALIGN_RIGHT)

        sizerpral.Add(sizer1col)

        self.ventana.SetSizer(sizerpral)

        sizer = wx.BoxSizer()
        sizer.Add(self.ventana, 1, wx.EXPAND)

        self.ventana.Refresh()
        self.ventana.Layout()
        self.ventana.SetScrollbars(10, 10, 50, 50)

    def pulsar(self,event):
        leea = self.abis.GetLabel()
        self.abis.SetLabel(leea+'\nnewline')

        self.ventana.Refresh()
        self.ventana.Layout()
        self.ventana.SetScrollbars(10, 10, 50, 50)

if __name__=='__main__':
    aplicacion=MyApp()
    aplicacion.MainLoop()
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

"scrollToTop" is not a method but a parameter of the method SetupScrolling which is available in wx.lib.scrolledpanel.

It seems that on top of that one also needs to call "ScrollChildIntoView", but this causes a flickering/repositioning of the button which is not nice at all.

Haven't followed this thread, so I am not sure what you really want to accomplish and I wonder if the structure/layout of the widgets is really what you want, i.e. shouldn't the button be on its own panel and be always visible?

Werner

scrolled-hector.py (2.71 KB)

···

On 21/06/2010 10:39, monobot wrote:

quoting mr Robin Dunn

"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."

well ive looked at the second part of his advice, and sorry i cant
find that scrollToTop method he is talking about, now its very anoying
to see the scroll back to top everytime the user enters data.
here is a small code that reproduces the efect (with the SetScrollbars
thing correctly done)

Thanks Werner for your answer ... you adressed me to the sollution ...
i was using a incorrect class it seems (scrolledWindow instead of
ScrolledPanel), thats why i couldnt find the correct method at the
start and neither the argument at the end :slight_smile:

Now it works like a charm.
Many thanks to all 3, Mike driscoll, Robin Dunn and Werner

···

On 21 jun, 10:27, werner <wbru...@free.fr> wrote:

On 21/06/2010 10:39, monobot wrote:> quoting mr Robin Dunn

> "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."

> well ive looked at the second part of his advice, and sorry i cant
> find that scrollToTop method he is talking about, now its very anoying
> to see the scroll back to top everytime the user enters data.
> here is a small code that reproduces the efect (with the SetScrollbars
> thing correctly done)

"scrollToTop" is not a method but a parameter of the method
SetupScrolling which is available in wx.lib.scrolledpanel.

It seems that on top of that one also needs to call
"ScrollChildIntoView", but this causes a flickering/repositioning of the
button which is not nice at all.

Haven't followed this thread, so I am not sure what you really want to
accomplish and I wonder if the structure/layout of the widgets is really
what you want, i.e. shouldn't the button be on its own panel and be
always visible?

Werner

scrolled-hector.py
2 KVerDescargar