First time using PureBasic, and would like to know if it is possible to display a button using ButtonGadget with no border.
I would be grateful if anyone could help with this problem.
Remove ButtonGadget border
-
- New User
- Posts: 3
- Joined: Thu May 11, 2023 2:56 pm
- Location: Portsmouth, Uk
Re: Remove ButtonGadget border
Code from uwekel:
...if you are on Linux. Since you didn't specify your OS...
Code: Select all
If OpenWindow(0, 0, 0, 300, 200, "Borderless Button", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 10, 10, 80, 40, "Test")
gtk_button_set_relief_(GadgetID(0), 2)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Remove ButtonGadget border
Possible but cumbersome (and possibly cross-platform):
Code: Select all
Enumeration
#Window
#Container
#Button
EndEnumeration
If OpenWindow(#Window, 0, 0, 322, 150, "ButtonGadget without border", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ContainerGadget(#Container, 10, 10, 100, 100)
ButtonGadget(#Button, -4, -4, 108, 108, "Button 1")
CloseGadgetList()
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Hygge
-
- New User
- Posts: 3
- Joined: Thu May 11, 2023 2:56 pm
- Location: Portsmouth, Uk
Re: Remove ButtonGadget border
Thanks for the code, jacdelad, and Kiffi, the code works fine for displaying only one button, but having a problem trying to display two buttons within the same window.
I would be grateful if anyone could help with this problem.
I would be grateful if anyone could help with this problem.
Re: Remove ButtonGadget border
Hi Ross Carter
You can use HyperLinkGadget() instead
Or
If you are Windows User you can use TextGadget() with #SS_Notify
Or Owner Drawn Gadget
There are many alternative in this case
You can use HyperLinkGadget() instead
Or
If you are Windows User you can use TextGadget() with #SS_Notify
Or Owner Drawn Gadget
There are many alternative in this case
Code: Select all
OpenWindow(0, 0, 0, 270, 160, "HyperLinkButton", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
HyperLinkGadget(0, 10, 10, 80,22," Button #1",$0000FF)
HyperLinkGadget(1, 10, 45, 80,22," Button #2",$00FF00)
HyperLinkGadget(2, 10, 80, 80,22," Button #3",$FF0000)
SetGadgetColor(0,#PB_Gadget_BackColor,$E8E9FE)
SetGadgetColor(1,#PB_Gadget_BackColor,$E8FEEE)
SetGadgetColor(2,#PB_Gadget_BackColor,$FEEEE8)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case 0,1,2
Debug "Button "+Str(EventGadget())
EndSelect
EndSelect
Until Quit = 1
Egypt my love
-
- New User
- Posts: 3
- Joined: Thu May 11, 2023 2:56 pm
- Location: Portsmouth, Uk
Re: Remove ButtonGadget border
Thanks RASHAD for your code, I never would have thought about using the HyperLinkGadget, it works fine.
Re: Remove ButtonGadget border
Wow! Thi's a nice way of have colored button with mouseover effect 
Another awesome trik from RASHAD

Another awesome trik from RASHAD
