Page 1 of 1

XMLDialog Y Mac Bug?

Posted: Mon Apr 22, 2024 8:17 am
by Piero
Is this a bug? Try change OpenXMLDialog y below… on y zero it is circa at half screen here (Mac)

Code: Select all

#Dialog = 0
#Xml = 0
XML$ = "<window id='#PB_Any' name='test' text='test' minwidth='auto' minheight='auto' flags='#PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
   "  <panel>" +
   "    <tab text='First tab'>" +
   "      <vbox expand='item:2'>" +
   "        <hbox>" +
   "          <button text='button 1'/>" +
   "          <checkbox text='checkbox 1'/>" +
   "          <button text='button 2'/>" +
   "        </hbox>" +
   "        <editor text='content' height='150'/>" +
   "      </vbox>" +
   "    </tab>" +
   "    <tab text='Second tab'>" +
   "    </tab>" +
   "  </panel>" +
   "</window>"
If ParseXML(#Xml, XML$) And XMLStatus(#Xml) = #PB_XML_Success
   
   If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test",0,10) ; <--- y 10 here
      
      Repeat
         Event = WaitWindowEvent()
      Until Event = #PB_Event_CloseWindow 
   Else  
      Debug "Dialog error: " + DialogError(#Dialog)
   EndIf
Else
   Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf

Re: XMLDialog Y Mac Bug?

Posted: Mon Apr 22, 2024 1:10 pm
by Piero
Update:
on windows 10 no problem
on monterey m1 it doesn't work well even at low screen resolutions without retina…

Workaround (mac fix)

Posted: Mon Apr 22, 2024 5:04 pm
by Piero

Code: Select all

#Dialog = 0
#Xml = 0
XML$ = "<window id='#PB_Any' name='test' text='test' minwidth='auto' minheight='auto' flags='#PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
   "  <panel>" +
   "    <tab text='First tab'>" +
   "      <vbox expand='item:2'>" +
   "        <hbox>" +
   "          <button text='button 1'/>" +
   "          <checkbox text='checkbox 1'/>" +
   "          <button text='button 2'/>" +
   "        </hbox>" +
   "        <editor text='content' height='150'/>" +
   "      </vbox>" +
   "    </tab>" +
   "    <tab text='Second tab'>" +
   "    </tab>" +
   "  </panel>" +
   "</window>"
If ParseXML(#Xml, XML$) And XMLStatus(#Xml) = #PB_XML_Success
   
   If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test",0,0) ; <--- buggy y
      ResizeWindow(DialogWindow(#Dialog),0,0,#PB_Ignore,#PB_Ignore) ; fix y
      
      Repeat
         Event = WaitWindowEvent()
      Until Event = #PB_Event_CloseWindow 
   Else  
      Debug "Dialog error: " + DialogError(#Dialog)
   EndIf
Else
   Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf