<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[GMan's Mods & Stuff — Bugs with addGUIElement]]></title>
	<link rel="self" href="https://gprogs.com/extern.php?action=feed&amp;tid=274&amp;type=atom" />
	<updated>2007-09-24T02:19:31Z</updated>
	<generator>PunBB</generator>
	<id>https://gprogs.com/viewtopic.php?id=274</id>
		<entry>
			<title type="html"><![CDATA[Re: Bugs with addGUIElement]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1106#p1106" />
			<content type="html"><![CDATA[<p>Oops, i&#039;m think, thaht IGUIElement is simple containter for many buttons, combobox etc. <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> Thanx! I&#039;m now use &quot;modalScreen&quot;, again big thanx! <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Serge Petrowski]]></name>
				<uri>https://gprogs.com/profile.php?id=10</uri>
			</author>
			<updated>2007-09-24T02:19:31Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1106#p1106</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bugs with addGUIElement]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1105#p1105" />
			<content type="html"><![CDATA[]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2007-09-24T02:13:06Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1105#p1105</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bugs with addGUIElement]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1103#p1103" />
			<content type="html"><![CDATA[<p>I&#039;m now to make 3d strategy ( without ambitious <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> ) and all options, texts, etc read from XML. Also and GUI - i&#039;m load from XML all buttons, checkbox etc. Function Generate_GUI simple created in lists new list <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> and into this new list added all button with element. After, i&#039;m simple make invisible need me element ( and him child as buttons, checkbox etc) and to visible other element ( with child). You think? I&#039;m dont know, thaht i&#039;m write up <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Serge Petrowski]]></name>
				<uri>https://gprogs.com/profile.php?id=10</uri>
			</author>
			<updated>2007-09-24T01:39:23Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1103#p1103</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bugs with addGUIElement]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1101#p1101" />
			<content type="html"><![CDATA[<p>greetings <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; what is your call to Generate_GUI() look like?</p>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2007-09-24T01:28:40Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1101#p1101</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bugs with addGUIElement]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1100#p1100" />
			<content type="html"><![CDATA[<p>Hello, please, help me <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> I&#039;m dont know - this is my error or bug with Irrlicht?</p><div class="codebox"><pre><code>Type TGUI
    Field element:IGUIElement, element_name:String
    Field button:IGUIButton[16] , checkbox:IGUICheckBox[16] , colorselectdialog:IGUIColorSelectDialog
    Field combobox:IGUIComboBox[4] , contextmenu:IGUIContextMenu[2] , editbox:IGUIEditBox[16] 
    Field fileopendialog:IGUIFileOpenDialog, image:IGUIImage[32] , inoutfader:IGUIInOutFader[4] 
    Field listbox:IGUIListBox[4] , meshviewer:IGUIMeshViewer[2] , scrollbar:IGUIScrollBar[4] 
    Field statictext:IGUIStaticText[32] , tab:IGUITab[4] , tabcontrol:IGUITabControl[4] 
    Field toolbar:IGUIToolBar[2] , iwindow:IGUIWindow[2] 
EndType
Global TGUI_list:TList = New TList

Function Generate_GUI(file_url:String, name_element:String) 
    Local button_var:Int

    Local gui:TGUI = New TGUI
    TGUI_list.AddLast gui
    
    gui.element_name = name_element:String
    gui.element = env.addGUIElement(gui.element_name) 
    If gui.element = Null
    DebugLog gui.element_name + &quot; ^ Null&quot;
    EndIf
    gui.element.setMinSize(_DIMENSION2DI(app_vars:Int[graphics_width] , app_vars:Int[graphics_height] )) 
    
    Local xml:TXml = New TXml
    TXml_list.Addlast xml
    xml.file:IXMLReaderUTF8 = current_filesystem.createXMLReaderUTF8(file_url:String) 
    While xml.file.read() 
        Select xml.file.getNodeType() 
            Case EXN_ELEMENT
                Select xml.file.getNodeName() 
                    Case &quot;gui&quot;
                        Select xml.file.getAttributeValue(&quot;type_gui&quot;) 
                            Case &quot;button&quot;
                                button_var:+1
                                gui.button[button_var] = env.addButton(_RECTI(Int(xml.file.getAttributeValue(&quot;x1&quot;)), Int(xml.file.getAttributeValue(&quot;y1&quot;)), Int(xml.file.getAttributeValue(&quot;x2&quot;)), Int(xml.file.getAttributeValue(&quot;y2&quot;))), gui.element, Int(xml.file.getAttributeValue(&quot;id&quot;)), xml.file.getAttributeValue(&quot;text&quot;), xml.file.getAttributeValue(&quot;tooltip&quot;)) 
                                DebugLog &quot;button&quot;
                            Default
                        endselect
                        xml.nodename:String = xml.file.getNodeName() 
                End Select
            Case EXN_TEXT
                Select xml.nodename:String
                    Case &quot;gui&quot;
                        DebugLog xml.file.getNodeData() 
                End Select 
        End Select
    Wend
    TXml_list.remove(xml) 
EndFunction</code></pre></div><p>On this line: </p><div class="codebox"><pre><code>gui.element.setMinSize(_DIMENSION2DI(app_vars:Int[graphics_width] , app_vars:Int[graphics_height] ))</code></pre></div><p>show this error:</p><p>Compiling:main.bmx flat assembler&nbsp; version 1.67.23&nbsp; (316651 kilobytes memory)<br />4 passes, 0.1 seconds, 56317 bytes.<br />Linking:main.exe Irrlicht Engine version 1.3.1<br />Microsoft Windows XP Professional Service Pack 2 (Build 2600)<br />Using renderer: Direct3D 9.0<br />S3 Graphics Savage/IX 1014 s3gsavmx.dll 6.13.10.7050<br />DebugLog:test ^ Null<br />--?BlitzMax Debug Report:<br />Unhandled Exception:Attempt to access field or method of Null object</p>]]></content>
			<author>
				<name><![CDATA[Serge Petrowski]]></name>
				<uri>https://gprogs.com/profile.php?id=10</uri>
			</author>
			<updated>2007-09-23T19:39:03Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1100#p1100</id>
		</entry>
</feed>
