pmahata | 1 Feb 06:09
Picon

How to create a MoveAfterInTabOrder for BoxSizer

Hi,

 I have a wx.Dialog and a few widgets on it including a wx.ComboBox.
For some reason, I need to group the wx.ComboBox together with a
statictext in a wx.BoxSizer. Now, I will need to change the order of
the widgets after their creation. However, wx.BoxSizer is not a widget
and it does not have the MoveAfterInTabOrder functionality and I need
to implement that. Can anyone give any hint on how to do that?

Thanks and Regards.
PM

--

-- 
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

werner | 1 Feb 10:48
Picon
Favicon

Re: Re: Save all panels of aui.notebook

Hi Tobias,

On 01/02/2012 00:48, Tobias Weber wrote:
> Am 31.01.12 22:38, schrieb Mike Driscoll:
>> There's a way to save the perspective, which I think is what you're
>> talking about. This old thread might help:
>> http://wxpython-users.1045709.n5.nabble.com/agw-aui-perspectives-td2372970.html
> ThanX- I figured from the demo how to save the perspectives, but this is
> "only" for the frames, not the notebook, i.e. tabs.
In the 2.9.3.1 demo?  Just tried and it works for me using the "Example 2".
>
>> There's also the PersistentControls thing:
>> https://groups.google.com/forum/#!topic/wxpython-users/4yRpm-ogHzE
>>
> This thread adresses exactly my problem.
> Werner, have you gotten around to solve this problem. Is saving the
> notebook implemented working yet?
I am not sure what you think I solved in that thread as I didn't 
participate in it;-) .

But I am using persistence in my new stuff which is wxPython 2.9.x 
based, there where some issues with I worked out with Andrea.  I 
think/guess that the persistance stuff in SVN is also compatible with 
2.8.x, but I am not sure.

One thing to watch out is that you have to use SetName on controls you 
want to persist and the name has to be unique, I think per persistence 
manager.

Werner
(Continue reading)

Fabio Spadaro | 1 Feb 11:36
Picon

run as admin

Hi all.

I created my standalones with py2exe, including a manifest
to keep the XP look and feel and i build my package using Inno Setup.

For some users who have installed my application happens that they fail to launch the application by clicking on the icon but only by right clicking  and "run as administrator" on the Section menu.
How can I avoid everything.

Here it is setup.py:

from distutils.core import setup
import py2exe
import os
import re
import shutil


src.append(("language",["language/italian", "language/english"]))
src.append(("",["readme.txt", "license.txt"]))

#src.append(("sys\\etc\\lobb1\\lib\\sys\\data",[])) 
#src.append(("sys\\file",[])) 

manifest = """
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
    version="0.64.1.0"
    processorArchitecture="x86"
    name="Controls"
    type="win32"
/>
<description>Your Application</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>
"""

RT_MANIFEST = 24



setup(
    options = {"py2exe": {"compressed": 1,
                          "optimize": 2}},
    version = "1.9.73",
    description = "sqlwxpy application",
    name = "sqlwxpy application",

    zipfile = "lib/shardlib",

    windows = [{"script": "SqliteRoot.py","icon_resources":[(0x0001,"icon.ico")],
    "other_resources":[(RT_MANIFEST, 1, manifest)]}],
    data_files = src
)


shutil.copy('SqliteRoot.iss','dist')
shutil.copy('readme.txt','dist')
shutil.copy('license.txt','dist')
shutil.copy('logo.ico','dist')


--
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:

--
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
pploo | 1 Feb 16:27
Picon

"segmentation fault" from Sax2 with wxPython2.8

Previously I wrote a GUI with Python 2.4.3, wxPython 2.4.x, under
linux. Now I am porting it with python 2.6.6, and wxPython 2.8 (I
compiled the code from scratch). The majority of the GUI still works.
But there are some problems with Sax2. The following is some major
lines of code.

from xml.dom.ext.reader import Sax2

reader = Sax2.Reader()
file = open(FILENAME)
file_string=file.read()
doc = reader.fromString(file_string) // crashes here with
"segmentation fault" error.

However, If I do not use wxPython, just under the python, it is fine.

what is the problem?

--

-- 
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Paul | 1 Feb 16:47
Picon

Re: How to customize platebutton to do away with label colour changes

>>Do you have an example of how SetLabelColor ?breaks down"?

I was possibly a little hasty in blaming the platebutton for the
problems I was having; It seems
it was more to do with using wx.NullColor as the highlight colour, and/
or
the fact that the button was also being used as a droptarget.
Implementing
your suggestion has worked well.

Paul.

--

-- 
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

werner | 1 Feb 16:56
Picon
Favicon

Re: "segmentation fault" from Sax2 with wxPython2.8

