Editing Interface WXpython

Hi, i have a complicated interface that i want to make it with wxpython.i must describe each widget with programmation,but i am not so professionel in using wxpython.This is my first time to realise a wxpython application.I made the interface with VB.NET.here the screen shot of the application that i want to make.I wonder if some one could help me to make a similar one with wxpython.I really would be so grateful

page1.JPG

page2.jpg

page3.jpg

page4.jpg

···


Cordialement,
Maissa ABCHA

Hi,
I won't supply the complete app, but if you take a look at the wxpython demo
http://www.wxpython.org/download.php
, you will find, that probably all the graphical elements (i.e.
widgets, frames, sizers) you need for your app are available:
i.e. wx.Notebook as container for individual panels; wx.TextCtrl,
wx.Button, maybe wx.DatePickerCtrl, wx.FilePickerCtrl; wx.Gauge;
wx.ComboBox, wx.StaticText.
Besides these the sizers for grouping the widgets and adjusting the layout
e.g. wx.BoxSizer and wx.StaticBoxSizer (with a title and the line
around the group) and the base items wx.App, wx.Frame, wx.Panel etc.

In the mentioned demo, you can see many code samples and the resulting
apps or graphical elements, which you can adjust for your needs or at
least get some ideas.

hth,
  vbr

···

2011/5/11 maissa abcha <maissa.abcha@gmail.com>:

Hi, i have a complicated interface that i want to make it with wxpython.i
must describe each widget with programmation,but i am not so professionel in
using wxpython.This is my first time to realise a wxpython application.I
made the interface with VB.NET.here the screen shot of the application that
i want to make.I wonder if some one could help me to make a similar one with
wxpython.I really would be so grateful

--
Cordialement,
Maissa ABCHA
--

I concur with vbr. The wxPython demo is great for learning this stuff. I also have various examples on my blog. Here’s one example of the notebook which you’ll need for the first screenshot: http://www.blog.pythonlibrary.org/2010/09/15/wxpython-a-simple-notebook-example/

  • Mike

Hi,I tired to make my own application.I used the sample file browse button (of the documentation).My problem is i want to make the button on a static box (on the first tab) but when i add the static box i doesn’t work.Also i want to ask you if there is a way to add a file menu.I tried to add it but also it does not work.Finnally, I used the sizer but when i enlagre the widget nothing change.or i want the all the item will be resized. May be my questions are so easy but like i mentioned before this is my first time.

d.py (5.72 KB)

···

2011/5/11 Mike Driscoll kyosohma@gmail.com

I concur with vbr. The wxPython demo is great for learning this stuff. I also have various examples on my blog. Here’s one example of the notebook which you’ll need for the first screenshot: http://www.blog.pythonlibrary.org/2010/09/15/wxpython-a-simple-notebook-example/

  • Mike

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en


Cordialement,

Maissa ABCHA

Hi,I tired to make my own application.I used the sample file browse
button (of the documentation).My problem is i want to make the button on
a static box (on the first tab) but when i add the static box i doesn't
work.

How are you trying to add it and in what way doesn't it work?

Also i want to ask you if there is a way to add a file menu.I tried
to add it but also it does not work.

<Same questions.>

Finnally, I used the sizer but when
i enlagre the widget nothing change.or i want the all the item will be
resized.

You need to tell the sizers how to enlarge the items. How to do that depends on the type of sizer you are using. For box sizers you use the proportion parameter (of the Add method) to specify how many shares of the free space the item gets in the sizer's orientation dimension, and the wx.EXPAND flag to tell it to expand in the alternate dimension.

Using the WIT is helpful for diagnosing layout issues. http://wiki.wxpython.org/Widget_Inspection_Tool

May be my questions are so easy but like i mentioned before
this is my first time.

Have you been through the tutorial at wxPython tutorial - Python GUI programming in wxPython yet? How about other learning resources like the wiki (such as How to Learn wxPython - wxPyWiki) or sites like Mike's blog wxPython Archives - Mouse Vs Python? The types of things you are asking about (and more) are taught at these sites. There are also 2 books available, see the bottom of http://wxpython.org/

···

On 5/12/11 8:13 AM, maissa abcha wrote:

--
Robin Dunn
Software Craftsman

Hi,when i add a menu on my frame OSB the notebook disapear.I want to add a menu bar but i don’t khnow how.her what i wrote:
import random

import wx

import wx.lib.filebrowsebutton as filebrowse

···

########################################################################

StaticText = wx.StaticText

class maissa(wx.Panel):

path1=""

