EVT_BeforeNavigate2 puzzle

using wx.lib.iewin and EVT_BeforeNavigate2 how do I get the target url ?
in the old way (wx.iewin) there was a GetText1() that returned the url but the ActiveXEvent has no such method.

Any ideas?

···

--
Peter Damoc
Hacker Wannabe
http://www.sigmacore.net/

Hi all

This is a minor problem, on GTK only, that I am sure has only appeared
recently. I cannot pinpoint exactly when it changed, but it would have been
either 2.5.1.5 or 2.5.2.7.

The attached program shows a very simplified version of the structure of my
system. There is a 'menu' frame which provides a menu of options. When an
option is selected, it launches an 'application' frame, which has a parent
of None.

When the user has finished with the application, they can close the frame
directly (eg Alt-F4 or click the top right-hand corner), or they can click
on a 'Close' button, which calls frame.Close(). The effect should be the
same.

If the user has made any changes, a message dialog (with the application
frame as parent) is popped up for confirmation. If the user does not
confirm, the frame must not be closed. The way this is achieved depends on
where it was called from. If called from the button, the button function
does not try to close the window. If called from closing the frame directly,
the close is vetoed.

My problem is that, if the frame is closed directly, the 'menu' frame
re-appears on top of the application frame, and then the message dialog
appears on top of that. GTK seems to think that the frame is already closed,
so it uses the menu frame as the parent of the dialog box (or something like
that).

A further variation is that the application frame can open a dialog box, to
handle a subset of the application. Exactly the same rules apply for closing
the dialog box, but in this case the problem does not occur.

To see this, do the following with the attached program -

From the menu, click 'Application'.

If you close the application frame by either method, it closes without a
problem.
Click 'Application' again, then click 'Change'.
If you now click the 'Close' button, the message dialog appears without a
problem.
If you click the top right corner instead, the message dialog appears
correctly, but the menu frame has reappeared on top of the application menu.

This is not a train smash, but it is confusing for the user, so I hope that
a solution can be found.

Thanks

Frank Millman

fm35.py (4.03 KB)

Peter Damoc wrote:

using wx.lib.iewin and EVT_BeforeNavigate2 how do I get the target url ?
in the old way (wx.iewin) there was a GetText1() that returned the url but the ActiveXEvent has no such method.

Any ideas?

Does the attached code help? Look in iedemo.py (run.py is infrastrucutre)

To see it: run 'iedemo.py' in the same folder as 'run.py'

run.py (4.71 KB)

iedemo.py (3.86 KB)

···

--
Mike

Thanks Mike, That did it... :slight_smile:
evt.URL was what I needed :slight_smile:

···

On Thu, 07 Oct 2004 22:35:33 +1000, Mike Thompson <mike.spam.filter@day8.com.au> wrote:

Peter Damoc wrote:

using wx.lib.iewin and EVT_BeforeNavigate2 how do I get the target url ?
in the old way (wx.iewin) there was a GetText1() that returned the url
but the ActiveXEvent has no such method.

Any ideas?

Does the attached code help? Look in iedemo.py (run.py is infrastrucutre)

To see it: run 'iedemo.py' in the same folder as 'run.py'

--
Mike

--
Peter Damoc
Hacker Wannabe

Frank Millman wrote:

My problem is that, if the frame is closed directly, the 'menu' frame
re-appears on top of the application frame, and then the message dialog
appears on top of that. GTK seems to think that the frame is already closed,
so it uses the menu frame as the parent of the dialog box (or something like
that).

To see this, do the following with the attached program -

From the menu, click 'Application'.

If you close the application frame by either method, it closes without a
problem.
Click 'Application' again, then click 'Change'.
If you now click the 'Close' button, the message dialog appears without a
problem.
If you click the top right corner instead, the message dialog appears
correctly, but the menu frame has reappeared on top of the application menu.

I can't duplicate this here with current CVS using either gtk1 build or gtk2 build, so either something has been changed that fixes this, or it is a difference in Window Managers or something.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Frank Millman wrote:

> My problem is that, if the frame is closed directly, the 'menu' frame
> re-appears on top of the application frame, and then the message dialog
> appears on top of that. GTK seems to think that the frame is already

closed,

> so it uses the menu frame as the parent of the dialog box (or something

like

> that).
>

Robin Dunn wrote:

I can't duplicate this here with current CVS using either gtk1 build or
gtk2 build, so either something has been changed that fixes this, or it
is a difference in Window Managers or something.

Thanks, Robin. I will wait for the release of 2.5.3 and check it again.

Also, for the record, I will do the same regarding my problem with 'grid
text invisible while editing'. If I get the same problem with 2.5.3, I will
let you know.

Frank