Closing FXDialogBox without user input?

S

Steve Kozma

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
 
J

Joel VanderWerf

Steve said:
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.
 
S

Steve Kozma

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" <[email protected]>
To: "ruby-talk ML" <[email protected]>
Sent: Sunday, February 15, 2004 10:17 PM
Subject: Re: Closing FXDialogBox without user input?
 
S

Steve Kozma

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top