def __init__(self, parent):

	wx.Panel.__init__(self, parent, -1)

	StaticText = wx.StaticText

	# StaticText = wx.StaticText

	colors = "Aqua"

	self.SetBackgroundColour(colors)

	str = "Choose a directory"

	font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL)

	self.dbb = filebrowse.DirBrowseButton(self, -1, size=(450, -1), changeCallback = self.dbbCallback)

	sizer = wx.BoxSizer(wx.VERTICAL)

	sizer.Add(self.dbb, 0, wx.ALL, 10)

	self.SetSizer(sizer)

def dbbCallback(self, evt):

	maissa.path1=evt.GetString()

	print maissa.path1

	return maissa.path1

class OSB(wx.Frame):

#-------------------------------------------------------------------

def __init__(self):

	wx.Frame.__init__(self, None, wx.ID_ANY,"OSBbuilder",size=(600,400))

	panel = wx.Panel(self)

	notebook = wx.Notebook(panel)

	tabOne = maissa(notebook)

	notebook.AddPage(tabOne, "Tab 1")

	status=self.CreateStatusBar()

	menubar=wx.MenuBar()

	first=wx.Menu()

	first.Append(wx.ID_OPEN,"choose\tCTRL+o","this will choose a new directroy")

	menubar.Append(first,"File")

	self.SetMenuBar(menubar)

	sizer = wx.BoxSizer(wx.VERTICAL)

	sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5)

	panel.SetSizer(sizer)

	self.Layout()

	self.Show()

#----------------------------------------------------------------------

if name == “main”:

app = wx.App(False)

frame = OSB()

app.MainLoop()

2011/5/12 Robin Dunn robin@alldunn.com

On 5/12/11 8:13 AM, maissa abcha wrote:

Hi,I tired to make my own application.I used the sample file browse

button (of the documentation).My problem is i want to make the button on

a static box (on the first tab) but when i add the static box i doesn’t

work.

How are you trying to add it and in what way doesn’t it work?

Also i want to ask you if there is a way to add a file menu.I tried

to add it but also it does not work.

Finnally, I used the sizer but when

i enlagre the widget nothing change.or i want the all the item will be

resized.

You need to tell the sizers how to enlarge the items. How to do that depends on the type of sizer you are using. For box sizers you use the proportion parameter (of the Add method) to specify how many shares of the free space the item gets in the sizer’s orientation dimension, and the wx.EXPAND flag to tell it to expand in the alternate dimension.

Using the WIT is helpful for diagnosing layout issues. http://wiki.wxpython.org/Widget_Inspection_Tool

May be my questions are so easy but like i mentioned before

this is my first time.

Have you been through the tutorial at http://zetcode.com/wxpython/ yet? How about other learning resources like the wiki (such as http://wiki.wxpython.org/How_to_Learn_wxPython) or sites like Mike’s blog http://www.blog.pythonlibrary.org/tag/wxpython/? The types of things you are asking about (and more) are taught at these sites. There are also 2 books available, see the bottom of http://wxpython.org/

Robin Dunn

Software Craftsman

http://wxPython.org

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en


Cordialement,

Maissa ABCHA

Hi,when i add a menu on my frame OSB the notebook disapear.I want to add a
menu bar but i don't khnow how.her what i wrote:

It's best to put code in as an enclosure, rather than inline -- many email clients mangle whitespace. At least in my client, your code below has no indentation at all, making it very hard to know what you wrote.

-Chris

···

On 5/12/11 11:35 PM, maissa abcha wrote:

import random
import wx
import wx.lib.filebrowsebutton as filebrowse

########################################################################
StaticText = wx.StaticText
class maissa(wx.Panel):
path1=""
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
StaticText = wx.StaticText
# StaticText = wx.StaticText
colors = "Aqua"
self.SetBackgroundColour(colors)
str = "Choose a directory"
font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL)
self.dbb = filebrowse.DirBrowseButton(self, -1, size=(450, -1),
changeCallback = self.dbbCallback)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.dbb, 0, wx.ALL, 10)
self.SetSizer(sizer)
def dbbCallback(self, evt):
maissa.path1=evt.GetString()
print maissa.path1
return maissa.path1

class OSB(wx.Frame):
#-------------------------------------------------------------------
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY,"OSBbuilder",size=(600,400))
panel = wx.Panel(self)
notebook = wx.Notebook(panel)
tabOne = maissa(notebook)
notebook.AddPage(tabOne, "Tab 1")
status=self.CreateStatusBar()
menubar=wx.MenuBar()
first=wx.Menu()
first.Append(wx.ID_OPEN,"choose\tCTRL+o","this will choose a new directroy")
menubar.Append(first,"File")
self.SetMenuBar(menubar)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5)
panel.SetSizer(sizer)
self.Layout()
self.Show()

