473,503 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object Manipulation and Frames

uo
Hello people,
I would like to get some advice on the method that i should use to
develop a cyber billing wxpython app.I had started but i hit a snag
when i realised i could not launch or fiddle with properties of a
Frame object within another frame object, what i had intended to do
was to first launch a login frame where members would login and after
successful authentication , the frame would be hidden and another
would be launched for billing...i had a LoginFrame and a BillingFrame
but after successful auth i found it hard to switch the
BillingFrame.Show(True), can this be done ...and would making use of
MDI make it beter? ...and if not could anyone please suggest a
better/
workable alternative..Thank you.
Jun 27 '08 #1
2 927
On Jun 11, 9:36*am, uo <yon...@googlemail.comwrote:
Hello people,
* I would like to get some advice on the method that i should use to
develop a cyber billing wxpython app.I had started but i hit a snag
when i realised i could not launch or fiddle with properties of a
Frame object within another frame object, what i had intended to do
was to first launch a login frame where members would login and after
successful authentication , the frame would be hidden and another
would be launched for billing...i had a LoginFrame and a BillingFrame
but after successful auth i found it hard to switch the
BillingFrame.Show(True), can this be done *...and would making use of
MDI make it beter? ...and if not could anyone *please suggest a
better/
workable alternative..Thank you.
I do this sort of thing with a timesheet application I wrote. Here's
what I do:

<code>
class Main(wx.App):
''' Create the main screen. '''
def __init__(self, redirect=False, filename=None):
wx.App.__init__(self, redirect, filename)
self.OnLogin()

def OnLogin(self):
dialog = loginDlg.LoginDlg()
dialog.ShowModal()
self.username = dialog.userTxt.GetValue()
self.password = dialog.passwordTxt.GetValue()
loggedIn = dialog.loggedIn

if loggedIn != True:
sys.exit(0)
dialog.Destroy()
</code>

As you can see, I call a wx.Dialog right after initializing my wx.App.
The dialog is modal, which keeps my wx.App from continuing to load. In
my dialog class, I have some authentication code that loops. The loop
allows the user to retry logging in. If the user hits "Cancel", then I
exit the application using the sys.exit(0) command.

Hopefully this code snippet gives you the general idea. Either way, I
highly recommend subscribing to the wxPython user's group. You'll
learn a lot and there are a lot of helpful (and knowledgeable) people
on there, including a couple of core developers.

You will find the means to join here:

http://wxpython.org/maillist.php

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org
Jun 27 '08 #2
<snip>
Thanks alot Mr.Driscoll, that snippet of code helped me alot..but i
was of the idea that the application should be cyclic in nature, that
it hould not exit even on failure to authenticate the user.My idea is
that once logged in i should be able to bring back the ligin screen on
full screen without the Title bar once the user's session is through,
could you/anyone please guide me on how i can acheive this.Thanks alot.

The application is "cyclic" in that it basically runs in an infinite
loop until you exit the application. The login screen part of it can
be cyclic too. Basically what you want will be in your
"loginDlg.LoginDlg()" code, which is the dialog that you show to the
user to login with. In there you can have. In my original application,
I have a function that does the authentication for me and returns
either True or False. If False (i.e. bad credentials), then I display
a modal dialog telling the user to try again.

Since all of my login dialog code is in a separate module, I can reuse
it at any time. So if I need to display it again, I just create a new
instance and the user can login again or some other user can login. In
your case, I would add some code to check if the main frame of your
application was visible or enabled or something and hide or disable it
when I re-display the login dialog.

Hopefully that all makes sense. If not, let me know.

Mike
Aug 4 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2186
by: Mark McKay | last post by:
I will be starting a contract with a film production company soon, and will be writing code to process large images representing frames of movies (unknown file format at this time). I'd also like...
9
1903
by: Dom | last post by:
I have a frameset with a left right columns, called 'index' and 'content'. The left column of the frameset ('index') loads an index.htm file which have these hrefs (summarized the code a bit)...
4
4091
by: Geoff Cox | last post by:
Hello, One person to date has received a runtime error message saying "parent.frameleft.location is not an object" with the following code. The code is used to select 2 frames at the same...
5
4182
by: Jim Marquardson | last post by:
Hi, I've struggled with this for a while now, so I'm asking for help. I am trying to click on a link in one page, have that link open up in a new window, and set that newly opened window's...
1
5945
by: Phoenix | last post by:
I have a site that is supposed to be 'real-time' which has a frameset of 2 rows (the bottom row is 1 pixel so essentially invisible to IE users which is the requirement for the product). The bottom...
12
5386
by: marcadonis | last post by:
Hi! Does anybody know of a way that I can keep a reference to an object that I can then reuse? I tried various approaches using navigator, but these all fail in an iframe due to premission...
14
1683
by: Cylix | last post by:
I have a array to store some student information, eg var s = new Array('2006001', 'Apple Joker', '5B'); normally, We get the data using s, s,s ... How can I define them more readable like s, s,...
1
1796
by: laredotornado | last post by:
Hi, I keep getting the error, "Error: uncaught exception. Permission denied to get property Location.href" when executing this function: function checkUpperFrame() { var l =...
5
3400
by: helraizer1 | last post by:
Me again :D You're going to be sick of me soon. =P I found the GifEncoder class on phpclasses, which creates an animated gif image from frames and echos it to the browser to show; can also save...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.