Re: CloseWindow()
Posted: Mon Oct 09, 2017 12:50 am
Oh good, it's not just me then!Fred wrote:...and to be honest I don't understand anything in your request.
Oh good, it's not just me then!Fred wrote:...and to be honest I don't understand anything in your request.
Add me to the list of those confused.netmaestro wrote:Oh good, it's not just me then!
Code: Select all
;-TOP
DeclareModule MyDialog
Declare Open(ParentWindow)
EndDeclareModule
Module MyDialog
Global win
Procedure CloseDialog()
; Unbind
UnbindEvent(#PB_Event_CloseWindow, @CloseDialog(), win)
UnbindEvent(#PB_Event_CloseWindow, @CloseDialog(), ParentWindow)
Debug "ToDo Close Diaglog ..."
If EventWindow() = win
Debug "Close from dialog"
Else
Debug "Close from main"
EndIf
CloseWindow(win)
Debug "Ready."
EndProcedure
Procedure Open(ParentWindow)
win = OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 300, 200, "MyDialog", #PB_Window_Tool | #PB_Window_SystemMenu, ParentWindow)
; Bind
BindEvent(#PB_Event_CloseWindow, @CloseDialog(), win)
BindEvent(#PB_Event_CloseWindow, @CloseDialog(), ParentWindow)
; Code
ProcedureReturn win
EndProcedure
EndModule
; Help window for dispatch events - We needed allway one window for do events
Global MyHideWindow = OpenWindow(#PB_Any,0,0,0,0, "DoEvents", #PB_Window_Invisible | #PB_Window_NoGadgets); | #PB_Window_NoActivate)
Global ExitApplication, MyDialog
Procedure CloseMain()
Debug "ToDo Close MainWindow ..."
Debug "Ready."
CloseWindow(0)
ExitApplication = #True
EndProcedure
Procedure Main()
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 400, 300, "Main", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ButtonGadget(1, 10,10,100,30,"CloseDialog")
BindEvent(#PB_Event_CloseWindow, @CloseMain(), 0)
MyDialog = MyDialog::Open(0)
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 1
CloseWindow(MyDialog)
EndSelect
Case #PB_Event_CloseWindow
If EventWindow() = 0
;CloseWindow(0)
Break
EndIf
EndSelect
Until ExitApplication
EndIf
EndProcedure : Main()
End
Code: Select all
DeclareModule MyDialog
Declare Open(ParentWindow)
Declare CloseDialog()
EndDeclareModule
Select EventGadget()
Case 1
MyDialog::CloseDialog();CloseWindow(MyDialog)
EndSelect
I would not want to annoy you, but if I see that you do not understand what I'm asking. So can not you try again to explain this to you?this sums up pretty much every single one of your threads, and its super annoying.
Code: Select all
OpenWindow(0, 0, 0, 200, 100, "")
Debug IsWindow(0)
CloseWindow(0)
Debug IsWindow(0)
Code: Select all
Procedure WndProc(hWnd, uMsg, wParam, lParam)
If uMsg = #WM_DESTROY
Debug "#WM_DESTROY"
EndIf
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
OpenWindow(0, 0, 0, 200, 100, "")
SetWindowCallback(@WndProc(), 0)
CloseWindow(0)
Well this is ridiculous. I explain why, and where will I check if my window exists? In a stream or in a timer?IsWindow() for the 100th time:
Code: Select all
Procedure WndProc(hWnd, uMsg, wParam, lParam)
If uMsg = #WM_DESTROY
Debug "#WM_DESTROY"
EndIf
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
OpenWindow(0, 0, 0, 200, 100, "")
SetWindowCallback(@WndProc(), 0)
CloseWindow(0)
Here you are right, what if I want to improve the tool that I choseyou have all the tools you need, but instead you are posting bug reports and feature requests, that should fix all the problems you created on your own. instead of copy+pasting the examples and complaining that they are not working the way you want them to, maybe you should try to understand them first and then adjust them to your needs.
Only an arrogant and shoddy programmer expects a programming language to conform to his needs. A good programmer will adapt to the programming language he is using. If a programming language does not meet his needs, he will go find one that does. You might be happier with another programming language.mestnyi wrote:what if I want to improve the tool that I chose
And this is probably the stupid opinion of some programmersOnly an arrogant and shoddy programmer expects a programming language to conform to his needs.
From this I understand that it does not make sense to talk to you.>> Где я могу проверить, существует ли мое окно?
где бы вы ни нуждались.
>> Мне это нужно, но только кросс-платформу,
тогда сделайте ее кросс-платформенной.
Dear Fred, netmaestro and others ... you do not understand?netmaestro wrote:Oh good, it's not just me then!Fred wrote:...and to be honest I don't understand anything in your request.