It is currently Wed Sep 18, 2019 9:01 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: ResizeWindow() and Map
PostPosted: Mon Aug 19, 2019 7:12 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
[Please delete post]

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Last edited by Thorsten1867 on Mon Aug 19, 2019 8:20 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: ResizeWindow() and Map
PostPosted: Mon Aug 19, 2019 7:26 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3654
Location: Berlin, Germany
Thorsten1867 wrote:
After ResizeWindow() the global map no longer has a current element.

Error: "Map has no active element"
Code:
NewMap Test.s()

Test("ID") = "Test"

If FindMapElement(Test(), "ID")
 
  ResizeWindow(#Window, #PB_Ignore, #PB_Ignore, Width, Height)
 
  Debug Test()

EndIf

This code snippet does not work at all: You can't resize a window that has not yet been created, constant #Window is not defined etc.

Fred wrote:
You will need to post full working snippet if you want us to look at a bug, because toying with an incomplete code is just waste of time as we don't even know if we meet the same conditions.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: ResizeWindow() and Map
PostPosted: Tue Aug 20, 2019 12:12 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3654
Location: Berlin, Germany
With some working code, I do NOT encounter your "bug" (tested with PB 5.71 LTS (x86 and x64) on Windows 10).
This code just shows a window and the Debug output that contains the text "Test". No error occurs at all here.

Code:
EnableExplicit

#Window = 0

If OpenWindow(#Window, 0,0, 200,200, "Demo") = 0
   MessageRequester("Fatal error", "Couldn't open main window.")
   End
EndIf

NewMap Test.s()

Test("ID") = "Test"

If FindMapElement(Test(), "ID")
   ResizeWindow(#Window, #PB_Ignore, #PB_Ignore, 100, 100)
   Debug Test()
EndIf

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
CloseWindow(#Window)

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye