Button gadget OVER editor gadget

Just starting out? Need help? Post your questions and find answers here.
Joestes
User
User
Posts: 25
Joined: Thu Mar 19, 2009 12:42 pm
Location: Utrecht, The Netherlands

Button gadget OVER editor gadget

Post 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!
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4955
Joined: Sun Apr 12, 2009 6:27 am

Re: Button gadget OVER editor gadget

Post by RASHAD »

Hi
What is your OS ?
Egypt my love
Joestes
User
User
Posts: 25
Joined: Thu Mar 19, 2009 12:42 pm
Location: Utrecht, The Netherlands

Re: Button gadget OVER editor gadget

Post by Joestes »

I'm sorry, forgot to mention. My platform is windows (cross platform is not an issue for me)
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4955
Joined: Sun Apr 12, 2009 6:27 am

Re: Button gadget OVER editor gadget

Post 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
Egypt my love
Joestes
User
User
Posts: 25
Joined: Thu Mar 19, 2009 12:42 pm
Location: Utrecht, The Netherlands

Re: Button gadget OVER editor gadget

Post by Joestes »

Great!

This is EXACTLY what I was looking for.

Thanks a lot RASHAD!!
Post Reply