On Feb 19, 2007, at 17:59 UTC, Bart Pietercil wrote:
> why would this code crash ?
What do you mean by "crash"? What do you actually see? Also, what
version of RB are you using, and on which platform?
> Sub Action(item As ToolItem)
> if CardIsDirty Then
> if SaveCard Then
>
> Else
> Return
> end if
> end if
This part shouldn't crash, but it's an awkward construction that took
me a while to figure out. Try this simpler version:
if CardIsDirty then
if not SaveCard then return
end if
> Select Case item.Name
> case "tbb_Clusters"
> App.MainBarHandler(Self,ClusterWindow)
> Self.Close
Calling Self.Close in the Action event of a toolbar item just might be
a way to make an app crash on some platforms. It shouldn't, of course,
but similar bugs have been found in the framework before -- it takes a
lot of bullet-proofing to keep users from destroying things out from
under you (from the framework's point of view).
So, see if you can reproduce this with a toolbar item whose only code
is:
Self.Close
If you can, then you have a nice simple bug to report. The work-around
in that case is probably to activate a Timer with a very short period
(e.g. 1) that calls Self.Close, since I'm sure any such problems in
Timer events was fixed long ago.
HTH,
- Joe
--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC "Making the Internet a Better Place"
http://www.verex.com/
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>