#----------------------------------------------------------------------
if __name__ == "__main__":
     app = wx.App(False)
     frame = OSB()
     app.MainLoop()

2011/5/12 Robin Dunn<robin@alldunn.com>

On 5/12/11 8:13 AM, maissa abcha wrote:

Hi,I tired to make my own application.I used the sample file browse
button (of the documentation).My problem is i want to make the button on
a static box (on the first tab) but when i add the static box i doesn't
work.

How are you trying to add it and in what way doesn't it work?

  Also i want to ask you if there is a way to add a file menu.I tried

to add it but also it does not work.

<Same questions.>

  Finnally, I used the sizer but when

i enlagre the widget nothing change.or i want the all the item will be
resized.

You need to tell the sizers how to enlarge the items. How to do that
depends on the type of sizer you are using. For box sizers you use the
proportion parameter (of the Add method) to specify how many shares of the
free space the item gets in the sizer's orientation dimension, and the
wx.EXPAND flag to tell it to expand in the alternate dimension.

Using the WIT is helpful for diagnosing layout issues.
http://wiki.wxpython.org/Widget_Inspection_Tool

  May be my questions are so easy but like i mentioned before

this is my first time.

Have you been through the tutorial at wxPython tutorial - Python GUI programming in wxPython yet?
  How about other learning resources like the wiki (such as
How to Learn wxPython - wxPyWiki) or sites like Mike's blog
wxPython Archives - Mouse Vs Python? The types of things you
are asking about (and more) are taught at these sites. There are also 2
books available, see the bottom of http://wxpython.org/

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@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@noaa.gov

The problem in your sample code is not related to the menubar. It appears that the panel is getting its initial size event when the frame's statusbar is created, but since you hadn't yet associated a sizer with the panel the layout that happens in that size event is not able to do anything. If you move the code that creates and sets the panel's sizer up before the statusbar is created then it will work as expected. Alternatively you can move the creation of the stausbar up before the panel's creation and then it will get its initial size event later when the frame is shown, or you can just add a call to panel.Layout() to force it.

Calling self.Layout for the frame did not do anything because the panel was already set to its initial size so it did not get a size event as part of that layout.

BTW, to help you diagnose these types of things in the future here is how I did it. I resized the frame after it was shown and saw that the notebook and such suddenly appeared. This is a clue that there is a layout issue. I then added the WIT (http://wiki.wxpython.org/Widget_Inspection_Tool) and was able to see that the panel was sized correctly, but the notebook was still very small. I then added some 'print panel.Size' statements to see when the panel changed size and saw that it was when self.CreateStatusBar() was called.

···

On 5/12/11 11:35 PM, maissa abcha wrote:

Hi,when i add a menu on my frame OSB the notebook disapear.I want to add
a menu bar but i don't khnow how.

--
Robin Dunn
Software Craftsman

It's probably because he was indenting with tabs. I had to go to the message at google groups to be able to copy the code with the indents intact.

···

On 5/13/11 8:48 AM, Chris Barker wrote:

On 5/12/11 11:35 PM, maissa abcha wrote:

Hi,when i add a menu on my frame OSB the notebook disapear.I want to
add a
menu bar but i don't khnow how.her what i wrote:

It's best to put code in as an enclosure, rather than inline -- many
email clients mangle whitespace. At least in my client, your code below
has no indentation at all, making it very hard to know what you wrote.

--
Robin Dunn
Software Craftsman

here the code attached and sorry for disturb

dd.py (1.55 KB)

···

2011/5/13 Robin Dunn robin@alldunn.com

On 5/13/11 8:48 AM, Chris Barker wrote:

On 5/12/11 11:35 PM, maissa abcha wrote:

Hi,when i add a menu on my frame OSB the notebook disapear.I want to

add a

menu bar but i don’t khnow how.her what i wrote:

It’s best to put code in as an enclosure, rather than inline – many

email clients mangle whitespace. At least in my client, your code below

has no indentation at all, making it very hard to know what you wrote.

It’s probably because he was indenting with tabs. I had to go to the message at google groups to be able to copy the code with the indents intact.

Robin Dunn

Software Craftsman

http://wxPython.org

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en


Cordialement,

Maissa ABCHA

Hi maissa,

here is the graphical user interface with sizer of your program.

Good luck !

CJC.

TEST.py (10.1 KB)