Page 1 of 1

Transparency of containergadget

Posted: Thu Nov 11, 2010 11:11 pm
by BjornF
I am trying to use the containergadget as a way of organising various gadgets. I have created a containergadget that totally covered a ListIconGadget. However, the headings of the ListIconGadget appear if I move the mouse over the location where they are (but hidden beneath the containergadget). I thought the containergadget was supposed to be totally non-transparent?
(similar things happen with other gadgets that are hidden beneath the containergadget)

I suspect I am missing something fundamental, but what? :cry:

Grateful for any hints / Björn

Re: Transparency of containergadget

Posted: Thu Nov 11, 2010 11:31 pm
by netmaestro
Purebasic doesn't support the overlapping of gadgets on a window. You could choose another way of organizing such as a scrollarea gadget or possibly hide or disable the listicon when it isn't being used, that way its events won't conflict with the container.

Re: Transparency of containergadget

Posted: Thu Nov 11, 2010 11:39 pm
by BjornF
Thank you for the rapid answer. :D

Just out of curiosity, why not?

Björn

Re: Transparency of containergadget

Posted: Thu Nov 11, 2010 11:45 pm
by idle
maybe you could use PanelGadgets instead.

Re: Transparency of containergadget

Posted: Fri Nov 12, 2010 2:14 am
by PureLust
@BjornF:

Even though it's not "the good way" to overlap Gadgets, it's still possible.

Have a look at the 2nd code in my post here - maybe this would be helpful to you.
If you compare the redrawing behavior of the 1st and the 2nd code, you'll see the difference.

So far I did not fully get what exactly you wanna do, so I don't know if this will fit your needs.
But if you cannot get it to work, a democode which shows what you wanna do would be helpfull.

And ... if you get it to work, a samplecode to demonstrate how you made it would be nice. Image

[Edit:]
I'm still not sure if I get what you want to do, but I gave it a try.
So I hope this snipped (with a ListIconGadget() and a Button underneath a container) will fit your needs:

Code: Select all

; Thanks to edel (aka hallodri) for his help on this !!!

hWnd = OpenWindow(0,#PB_Ignore,#PB_Ignore,250,250,"Main-Window",#WS_OVERLAPPEDWINDOW | #PB_Window_ScreenCentered)

ListIconGadget(0,5,70,200,170,"Test-ListIconGadget",250,#WS_CLIPSIBLINGS)
ButtonGadget(1,180,120,65,19,"...",#WS_CLIPSIBLINGS)

ContainerGadget(2,70,10,150,200, #PB_Container_Flat)
	ButtonGadget(3,-5,20,100,20,"...")
CloseGadgetList()

SetWindowPos_(GadgetID(0),#HWND_BOTTOM,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)
SetWindowPos_(GadgetID(1),#HWND_BOTTOM,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)
SetWindowPos_(GadgetID(2),#HWND_TOPMOST,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)

Repeat
   event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
Greetz, PL.

Re: Transparency of containergadget

Posted: Fri Nov 12, 2010 11:41 am
by Trond
BjornF wrote:Thank you for the rapid answer. :D

Just out of curiosity, why not?

Björn
Probably because PB is cross-platform and GTK (Linux GUI) doesn't support it.

The proper way is to hide the gadgets you don't need.

Re: Transparency of containergadget

Posted: Sun Nov 14, 2010 11:13 am
by BjornF
Dear All,

Thank you for all the help.

Dear PureLust, thank you for the code, but I think I will go with the idea of just putting all the controls on a container and then hide it. If I use the code I'll get back to you.

all the best / Björn