<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[GMan's Mods & Stuff — Bugs with addGUIElement]]></title>
		<link>https://gprogs.com/viewtopic.php?id=274</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=274&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Bugs with addGUIElement.]]></description>
		<lastBuildDate>Mon, 24 Sep 2007 02:19:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Bugs with addGUIElement]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1106#p1106</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Serge Petrowski)]]></author>
			<pubDate>Mon, 24 Sep 2007 02:19:31 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1106#p1106</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bugs with addGUIElement]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1105#p1105</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (gman)]]></author>
			<pubDate>Mon, 24 Sep 2007 02:13:06 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1105#p1105</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bugs with addGUIElement]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1103#p1103</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Serge Petrowski)]]></author>
			<pubDate>Mon, 24 Sep 2007 01:39:23 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1103#p1103</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bugs with addGUIElement]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1101#p1101</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (gman)]]></author>
			<pubDate>Mon, 24 Sep 2007 01:28:40 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1101#p1101</guid>
		</item>
		<item>
			<title><![CDATA[Bugs with addGUIElement]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1100#p1100</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Serge Petrowski)]]></author>
			<pubDate>Sun, 23 Sep 2007 19:39:03 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1100#p1100</guid>
		</item>
	</channel>
</rss>
