Oh good, it's not just me then!Fred wrote:...and to be honest I don't understand anything in your request.
CloseWindow()
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: CloseWindow()
BERESHEIT
Re: CloseWindow()
Add me to the list of those confused.netmaestro wrote:Oh good, it's not just me then!
Best wishes to the PB community. Thank you for the memories.
Re: CloseWindow()
And how here here native functions pb to learn that your window was closed?
You do not think that I do not know this approach
I know that there is no ideal programming language
But this does not mean that you do not need to improve your language.
So I wanted a logical flexibility. If you do not need it, let it be yours.
My native language is not English but Akhvah(Ахвахский), so it's hard for me to explain to you.
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
But this does not mean that you do not need to improve your language.
So I wanted a logical flexibility. If you do not need it, let it be yours.
My native language is not English but Akhvah(Ахвахский), so it's hard for me to explain to you.
Re: CloseWindow()
- you ask a question
- you get the answer
- you ignore the answer and ask the same question again
- you get another answer
- you ignore the answer again and ask the same question one more time
this sums up pretty much every single one of your threads, and its super annoying.
c ya,
nco2k
- you get the answer
- you ignore the answer and ask the same question again
- you get another answer
- you ignore the answer again and ask the same question one more time
this sums up pretty much every single one of your threads, and its super annoying.
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: CloseWindow()
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.
Here you are, for example, what do you say, in my penultimate post, that's how in the modules of the module I find out that my window has been closed if I imagine that the module I am writing a program with my module you write?
Re: CloseWindow()
IsWindow() for the 100th time:
or like i said, you could use a Callback:
i dont mind that your english isnt the best. thats not the issue. the issue is, that people are trying to help you, but you arent willing to put the slightest bit of effort from your end. if you want to make things work in a programming language, you have to... you know... do a little bit of programming yourself.
you 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.
c ya,
nco2k
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)
you 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.
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: CloseWindow()
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.
Re: CloseWindow()
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
Best wishes to the PB community. Thank you for the memories.
Re: CloseWindow()
And this is probably the stupid opinion of some programmersOnly an arrogant and shoddy programmer expects a programming language to conform to his needs.
Re: CloseWindow()
>> where will I check if my window exists?
wherever you need it.
>> this I need but only cross-platform
then make it cross-platform.
>> what if I want to improve the tool that I chose
by dumbing it down, because you dont understand basic purebasic mechanics?
>> this is probably the stupid opinion of some programmers
he is right though.
i honestly dont understand how you even expect this to work. #WM_DESTROY notifies you that the window has been destroyed. (Wait)WindowEvent() requires at least one open window to work. but the window has been destroyed. its gone. you wouldnt even receive a #PB_Event_DestroyWindow message. your event loop would simply go poof. but of course you havent thought about that.
anyway, all has been said and im done with this topic. if you dont want to put any effort into learning and understand basic purebasic mechanics, then thats your choice, and luckily none of my business.
c ya,
nco2k
wherever you need it.
>> this I need but only cross-platform
then make it cross-platform.
>> what if I want to improve the tool that I chose
by dumbing it down, because you dont understand basic purebasic mechanics?
>> this is probably the stupid opinion of some programmers
he is right though.
i honestly dont understand how you even expect this to work. #WM_DESTROY notifies you that the window has been destroyed. (Wait)WindowEvent() requires at least one open window to work. but the window has been destroyed. its gone. you wouldnt even receive a #PB_Event_DestroyWindow message. your event loop would simply go poof. but of course you havent thought about that.
anyway, all has been said and im done with this topic. if you dont want to put any effort into learning and understand basic purebasic mechanics, then thats your choice, and luckily none of my business.
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: CloseWindow()
From this I understand that it does not make sense to talk to you.>> Где я могу проверить, существует ли мое окно?
где бы вы ни нуждались.
>> Мне это нужно, но только кросс-платформу,
тогда сделайте ее кросс-платформенной.
Then, as it was clear what I'm talking about, you intend to ignore it.
-
- Addict
- Posts: 4527
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: CloseWindow()
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.
Maybe reading his "other" feature requests about closing windows will shed some light on the case?
WaitWindowClose()
WaitCloseWindow()
WindowClose
IsCloseWindow
Re: CloseWindow()
I don't understand the problem. It is the programmer's thing when the window should be closed.
If someone does not know how to program it, I have the' modul_myevents'.
This returns an event that destroyed a gadget or window
If someone does not know how to program it, I have the' modul_myevents'.
This returns an event that destroyed a gadget or window
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive