473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem obtaining an object reference...

I have two windowing classes A and B.

Inside A's constructor i created an instance B to display its Modal
window. Only on clicking OK/ Closing this modal window do i proceed to
display the A's window.

All that is fine. Now the problem is i would like to write a python
script to test the this GUI app simulating all the events that make
A's window work through my script. No the problem is to get past my
B's window. Which i'm unable to do since the A's instance would any be
created completely if i click OK/Close button on the B's window. Im
unable to simulate that event since i have little idea about how to
get the object reference to B's window? Here is a sample of the code.
class Awindow:

def __init__(self):
<doing something>
<doing something>
self.showBwindow()
def showBwindow(self):
dialog = Bwindow()
dialog.ShowModal()
dialog.Destroy()

class Bwindow:
def __init__(self):
<define propertis of Bwindow>
Pls help.
Aug 7 '08 #1
1 1015


SamG wrote:
I have two windowing classes A and B.

Inside A's constructor i created an instance B to display its Modal
window. Only on clicking OK/ Closing this modal window do i proceed to
display the A's window.

All that is fine. Now the problem is i would like to write a python
script to test the this GUI app simulating all the events that make
A's window work through my script. No the problem is to get past my
B's window. Which i'm unable to do since the A's instance would any be
created completely if i click OK/Close button on the B's window. Im
unable to simulate that event since i have little idea about how to
get the object reference to B's window? Here is a sample of the code.
How about
class Awindow:

def __init__(self):
<doing something>
<doing something>
self.showBwindow()
def showBwindow(self):
dialog = Bwindow()
if __debug__: self.dialog = dialog
dialog.ShowModal()
if __debug__: del self.dialog
dialog.Destroy()
From the assert statement doc (3.0, but unchanged):

These equivalences assume that __debug__ and AssertionError refer to the
built-in variables with those names. In the current implementation, the
built-in variable __debug__ is True under normal circumstances, False
when optimization is requested (command line option -O). The current
code generator emits no code for an assert statement when optimization
is requested at compile time.

I believe the last applies to all 'if __debug__: <suite>' statements, so
you can have them not compiled if you wish. Or use your own 'debug'
variable to skip them without fussing with the '-O' startup flags and
..pyo files (See Using Python/Command line arguments).

Terry Jan Reedy

Aug 7 '08 #2

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

Similar topics

4
by: Murat Tasan | last post by:
i have a quick question... is there a way to obtain the reference to the object which called the currently executing method? here is the scenario, i have a class and a field which i would like to...
8
by: SpOiLeR | last post by:
Hello! I have a matrix class like this: class MyObject; // MyMatrix is contains MyObjects class MyMatrix { public: ...
1
by: Kent Eilers | last post by:
I'm learning automation basics here with a Access-Word mail merge. Specifically I want to obtain a reference to the Word error object....using Access as an automation client. Is this possible? ...
3
by: Kamalanathan T. | last post by:
Hi, We have developed an Web application in ASP.NET with C# and we r using SQL Server 2000. We get the Timeout expired error, when more than 300 concurrent users hit the site. I hagone thru...
1
by: Ferryandi | last post by:
Hi i want to ask question; when i perform this function: private void menuItem1_Click(object sender, System.EventArgs e) { if(ActiveMdiChild.IsAccessible == true) {...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
4
by: taskswap | last post by:
I'm converting an application that relies heavily on a binary network protocol. Within this protocol are a lot of byte arrays of character data, like: public unsafe struct MsgAddEntry {...
14
by: Rene Grothmann | last post by:
I have managed to communicate between forms and Java applets. A button press sends the content of the text area to an applet, a second button gets some text from the applet and puts it into the...
11
by: seannakasone | last post by:
Is there a way to get the callstack level in c++? for example, take the following code: void call3() { //callstack level would be 3 } void call2() { //callstack level would be 2 call3();
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...

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.