Notebook problems under Ubuntu

hello,

trying to test my program under Linux,
(not knowing anything about Linux),
I installed Ubuntu in Virtual Box,
and tried to run the script in Ubuntu
(oh what is that terrible complex, coming from windows :wink:
and get the following error:
聽聽聽聽Segmentation fault
(Remembers me of windows 10 years ago :wink:

Now I cut my program to the minimum,
and it looks that the Notebook is causing the problems.
(I can run other Python scripts in Ubuntu correctly)

Could someone verify that the program given below is not working in Ubuntu ( and mayby other Linux systems) ?

Does someone has a solution or work around ?

Here are the wx versions:
Ubuntu : '2.8.7.1 (gtk2-unicode)'
Windows: '2.8.7.1 (msw-unicode)'

thanks,
Stef Mientki

import wx

class Simple_Test_Form ( wx.MiniFrame ):
聽聽def __init__ ( self ):
聽聽聽聽wx.MiniFrame.__init__( self, None, style = wx.DEFAULT_FRAME_STYLE )
聽聽聽聽聽聽聽聽self.NB=wx.Notebook( self,style = wx.NO_BORDER)

聽聽聽聽p4=wx.Panel( self.NB,name = 'Demos')
聽聽聽聽self.NB.AddPage ( p4, 'AAP', imageId = 0)

聽聽聽聽Sizer = wx.BoxSizer ( )
聽聽聽聽Sizer.Add ( self.NB, 1, wx.EXPAND )
聽聽聽聽self.SetSizer ( Sizer )

if __name__ == '__main__':
聽聽app = wx.PySimpleApp ()
聽聽frame = Simple_Test_Form ()
聽聽frame.Show ( True )
聽聽app.MainLoop ()

Sunday, October 12, 2008, 6:37:00 PM, Stef Mientki wrote:

hello,

trying to test my program under Linux,
(not knowing anything about Linux),
I installed Ubuntu in Virtual Box,
and tried to run the script in Ubuntu
(oh what is that terrible complex, coming from windows :wink:
and get the following error:
    Segmentation fault
(Remembers me of windows 10 years ago :wink:

Now I cut my program to the minimum,
and it looks that the Notebook is causing the problems.
(I can run other Python scripts in Ubuntu correctly)

Could someone verify that the program given below is not working in
Ubuntu ( and mayby other Linux systems) ?

Does someone has a solution or work around ?

Here are the wx versions:
Ubuntu : '2.8.7.1 (gtk2-unicode)'
Windows: '2.8.7.1 (msw-unicode)'

thanks,
Stef Mientki

import wx

class Simple_Test_Form ( wx.MiniFrame ):
  def __init__ ( self ):
    wx.MiniFrame.__init__( self, None, style = wx.DEFAULT_FRAME_STYLE )
    
    self.NB=wx.Notebook( self,style = wx.NO_BORDER)

    p4=wx.Panel( self.NB,name = 'Demos')
    self.NB.AddPage ( p4, 'AAP', imageId = 0)

    Sizer = wx.BoxSizer ( )
    Sizer.Add ( self.NB, 1, wx.EXPAND )
    self.SetSizer ( Sizer )

if __name__ == '__main__':
  app = wx.PySimpleApp ()
  frame = Simple_Test_Form ()
  frame.Show ( True )
  app.MainLoop ()

Have you tried passing an id?

  self.NB=wx.Notebook(self, wx.ID_ANY, style=wx.NO_BORDER)

     and
  
  p4=wx.Panel(self.NB, wx.ID_ANY, name='Demos')

-- tacao

No bits were harmed during the making of this e-mail.

Stef Mientki a 茅crit :

hello,

trying to test my program under Linux,
(not knowing anything about Linux),
I installed Ubuntu in Virtual Box,
and tried to run the script in Ubuntu
(oh what is that terrible complex, coming from windows :wink:
and get the following error:
   Segmentation fault
(Remembers me of windows 10 years ago :wink:

Now I cut my program to the minimum,
and it looks that the Notebook is causing the problems.
(I can run other Python scripts in Ubuntu correctly)

Could someone verify that the program given below is not working in Ubuntu ( and mayby other Linux systems) ?

Does someone has a solution or work around ?

Here are the wx versions:
Ubuntu : '2.8.7.1 (gtk2-unicode)'
Windows: '2.8.7.1 (msw-unicode)'

thanks,
Stef Mientki

import wx

class Simple_Test_Form ( wx.MiniFrame ):
def __init__ ( self ):
   wx.MiniFrame.__init__( self, None, style = wx.DEFAULT_FRAME_STYLE )
      self.NB=wx.Notebook( self,style = wx.NO_BORDER)

   p4=wx.Panel( self.NB,name = 'Demos')
   self.NB.AddPage ( p4, 'AAP', imageId = 0)

   Sizer = wx.BoxSizer ( )
   Sizer.Add ( self.NB, 1, wx.EXPAND )
   self.SetSizer ( Sizer )

if __name__ == '__main__':
app = wx.PySimpleApp ()
frame = Simple_Test_Form ()
frame.Show ( True )
app.MainLoop ()

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

If you don't use imageId, don't set it:

self.NB.AddPage ( p4, 'AAP')
or
self.NB.AddPage ( p4, 'AAP', imageId = -1)

will work on my slack

路路路

--
jmp

thanks Jean-Marie and Tacao,

both changes were necessary to make it run correctly under Ubuntu.
The code might have looked a bit strange,
but that's because this code was generated by a program,
so I'll adapt the generator.

thanks again,
Stef

路路路

If you don't use imageId, don't set it:

self.NB.AddPage ( p4, 'AAP')
or
self.NB.AddPage ( p4, 'AAP', imageId = -1)

will work on my slack

correction:

Stef Mientki wrote:

thanks Jean-Marie and Tacao,

both changes were necessary to make it run correctly under Ubuntu.

Only the imageId is necessary,
so apparently you're not allowed to specify the imageId,
before assigning the imagelist,
...
but then it's a bug in the Ubuntu version of wxPython, or not ?

Stef

路路路

The code might have looked a bit strange,
but that's because this code was generated by a program,
so I'll adapt the generator.

thanks again,
Stef

If you don't use imageId, don't set it:

self.NB.AddPage ( p4, 'AAP')
or
self.NB.AddPage ( p4, 'AAP', imageId = -1)

will work on my slack

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Stef Mientki a 茅crit :

Only the imageId is necessary,
so apparently you're not allowed to specify the imageId,
before assigning the imagelist,
...
but then it's a bug in the Ubuntu version of wxPython, or not ?

Defining a pointer to a non existing list is a programmer's fault that might go undetected under the Windows version of wxPython :wink:

路路路

--
jmp

Stef Mientki wrote:

correction:

Stef Mientki wrote:

thanks Jean-Marie and Tacao,

both changes were necessary to make it run correctly under Ubuntu.

Only the imageId is necessary,
so apparently you're not allowed to specify the imageId,
before assigning the imagelist,
...
but then it's a bug in the Ubuntu version of wxPython, or not ?

Not. One of the core wx developers once said something to this effect: wxWidgets is about making properly written code behave the same way on all supported platforms, *not* about making improperly written code to behave or misbehave in the same ways on all platforms.

In other words, trying to use an image before there is an image list is improper, but the fact that it happens to work okay on MSW is just an accident.

路路路

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!