Transparency of containergadget

Just starting out? Need help? Post your questions and find answers here.
BjornF
User
User
Posts: 35
Joined: Mon Jun 23, 2008 11:09 am
Location: Copenhagen

Transparency of containergadget

Post 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
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Transparency of containergadget

Post 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.
BERESHEIT
BjornF
User
User
Posts: 35
Joined: Mon Jun 23, 2008 11:09 am
Location: Copenhagen

Re: Transparency of containergadget

Post by BjornF »

Thank you for the rapid answer. :D

Just out of curiosity, why not?

Björn
User avatar
idle
Always Here
Always Here
Posts: 5928
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Transparency of containergadget

Post by idle »

maybe you could use PanelGadgets instead.
Windows 11, Manjaro, Raspberry Pi OS
Image
PureLust
Enthusiast
Enthusiast
Posts: 477
Joined: Mon Apr 16, 2007 3:57 am
Location: Germany, NRW

Re: Transparency of containergadget

Post 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.
[Dynamic-Dialogs] - create complex GUIs the easy way
[DeFlicker] - easily deflicker your resizeable Windows
[WinFX] - Window Effects (incl. 'click-through' Window)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Transparency of containergadget

Post 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.
BjornF
User
User
Posts: 35
Joined: Mon Jun 23, 2008 11:09 am
Location: Copenhagen

Re: Transparency of containergadget

Post 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
Post Reply