473,657 Members | 2,896 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.Sh ow(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..Th ank you.
Jun 27 '08 #1
2 935
On Jun 11, 9:36*am, uo <yon...@googlem ail.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.Sh ow(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..Th ank 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.LoginD lg()
dialog.ShowModa l()
self.username = dialog.userTxt. GetValue()
self.password = dialog.password Txt.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.Login Dlg()" 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
2193
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 to build the interface in Java, and do the number crunching in Java too, if Java is powerful enough to handle it. I'd like to know what the best ways are to accomplish this. Should I treat image data as arrays of bytes and use the old...
9
1910
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) for readability : <a href="studio/index.htm" target=content id="studio"> studio </a> <a href="bandw/index.htm" target=content id="bandw"> bandw </a> <a href="arch/index.htm" target=content id="arch"> arch </a> <a href="etc/index.htm" ...
4
4109
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 time... Any ideas why please? Geoff
5
4205
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 ifram to a specific url. Here is the code I'm using: <html> <head>
1
5963
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 frame refreshes using an http-refresh every 15 seconds. If new data is available on the server, it tells the top page to refresh. For checks and balances, the top frame has a form at the bottom of the page with a 'clockBox'..which is essentially...
12
5397
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 problems. For e.g.: navigator.stuff = 5;
14
1699
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, s ? Thank you
1
1802
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 = top.frames.location.href; if (l.indexOf("teacher_hub") == -1) { setTimeout(checkUpperFrame, 100); } else {
5
3412
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 it as an image with .gif extension. The only problem is that I need to add the animated gif onto another image (with imagecopymerge), however the gif image that is returned by this code in an object. Here is the code: GifEncoder.Class.php
0
8384
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7314
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4150
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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 we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.