Page 1 of 1

Button gadget OVER editor gadget

Posted: Fri Jul 16, 2021 9:33 am
by Joestes
Hi there!

I was wondering if there is a way to put a button gadget on top of an editor gadget.

For example: I have an editor gadget and want a small button in the lower right corner.

If I create an editor gadget first and then a buttongadget over it, it will work until you use the editorgadget, then it disappears. But I want the button gadget to be always visibile on top of the editor gadget. I think the drawing order of the gadgets needs to be manipulated: the button gadget has to be drawn last!

Thanks in advance!

Re: Button gadget OVER editor gadget

Posted: Fri Jul 16, 2021 10:49 am
by RASHAD
Hi
What is your OS ?

Re: Button gadget OVER editor gadget

Posted: Fri Jul 16, 2021 11:02 am
by Joestes
I'm sorry, forgot to mention. My platform is windows (cross platform is not an issue for me)

Re: Button gadget OVER editor gadget

Posted: Fri Jul 16, 2021 11:21 am
by RASHAD
Hi

Code: Select all

flags = #PB_Window_SystemMenu| #PB_Window_MaximizeGadget| #PB_Window_MinimizeGadget| #PB_Window_ScreenCentered | #PB_Window_SizeGadget
OpenWindow(0,0,0,800,600,"Test",Flags)
ButtonGadget(1,700,535,60,24,"RUN",#WS_CLIPSIBLINGS) ;Take care of the scroll bars
EditorGadget(2,10,10,780,580,#WS_CLIPSIBLINGS)
Repeat           
  Select WaitWindowEvent()      
    Case #PB_Event_CloseWindow
      Quit = 1 
      
    Case #PB_Event_Gadget
      Select EventGadget()
        Case 1
          Debug "OK"
      EndSelect 
  EndSelect 
  
Until Quit = 1
End

Re: Button gadget OVER editor gadget

Posted: Fri Jul 16, 2021 11:52 am
by Joestes
Great!

This is EXACTLY what I was looking for.

Thanks a lot RASHAD!!