Remove Close Button from DB mainDialog = create "Bla"

Hello!

Is there a way to remove the standard close button from the UI?

With best regards,
Bjoern


Bjoern_Karpenstein - Thu Jul 02 03:43:50 EDT 2015

Re: Remove Close Button from DB mainDialog = create "Bla"
pommCannelle - Fri Jul 03 10:29:51 EDT 2015

void do_nothing(DB x){}

void do_close (DB x){ hide x; destroy x; x = null }

DB mainDialog = create("Bla", styleNoBorder)
close ( mainDialog, false, do_nothing)
apply ( mainDialog, "Close", do_close)

realize mainDialog { setCenteredSize( mainDialog, 200, 200 ) }

show mainDialog

Enjoy ! 

Re: Remove Close Button from DB mainDialog = create "Bla"
Bjoern_Karpenstein - Mon Jul 06 04:38:29 EDT 2015

pommCannelle - Fri Jul 03 10:29:51 EDT 2015

void do_nothing(DB x){}

void do_close (DB x){ hide x; destroy x; x = null }

DB mainDialog = create("Bla", styleNoBorder)
close ( mainDialog, false, do_nothing)
apply ( mainDialog, "Close", do_close)

realize mainDialog { setCenteredSize( mainDialog, 200, 200 ) }

show mainDialog

Enjoy ! 

Hi!

Thanks for your reply. But there is still a button with the label "close" on the bottom right of the window. How can i remove this?

The user should not have the option to use a close button on the lower right.

With best regards,
Bjoer

Re: Remove Close Button from DB mainDialog = create "Bla"
Wolfgang Uhr - Mon Jul 06 05:12:30 EDT 2015

Bjoern_Karpenstein - Mon Jul 06 04:38:29 EDT 2015

Hi!

Thanks for your reply. But there is still a button with the label "close" on the bottom right of the window. How can i remove this?

The user should not have the option to use a close button on the lower right.

With best regards,
Bjoer

Hi

Try to use:

close (mainDialog, false, doClose);

In this case you need a close-handler for the DB-Control.

Best regards

Wolfgang

 

Re: Remove Close Button from DB mainDialog = create "Bla"
pommCannelle - Mon Jul 06 05:14:36 EDT 2015

Bjoern_Karpenstein - Mon Jul 06 04:38:29 EDT 2015

Hi!

Thanks for your reply. But there is still a button with the label "close" on the bottom right of the window. How can i remove this?

The user should not have the option to use a close button on the lower right.

With best regards,
Bjoer

o_O 

yes ... this is the button i add with the line 
 

apply ( mainDialog, "Close", do_close)


if you don't add a close button, you just can't close your form and you have to build something specific to be abble to close it without closing the doors client ... So for the example, i add the close button, but this is not the 'natural' close button ;)
 

(@ master Wolfgang: line 6 of my snippet ;) )

 

Re: Remove Close Button from DB mainDialog = create "Bla"
woodpryan - Mon Jul 06 13:25:34 EDT 2015

void onClose()
{
    release(mainDialog);
}

close(mainDialog, false, onClose);

Function onClose will execute when the user clicks the X on the window. There is no close button. Just add the sixth line of code to your code after you call the create method on the mainDialog.