ScrolledPanel start problems

I try to work with ScrolledPanel but it doesn't run. So I created a
simplified code to demonstrate it. Of course I looked at the demo.py.
Looks nice and work. But I am not able to adapt the code from there.

When I run the code I get (with wxPhoenix and Py3) some gtk-errors.
[err]
(process:15066): GLib-GObject-WARNING **: invalid (NULL) pointer
instance
(process:15066): GLib-GObject-CRITICAL **: g_signal_connect_data:
assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap:
assertion 'GDK_IS_SCREEN (screen)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_colormap_get_visual:
assertion 'GDK_IS_COLORMAP (colormap)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap:
assertion 'GDK_IS_SCREEN (screen)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_screen_get_root_window:
assertion 'GDK_IS_SCREEN (screen)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_screen_get_root_window:
assertion 'GDK_IS_SCREEN (screen)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_window_new: assertion
'GDK_IS_WINDOW (parent)' failed Speicherzugriffsfehler (Speicherabzug
geschrieben)
[/err]

That is the code
[code]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import wx
import wx.lib.scrolledpanel

class MyCtrl(wx.Panel):
    def __init__(self, parent):
        super(MyCtrl, self).__init__(parent)
        sz = wx.BoxSizer(wx.HORIZONTAL)
        sz.Add(wx.TextCtrl(self))
        sz.Add(wx.TextCtrl(self))
        self.SetSizer(sz)

class MyDialog(wx.Dialog):
    def __init__(self, parent):
        super(MyDialog, self).__init__(parent,
style=wx.RESIZE_BORDER|wx.DEFAULT_DIALOG_STYLE) sz =
wx.BoxSizer(wx.VERTICAL) sz.Add(wx.StaticText(self, label='Text'))

        p = wx.lib.scrolledpanel.ScrolledPanel(self)
        ps = wx.BoxSizer(wx.VERTICAL)
        ps.Add(MyCtrl(p))
        ps.Add(MyCtrl(p))
        p.SetSizer(ps)

        sz.Add(p)
        sz.Add(wx.StaticText(self, label='Text'))
        self.SetSizer(sz)

if __name__ == '__main__':
    with MyDialog(None) as dlg:
        dlg.ShowModal()
    app.MainLoop()
[/code]

Hhm, on Windows I get an exception that a wx.App is required before instantiating the dialog, but that does not show on Linux Mint 17, on their I get the same assert errors as you.

Hopefully Robin can improve that error handling. If Robin doesn't react/see this one maybe create a Trac ticket so it does not get forgotten.

http://trac.wxwidgets.org/

Werner

scrolledP.py (919 Bytes)

···

On 4/5/2015 4:38, c.buhtz@posteo.jp wrote:

I try to work with ScrolledPanel but it doesn't run. So I created a
simplified code to demonstrate it. Of course I looked at the demo.py.
Looks nice and work. But I am not able to adapt the code from there.

When I run the code I get (with wxPhoenix and Py3) some gtk-errors.
[err]
(process:15066): GLib-GObject-WARNING **: invalid (NULL) pointer
instance
(process:15066): GLib-GObject-CRITICAL **: g_signal_connect_data:
assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap:
assertion 'GDK_IS_SCREEN (screen)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_colormap_get_visual:
assertion 'GDK_IS_COLORMAP (colormap)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap:
assertion 'GDK_IS_SCREEN (screen)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_screen_get_root_window:
assertion 'GDK_IS_SCREEN (screen)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_screen_get_root_window:
assertion 'GDK_IS_SCREEN (screen)' failed
(process:15066): Gdk-CRITICAL **: IA__gdk_window_new: assertion
'GDK_IS_WINDOW (parent)' failed Speicherzugriffsfehler (Speicherabzug
geschrieben)
[/err]

I checked with the current Phoenix (3.0.3.dev1784+18750f4 gtk2
(phoenix)) on Lubuntu 14.04.2.
The problem is still there.

I am so stupid. No bug!

···

On 2015-04-05 04:38 <c.buhtz@posteo.jp> wrote:

if __name__ == '__main__':
    with MyDialog(None) as dlg:
        dlg.ShowModal()
    app.MainLoop()

There is no instance of app. But I wonder that there is no simple and
understandable error message about it.

The version I had attached to the previous replay works for me, just rechecked it on my Linux Mint 17 (another Ubuntu deverative). I see the error if I comment line 35 the InspectableApp but otherwise the window shows up without any errors.

