Closing FXDialogBox without user input?


(Steve Kozma) #1

Hi!

I would like to display a DialogBox as long as an external command is
running
and then remove it without any user interaction.
I thought something like this might work, but it doesn’t:

@infoWin.handle(nil, MKUINT(FXDialogBox::ID_CANCEL, SEL_UPDATE), nil)

Thanks in advance for any suggestions!

Best regards,
Steve


(Joel VanderWerf) #2

Steve Kozma wrote:

Hi!

I would like to display a DialogBox as long as an external command is
running
and then remove it without any user interaction.
I thought something like this might work, but it doesn’t:

@infoWin.handle(nil, MKUINT(FXDialogBox::ID_CANCEL, SEL_UPDATE), nil)

It might be simpler than that. In examples/dialog.rb, change one method
as follows:

Show the non-modal dialog

def onCmdShowDialog(sender, sel, ptr)
@dialog.show
Thread.new {
sleep 2
@dialog.hide
}
end

The dialog stays open for 2 sec, allowing user interaction, and then
goes away.


(Steve Kozma) #3

Thank You! It is exactly what I wished for. =o))

This is a great Group, just as great as Ruby!

Best Regards,
Steve

···

----- Original Message -----
From: “Joel VanderWerf” vjoel@PATH.Berkeley.EDU
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Sunday, February 15, 2004 10:17 PM
Subject: Re: Closing FXDialogBox without user input?

Steve Kozma wrote:

Hi!

I would like to display a DialogBox as long as an external command is
running
and then remove it without any user interaction.
I thought something like this might work, but it doesn’t:

@infoWin.handle(nil, MKUINT(FXDialogBox::ID_CANCEL, SEL_UPDATE), nil)

It might be simpler than that. In examples/dialog.rb, change one method
as follows:

Show the non-modal dialog

def onCmdShowDialog(sender, sel, ptr)
@dialog.show
Thread.new {
sleep 2
@dialog.hide
}
end

The dialog stays open for 2 sec, allowing user interaction, and then
goes away.


(Joel VanderWerf) #4

Steve Kozma wrote:

Thank You! It is exactly what I wished for. =o))

You’re welcome!

This is a great Group, just as great as Ruby!

There is also Lyle’s FXRuby mailing list, which you can join at:

http://fxruby.sourceforge.net/

It’s low volume, but there seem to be about 15-20 people who contribute
from time to time.


(Steve Kozma) #5

Hi!

I invoke an external command the following way:


execThis = "c:/WINNT/tar_dos.exe -cf " + $tarFileName + " " + $nameList
win_system(execThis)

I defined win_system the way I saw it on the list:

def win_system(command)
Win32API.new(“crtdll”,“system”,[‘P’],‘L’).Call(command)
end

Now, when I start my program (on Win2000) it works fine.
Starting again is most of the time OK too.
But mostly on the third time I get this error (copied from irb shell):

Exiting due to signal SIGSEGV
General Protection Fault at eip=0001607f
eax=ffa30040 ebx=0000003f ecx=000001dc edx=ffa30000 esi=00000040
edi=00000003
ebp=0006e5b0 esp=0006e5a0 program=
cs: sel=01a7 base=01dc0000 limit=7e22ffff
ds: sel=01af base=01dc0000 limit=7e22ffff
es: sel=01af base=01dc0000 limit=7e22ffff
fs: sel=017f base=00006e10 limit=0000ffff
gs: sel=01bf base=00000000 limit=7ffeffff
ss: sel=01af base=01dc0000 limit=7e22ffff

Call frame traceback EIPs:
0x0001607f
0x00016005
0x0001481a
0x000148d1
=> 0

After such an error I have to close the DOS Shell where I was started the
program
with irb, and open a new one to get it work again.

Any idea why this happens?

Best regards,
Steve