PureBasic Forum
https://www.purebasic.fr/english/

Dialog gridbox spacing
https://www.purebasic.fr/english/viewtopic.php?f=24&t=72771
Page 1 of 1

Author:  wombats [ Thu May 09, 2019 11:33 am ]
Post subject:  Dialog gridbox spacing

Hi,

On macOS, the ImageGadget is bigger than desired.

Image

Code:
Runtime Enumeration
  #Dialog
  #XML
  #Image
EndEnumeration

Procedure.s GetDialogXML()
  Protected xml$
  xml$ + "<window id='#Dialog' name='Test' text='' minwidth='350' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_WindowCentered | #PB_Window_SizeGadget'>"
  xml$ + "  <vbox expand='item:1'>"
  xml$ + "    <gridbox columns='3' colexpand='item:2' rowexpand='equal'>"
  xml$ + "      <text text='One:'/>"
  xml$ + "      <string height='22' text='...'/>"
  xml$ + "      <image name='img' width='16' height='16' maxwidth='16' maxheight='16'/>"
  xml$ + "    </gridbox>"
  xml$ + "  </vbox>"
  xml$ + "</window>"
  ProcedureReturn xml$
EndProcedure

If ParseXML(#XML, GetDialogXML()) And XMLStatus(#Xml) = #PB_XML_Success
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #XML, "Test")
    CreateImage(#Image, 16, 16, 32, RGB(0, 0, 255))
    SetGadgetState(DialogGadget(#Dialog, "img"), ImageID(#Image))
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
EndIf

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/