This is on Python 3.4 with the same Phoenix version.

Werner

···

On 4/6/2015 1:55, c.buhtz@posteo.jp wrote:

I checked with the current Phoenix (3.0.3.dev1784+18750f4 gtk2
(phoenix)) on Lubuntu 14.04.2.
The problem is still there.

Werner wrote:

Hhm, on Windows I get an exception that a wx.App is required before
instantiating the dialog, but that does not show on Linux Mint 17, on
their I get the same assert errors as you.

Hopefully Robin can improve that error handling. If Robin doesn't
react/see this one maybe create a Trac ticket so it does not get forgotten.

Phoenix doesn't have the must-have-app checks in place yet. (It's on the TODO list.) You probably ran it with Classic on Windows. Classic on Linux will give you the same exception. For now, Phoenix users just need to be a bit more careful.

···

--
Robin Dunn
Software Craftsman

I want to suggest that you use the
documentation/bug-tracking/issue-system of your repository hosting
webservice (github).

This would make it much easier to look for (un)known problems, issues,
plans, etc

That would save your time and energy because you wouldn't need to read
and answer mails like mine.

Even in the official wxWidgets bug-tracker are no tags (version,
branch, etc) for the wxPhoenix project and wxPython-versions - and there
shouldn't.

Maybe you see me as a troll. Ok, this is your free right.
But I am just so hard and sometimes emotional to this topic because
wxPython/Phoenix is quite important for the Python and open-source
world.
But for me it looks like a one-man-show. And you work really hard for
that no one other can contribute to it. e.g. the docu-problem still
isn't solved.
Just think about... Maybe your are not able to work on that project (I
don't want to imagine a reason for that), who will go on with your
work? There is no one because no one can understand what you are doing
there and how do you do it. Understanding and contributing to the linux
kernel is even easier.
Please think about to make your work and project more open to other
people. Just uploading source to a repository doesn't make it "open".

This would save time and energy for you and other people and would
speed up and improve the development of wxPython.

···

On 2015-04-07 12:36 Robin Dunn <robin@alldunn.com> wrote:

(It's on the TODO list.)

(It's on the TODO list.)

I want to suggest that you use the
documentation/bug-tracking/issue-system of your repository hosting
webservice (github).

wxWidgets and wxPython are using the http://trac.wxwidgets.org/
There was a discussion recently on the wx-dev list and they decided to stay on trac.

This would make it much easier to look for (un)known problems, issues,
plans, etc

That would save your time and energy because you wouldn't need to read
and answer mails like mine.

Even in the official wxWidgets bug-tracker are no tags (version,
branch, etc) for the wxPhoenix project and wxPython-versions - and there
shouldn't.

The version of wxPython is the same as wxWidgets, so no need for specific version entries.

Under "Component" there are entries which are wxPython specific, e.g. "AGW", "Phoenix", "wxPython"

Maybe you see me as a troll. Ok, this is your free right.
But I am just so hard and sometimes emotional to this topic because
wxPython/Phoenix is quite important for the Python and open-source
world.
But for me it looks like a one-man-show. And you work really hard for
that no one other can contribute to it.

I am using wxPython now for about 10 years and have seen quite a few contributors come and go, just check e.g. the commit log. Robin would sure welcome more contributors but he can not clone himself nor make commitment for others - the others have to step forward and start contributing.

  e.g. the docu-problem still
isn't solved.

Which one? The SetAutoLayout is not a problem - see responses in the thread.

Just think about... Maybe your are not able to work on that project (I
don't want to imagine a reason for that), who will go on with your
work?

I don't think anyone knows what would happen.

  There is no one because no one can understand what you are doing
there and how do you do it. Understanding and contributing to the linux
kernel is even easier.

To me it is quit clear on how I can contribute, at least for the things I can and want to contribute too.

I think you need to be more specific in your question, to get an answer. What do you want to contribute too, in wx.lib, in C++, in the build process ..........???

Please think about to make your work and project more open to other
people. Just uploading source to a repository doesn't make it "open".

Are you really serious here, or is this just a little exaggeration to get a reaction?!

Werner

···

On 4/8/2015 1:47, c.buhtz@posteo.jp wrote:

On 2015-04-07 12:36 Robin Dunn <robin@alldunn.com> wrote: