[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

help with FXDialogBox

Raj Sahae

3/3/2007 3:49:00 AM

I want a DialogBox where I can click a button, perform some operation,
possibly returning a value, and then the DialogBox should close (not
hide, close). The methods I have tried for this have failed. My
current setup, which gives me a seg fault, is:

button = FXButton.new(parent, text, icon, nil, nil, 0, . . .)
button.connect(SEL_COMMAND) do |sender, sel, data|
self.download(card)
self.handle(sender, ID_ACCEPT, data)
end

I also tried
button = FXButton.new(parent, text, icon, nil, self, ID_ACCEPT . . .)
button.connect(SEL_COMMAND) do
self.download(card)
end

I can't get either of these to work. What information am I missing here?

Raj

4 Answers

Raj Sahae

3/3/2007 3:54:00 AM

0

Raj Sahae wrote:
> I want a DialogBox where I can click a button, perform some operation,
> possibly returning a value, and then the DialogBox should close (not
> hide, close). The methods I have tried for this have failed. My
> current setup, which gives me a seg fault, is:
>
> button = FXButton.new(parent, text, icon, nil, 0, . . .)
> button.connect(SEL_COMMAND) do |sender, sel, data|
> self.download(card)
> self.handle(sender, ID_ACCEPT, data)
> end
>
> I also tried
> button = FXButton.new(parent, text, icon, self, ID_ACCEPT . . .)
> button.connect(SEL_COMMAND) do
> self.download(card)
> end
>
> I can't get either of these to work. What information am I missing here?
>
> Raj
>
>
I fixed a typo in the code

Raj Sahae

3/3/2007 5:10:00 AM

0

Raj Sahae wrote:
> Raj Sahae wrote:
>> I want a DialogBox where I can click a button, perform some
>> operation, possibly returning a value, and then the DialogBox should
>> close (not hide, close). The methods I have tried for this have
>> failed. My current setup, which gives me a seg fault, is:
>>
>> button = FXButton.new(parent, text, icon, nil, 0, . . .)
>> button.connect(SEL_COMMAND) do |sender, sel, data|
>> self.download(card)
>> self.handle(sender, ID_ACCEPT, data)
>> end
>>
>> I also tried
>> button = FXButton.new(parent, text, icon, self, ID_ACCEPT . . .)
>> button.connect(SEL_COMMAND) do
>> self.download(card)
>> end
>>
>> I can't get either of these to work. What information am I missing
>> here?
>>
>> Raj
My latest attempt, failure once more, is the following:

FXButton.new(rows[index/CPR], nil , icon, self, ID_ACCEPT,
LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT|BUTTON_NORMAL, 0,0, WIDTH,
HEIGHT) do |button|
button.connect(SEL_COMMAND) { self.download(card) }
end


Raj Sahae

3/3/2007 6:02:00 PM

0

Raj Sahae wrote:
> Raj Sahae wrote:
>> Raj Sahae wrote:
>>> I want a DialogBox where I can click a button, perform some
>>> operation, possibly returning a value, and then the DialogBox should
>>> close (not hide, close). The methods I have tried for this have
>>> failed. My current setup, which gives me a seg fault, is:
>>>
>>> button = FXButton.new(parent, text, icon, nil, 0, . . .)
>>> button.connect(SEL_COMMAND) do |sender, sel, data|
>>> self.download(card)
>>> self.handle(sender, ID_ACCEPT, data)
>>> end
>>>
>>> I also tried
>>> button = FXButton.new(parent, text, icon, self, ID_ACCEPT . . .)
>>> button.connect(SEL_COMMAND) do
>>> self.download(card)
>>> end
>>>
>>> I can't get either of these to work. What information am I missing
>>> here?
>>>
>>> Raj
> My latest attempt, failure once more, is the following:
>
> FXButton.new(rows[index/CPR], nil , icon, self, ID_ACCEPT,
> LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT|BUTTON_NORMAL, 0,0, WIDTH,
> HEIGHT) do |button|
> button.connect(SEL_COMMAND) { self.download(card) }
> end
>
>
>
Nobody on this one?
Lyle, you around somewhere?

Raj Sahae

3/3/2007 7:37:00 PM

0


> Nobody on this one?
> Lyle, you around somewhere?
>
Ok I gave up doing it with a DialogBox and now I'm just using another
FXMainWindow