Page 1 of 1

Pushbutton in main window of xdemo

Posted: Fri May 12, 2017 2:25 am
by skiman
Hi,

I want some pushbuttons in the main windows of my application. I did a test with the XDEMO.PRG source.

I added the following code in xdemo.prg on line 190.

Code: Select all

@ 50,50 dcpushbutton ;
		Size 150,150 ;
		Parent oDialog ;
		Caption "TESTING" ;
		ACTION {|o| msgbox("I'm clicked") } pixel
This shows the button in the screen.
xdemo1.PNG
xdemo1.PNG (29.55 KiB) Viewed 10875 times
When I select an option in the menu, the button stays there as you can see below.
xdemo2.PNG
xdemo2.PNG (33.68 KiB) Viewed 10875 times
How can I prevent this?

Re: Pushbutton in main window of xdemo

Posted: Fri May 12, 2017 7:37 am
by rdonnay
Try this:

Code: Select all

@ 50,50 dcpushbutton ;
      Size 150,150 ;
      Parent oDialog:drawingArea  ;  <<<<<<<<<<<<<<<<<<<<<
      Caption "TESTING" ;
      ACTION {|o| msgbox("I'm clicked") } pixel

Re: Pushbutton in main window of xdemo

Posted: Mon May 15, 2017 7:52 am
by skiman
Hi Roger,

I just tested your suggestion, but it doesn't work.

Error BASE/2266
Description : Receiver of message is not an object.
Operation : drawingArea
Thread ID : 1

I'm trying to create some kind of dashboard in the main screen.

Any other suggestion?

Re: Pushbutton in main window of xdemo

Posted: Mon May 15, 2017 8:15 am
by rdonnay
Sorry Chris. I didn't look closely at what you were doing.

I put the same code in my XDEMO.PRG and see the problem.

Remove the "PARENT oDialog" from the DCPUSHBUTTON command.

Re: Pushbutton in main window of xdemo

Posted: Tue May 16, 2017 12:45 am
by skiman
Hi Roger,

That works. I tried a lot of things, but I didn't remove the parent clause.