PB5.11 Don't know if this is related or not but I have a ToggleImageGadgetButton in a container and it vanishes when the program starts and re-appears when you hover the mouse over it.
Previous versions of PB were okay.
Standard ImageButtons seem to be okay.
ButtonImageGadget disappears
- Fangbeast
- PureBasic Protozoa
- Posts: 4790
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: ButtonImageGadget disappears
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: ButtonImageGadget disappears
Hi Fangles!
I just commented out the flag on ButtonImageGadget
in my first example. Same behaviour.
Don't think so. Try this:Fangbeast wrote:...
Standard ImageButtons seem to be okay.
Code: Select all
EnableExplicit
Enumeration
#MainWindow
EndEnumeration
Enumeration
#Toolbar
EndEnumeration
Enumeration
#myImgButton
#myNrmButton
EndEnumeration
Define Quit.i, Event.i
OpenWindow(#MainWindow, 10, 10, 300, 300, "Test")
CreateToolBar(#Toolbar, WindowID(#MainWindow))
ButtonImageGadget(#myImgButton, WindowWidth(#MainWindow)-30, 1, 24, 24, 0);, #PB_Button_Toggle)
SetParent_(GadgetID(#myImgButton), ToolBarID(#Toolbar))
ButtonGadget(#myNrmButton, WindowWidth(#MainWindow)-60, 1, 24, 24, "", #PB_Button_Toggle)
SetParent_(GadgetID(#myNrmButton), ToolBarID(#Toolbar))
Quit=0
Repeat
Event=WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
Quit=#True
EndSelect
Until Quit
End
in my first example. Same behaviour.

- Fangbeast
- PureBasic Protozoa
- Posts: 4790
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: ButtonImageGadget disappears
ImageButtonGadget with toggle flag, on a container, button vanishes on startup.
ImageButtonGadget with no flag, on a container, button is okay.
PB 5.11, Windows 8 PRO.
And I can reliably reproduce this. It's always the button with the toggle flag.
ImageButtonGadget with no flag, on a container, button is okay.
PB 5.11, Windows 8 PRO.
And I can reliably reproduce this. It's always the button with the toggle flag.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: ButtonImageGadget disappears
See if the next works fine with you Fangles
Code: Select all
;EnableExplicit
Enumeration
#MainWindow
EndEnumeration
Enumeration
#Toolbar
#TBB1
#TBB2
#TBB3
EndEnumeration
Enumeration
#myImgButton = 100
#myNrmButton = 101
EndEnumeration
CreateImage(0, 24, 24)
StartDrawing(ImageOutput(0))
Box(0, 0, 24, 24, $F0F0F0)
LineXY(0,0, 23,23, $0000FF)
LineXY(0,23, 23,0, $0000FF)
StopDrawing()
CreateImage(1, 24, 24)
StartDrawing(ImageOutput(1))
Box(0, 0, 24, 24, $F0F0F0)
DrawingMode(#PB_2DDrawing_Outlined)
Circle(12, 12, 4, $0000FF)
StopDrawing()
Define Quit.i, Event.i
OpenWindow(#MainWindow, 10, 10, 300, 300, "Test")
CreateToolBar(#Toolbar, WindowID(#MainWindow))
ToolBarStandardButton(#TBB1, #PB_ToolBarIcon_New)
ToolBarStandardButton(#TBB2, #PB_ToolBarIcon_Open)
ToolBarStandardButton(#TBB3, #PB_ToolBarIcon_Save)
ButtonImageGadget(#myImgButton, WindowWidth(#MainWindow)-30, 1, 24, 24, ImageID(1), #PB_Button_Toggle)
SetParent_(GadgetID(#myImgButton), ToolBarID(#Toolbar))
ButtonGadget(#myNrmButton, WindowWidth(#MainWindow)-60, 1, 24, 24, "", #PB_Button_Toggle)
SetParent_(GadgetID(#myNrmButton), ToolBarID(#Toolbar))
Quit=0
Image = 1
Repeat
Event=WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
Quit=#True
Case #PB_Event_Gadget
Select EventGadget()
Case #myImgButton
Image ! 1
SetGadgetAttribute(#myImgButton,#PB_Button_Image,ImageID(Image))
EndSelect
Case #WM_KEYDOWN
If EventwParam() = 9
InvalidateRect_(GadgetID(#myImgButton),0,1)
EndIf
EndSelect
Until Quit
End
Egypt my love
Re: ButtonImageGadget disappears
Hi Rashad!
PB 5.11 (and 5.10) x86, Win7 Ultimate, SP1 x64
I'm not Rashad, but your code still does'nt work for me.RASHAD wrote:See if the next works fine with you Fangles
...
PB 5.11 (and 5.10) x86, Win7 Ultimate, SP1 x64

Re: ButtonImageGadget disappears
Hi Lord
Yes you said that before
That is why I am talking to Fangles
Because it works here with PB 5.11 Win XP SP2,Win 7 x64 & Win 8 x64
So let us here from Fangles maybe we can isolate the problem

Yes you said that before
That is why I am talking to Fangles
Because it works here with PB 5.11 Win XP SP2,Win 7 x64 & Win 8 x64
So let us here from Fangles maybe we can isolate the problem
Egypt my love