On 01/02/2012 16:27, pploo wrote:
> Previously I wrote a GUI with Python 2.4.3, wxPython 2.4.x, under
> linux. Now I am porting it with python 2.6.6, and wxPython 2.8 (I
> compiled the code from scratch). The majority of the GUI still works.
> But there are some problems with Sax2. The following is some major
> lines of code.
>
> from xml.dom.ext.reader import Sax2
>
> reader = Sax2.Reader()
> file = open(FILENAME)
is this save?  "file" is a Python built-in which you overwrite and 
"open" returns a "file" type.

would be better to call it e.g. "saxFile" or "myFile" ....
> file_string=file.read()
> doc = reader.fromString(file_string) // crashes here with
> "segmentation fault" error.
>
> However, If I do not use wxPython, just under the python, it is fine.
None of the above shows wx code, can you re-produce this in a small 
sample?  If you do "import wx" before the above code does it already 
happen or is more needed?

Werner

--

-- 
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Paul | 1 Feb 17:09
Picon

wx.EVT_PAINT events: does sizer-type matter?

For more hours than I'd like to admit I've trying to put a custom
control (with a wx.EVT_PAINT handler) in a sizer.
I eventually managed a very simple example, but was surprised that the
only difference between the example that worked and the many that
didn't was the type of sizer in which I placed the control:
wx.gridsizer = working,  BoxSizers/Flexgridsizers=not working (see
code below). On further investigation it seems that when using
BoxSizers or Flexgridsizers an EVT_PAINT event is never raised, since
the bound event handler never runs. Can anyone explain what's going
on?

import wx

class Canvas(wx.PyControl):
	def __init__(self, parent):
		super(Canvas, self).__init__(parent)

		self.Bind(wx.EVT_PAINT, self.OnPaint)

	def OnPaint(self, event):
		print "OnPaint called as expected"
		dc = wx.PaintDC(self)
		dc.DrawText("Hello World!", 5, 5)

class MyApp(wx.App):
	def OnInit(self):
		self.frame = Example(None, title="Top frame")
		self.frame.Show()
		return True

class Example(wx.Frame):
	def __init__(self, parent, title):
		super(Example, self).__init__(parent, title=title)

		self.panel = MyPanel(self)

		frameSizer = wx.BoxSizer(wx.VERTICAL)
		frameSizer.Add(self.panel, 1, wx.EXPAND)
		self.SetSizer(frameSizer)

class MyPanel(wx.Panel):

	def __init__(self, parent):
		super(MyPanel, self).__init__(parent)

		self.__DoLayout()

	def __DoLayout(self):

		wdg = Canvas(self)
		# if msizer is a BoxSizer nothing is visible, and OnPaint is never
called.
		# if msizer is a GridSizer it works as expected

		#msizer = wx.BoxSizer(wx.VERTICAL)
		msizer = wx.GridSizer(1,1,0,0)

		msizer.AddSpacer((20,20))
		msizer.Add(wdg, 0, wx.EXPAND, 5)
		msizer.AddSpacer((20,20))

		self.SetSizer(msizer)

if __name__ == '__main__':

	app = MyApp(False)
	app.MainLoop()

--

-- 
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

PeterW | 1 Feb 17:17
Favicon

Re: wx.lib.plot size appears to be broken in some way

Thanks Robin

I'm not sure what you mean by  "sizer is set to fully expand it", I've
set the wx.EXPAND flag and it does nothing.
However SetMinSize did the trick and the sizer now correctly expands
the plot.
But why doesn't SetSize work?

Cheers

Peter

On Jan 31, 5:28 pm, Robin Dunn <ro...@alldunn.com> wrote:
> On 1/31/12 8:02 AM, PeterW wrote:
>
>
>
>
>
>
>
>
>
> > Hi
>
> > I have a nice class derived from wx.lib.plot for calculating and
> > display a linear regression.  In my test app the class worked
> > perfectly.  When I inserted the class into my actual application it
> > fails to resize correctly.  It ignores any attempt to set the control
> > size, it is always about 20 x 20 pixels.  If I set the size parameter
> > when I instantiate, (I've carefully checked that I'm correctly calling
> > the parent class __init__) it reports that it is the requested size,
> > likewise if I call the setsize method.  But it is always 20 x 20.
> > I've tried calling layout in various places with no effect.  I went
> > back to my test app.  In this I am using a boxsizer to expand the
> > controls which works fine.  If I try to call the setsize method it
> > also fails.  So I went back to my actual app and put the plot into a
> > panel with a sizer and it has no effect.  Interestingly my plotting
> > appears to be occurring correctly in the tiny window. just not very
> > usefully.
>
> The plot window doesn't have a best size calculation for the sizers to
> use, so unless the sizer is set to fully expand it into a larger space
> you will need to give it an explicit min size.  The sizer and parent
> sizers will use that value when calculating the layout and deciding how
> much room to reserve for the plot window.  Try something like
> myPlot.SetMinSize((300,200)) to start out with.
>
> --
> Robin Dunn
> Software Craftsmanhttp://wxPython.org

