November 13th, 2004, 03:18 PM
i have the following class:
what code do i need to initialise this to show my GUI?
# -*- coding: ISO-8859-1 -*-
# generated by wxGlade 0.3.5.1 on Sat Nov 13 21:09:35 2004
def __init__(self, *args, **kwds):
# begin wxGlade: NotebookFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
# Menu Bar
self.frame_1_menubar = wx.MenuBar()
wxglade_tmp_menu = wx.Menu()
wxglade_tmp_menu.Append(wx.NewId(), "New", "", wx.ITEM_NORMAL)
# Menu Bar end
self.frame_1_statusbar = self.CreateStatusBar(1, 0)
# end wxGlade
# begin wxGlade: NotebookFrame.__set_properties
# statusbar fields
frame_1_statusbar_fields = ["My first GUI program - orgasmic!"]
for i in range(len(frame_1_statusbar_fields)):
# end wxGlade
# begin wxGlade: NotebookFrame.__do_layout
# end wxGlade
# end of class NotebookFrame
November 13th, 2004, 03:33 PM
nf = NotebookFrame(None,-1,"")
app = OrgasmicApp(0)
November 14th, 2004, 07:06 AM
cheers - worked fine. This really is incredible, i mean the combination of software like python, wxpython, wxglade and py2exe (which i have yet to use), makes commercial software development by individuals so much more realistic. I made my first java gui after 6 months of learning java, and it was ****e also. I haven't even learnt python (i decided to take a look a week ago), it just seems so obvious.
November 17th, 2004, 03:38 AM
i have yet to program a full GUI using wxpython, how does it perform speed wise? the gui i am making will be similar to this
November 17th, 2004, 09:08 AM
The GUI demo looks nice and complex
Can't see why wxPython can't cope - the actual GUI stuff is in C libraries anyway.
You might consider creating all objects and withdrawing what you don't need. I mean; perhaps you should avoid creating widgets on events.
November 17th, 2004, 10:10 AM
what does this mean? infact - what are widgets? i have never programmed python / guis before
Originally Posted by Grim Archon
November 17th, 2004, 11:32 AM
Buttons, frames, windows, dropdown lists, checkboxs, text labels are examples of visible widgets - what widgets you have access to depends on the graphics library you are using.
Events happen when you click a button, hit a key, resize a window etc. To each event you can register one or more functions to be called when that event happens. Again, what events can be generated and how they are done is graphics library dependent.
This web-page form has a submit button widget - when clicked the submit form event (or something like that) is raised and code to process the form is called...
My comment was about this:
In general terms you have two extreme ways to build your GUI. Imagine a GUI application to sell houses done two ways:
1. Build every window and user interface widget at the start of your program but do not makes them visible. This would mean every window is pre built before the user needs it. So when the user clicks a button to add a new record the application just shows the pre-built add record window. When the user clicks Save, the date is read from the fields and the window is withdrawn (made invisible).
2. Build the windows and widgets as needed based on events. For example - when the user clicks a button to add a new record you call the code to build a window and the entry fields and the buttons etc to show a record entry window. When the user clicks Save the data is read from the fields and the window and its widgets are destroyed.
Most small applications would use method 2, larger apps with complex GUIs that take lots of processing to create will probably use a mix of 1 and 2.
Dig a out a tutorial and get comfortable with your chosen graphics toolkit
November 17th, 2004, 01:19 PM
First I used VB but it had limited features so I did a search on the internet “VB vs” then I found Python, I already know that it was a much like Perl. So I tried it out using Tkinter I was so impressed. Then I found about wxWindows I tried many of demos the text widget alone is so bloated full of features.
I did have a small problem running Notebook widget on windows, but I found help on net.