--

-- 
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Cody | 1 Feb 17:22
Picon

Re: wx.EVT_PAINT events: does sizer-type matter?

Hi,

On Wed, Feb 1, 2012 at 10:09 AM, Paul <pazerp <at> gmail.com> wrote:
> For more hours than I'd like to admit I've trying to put a custom
> control (with a wx.EVT_PAINT handler) in a sizer.
> I eventually managed a very simple example, but was surprised that the
> only difference between the example that worked and the many that
> didn't was the type of sizer in which I placed the control:
> wx.gridsizer = working,  BoxSizers/Flexgridsizers=not working (see
> code below). On further investigation it seems that when using
> BoxSizers or Flexgridsizers an EVT_PAINT event is never raised, since
> the bound event handler never runs. Can anyone explain what's going
> on?
>
> import wx
>
> class Canvas(wx.PyControl):
>        def __init__(self, parent):
>                super(Canvas, self).__init__(parent)
>
>                self.Bind(wx.EVT_PAINT, self.OnPaint)
>
>        def OnPaint(self, event):
>                print "OnPaint called as expected"
>                dc = wx.PaintDC(self)
>                dc.DrawText("Hello World!", 5, 5)
>

You are subclassing PyControl which doesn't have any sizing logic
built in. At a minimum you should override its DoGetBestSize method to
return the best size of the control. Either that or you can derive
from Panel which can handle the sizing for you if you don't require
custom size management. Only really need to derive from the Py
prefixed classes if you need to override the virtual methods exported
by those versions of the classes.

EVT_PAINT is probably not getting sent because the control is being
initialized to a zero size or something.

The GridSizer is probably applying some minimal size to the control
based on the fixed minimum cell sizes of the 'grid'.

Cody

--

-- 
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Chris Barker | 1 Feb 17:38
Picon
Favicon

Re: Re: wx.lib.plot size appears to be broken in some way

On Wed, Feb 1, 2012 at 8:17 AM, PeterW <peter <at> 4doptics.com> wrote:
> I'm not sure what you mean by  "sizer is set to fully expand it", I've
> set the wx.EXPAND flag and it does nothing.

I"m not sure what sizer you are using, or how -- Minimal application, anyone?

but for BoxSizers, the wx.EXPAND flag determines behavior orthogonal
to the direction of the sizer, and the "option" parameter the behavior
along the direction of the sizer. To have it fully fill the space,
something like this:

Sizer.Add(MyPlotWindow, 1, wx.EXPAND)

But if you call a Fit, then the sizer tries to make everything as
small as possible, so if there is no MInSize, you could get a very
small PLotWindow.

-Chris

> However SetMinSize did the trick and the sizer now correctly expands
> the plot.
> But why doesn't SetSize work?
>
> Cheers
>
> Peter
>
>
> On Jan 31, 5:28 pm, Robin Dunn <ro...@alldunn.com> wrote:
>> On 1/31/12 8:02 AM, PeterW wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > Hi
>>
>> > I have a nice class derived from wx.lib.plot for calculating and
>> > display a linear regression.  In my test app the class worked
>> > perfectly.  When I inserted the class into my actual application it
>> > fails to resize correctly.  It ignores any attempt to set the control
>> > size, it is always about 20 x 20 pixels.  If I set the size parameter
>> > when I instantiate, (I've carefully checked that I'm correctly calling
>> > the parent class __init__) it reports that it is the requested size,
>> > likewise if I call the setsize method.  But it is always 20 x 20.
>> > I've tried calling layout in various places with no effect.  I went
>> > back to my test app.  In this I am using a boxsizer to expand the
>> > controls which works fine.  If I try to call the setsize method it
>> > also fails.  So I went back to my actual app and put the plot into a
>> > panel with a sizer and it has no effect.  Interestingly my plotting
>> > appears to be occurring correctly in the tiny window. just not very
>> > usefully.
>>
>> The plot window doesn't have a best size calculation for the sizers to
>> use, so unless the sizer is set to fully expand it into a larger space
>> you will need to give it an explicit min size.  The sizer and parent
>> sizers will use that value when calculating the layout and deciding how
>> much room to reserve for the plot window.  Try something like
>> myPlot.SetMinSize((300,200)) to start out with.
>>
>> --
>> Robin Dunn
>> Software Craftsmanhttp://wxPython.org
>
> --
> To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
> or visit http://groups.google.com/group/wxPython-users?hl=en

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker <at> noaa.gov

--

-- 
To unsubscribe, send email to wxPython-users+unsubscribe <at> googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en


Gmane