<body><div id="__MailbirdStyleContent" style="font-size: 12pt;font-family: calibri;color: #000000">
                                        Hi Edwin,<div><br></div><div>try to user patterns to reorder arguments:</div><div><br></div><div>self</div><div>   connect: self ui cmbStations signal: #currentIndexChanged:text:</div><div>   to: self ui edtStationId selector: #theText:</div><div>   pattern: #(2). "Here: 1 is the index, 2 is the text, and 0 would be the sender."</div><div><br></div><div>Take a look at the documentation here:</div><div><a href="https://github.com/hpi-swa/signals#arguments-and-patterns">https://github.com/hpi-swa/signals#arguments-and-patterns</a></div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 28.03.2018 00:49:06 schrieb Edwin Ancaer <eancaer@gmail.com>:</p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>Hello,</div><div><br></div><div><br></div><div> I  struggle a bit to make my problem clear, so forgive me if I write too much text.</div><div><br></div><div>To better understand how to build User Interfaces in an Object Oriented environment, I did some searching on the internet. I stumbled upon an article of Martin Fowler on the different GUI architectures. To help me understand what I was reding, I tried to build the UI that was used as an example. I did this with Morphic Designer, and building the UI went fine. <br></div><div><br></div><div>Next, I had to write some methods, to get the UI displayed on the screen. Still no big problems. <br></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">But then I needed to add some logic to use the value that was selected in a combobox widget to edit a lineEdit widget.:  I connected its signal </span><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">#currentIndexChanged:text:</span> </span><span style="font-family:arial,helvetica,sans-serif">to the method </span><span style="font-family:monospace,monospace"> #fill </span><span style="font-family:arial,helvetica,sans-serif">that initializes a textbox <span style="font-family:monospace,monospace">edtStationId</span> with the value that was selected from the combobox..</span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><u><span style="font-family:arial,helvetica,sans-serif">connecting the signal:</span></u><span style="font-family:monospace,monospace"> <br></span></div><div><span style="font-family:monospace,monospace"></span></div><div><span style="font-family:monospace,monospace">self connect:  self ui cmbStations signal: #currentIndexChanged:text:  toSelector: #fill.<br></span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace"><u>the method #fill: </u> </span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace">self ui edtStationId theText: <b>self ui cmbStations currentText.</b><br></span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif"></span></div><div><span style="font-family:arial,helvetica,sans-serif">This works, but it feels like cheating: I had hoped to be able to use the parameters from the signal to initialize the textfield, instead of having to reread this value explicitly with the <span style="font-family:monospace,monospace">currentText</span> method from the comboBox. Also, I think this will only work when my fill method is defined in the same class where the comboBox is used.As I see how the interface should interact with the rest of the application, this should not be the case as it seems its better to decouple the UI from the application. <br></span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace"></span></div><div><span style="font-family:monospace,monospace"> </span><span style="font-family:arial,helvetica,sans-serif">Is there a way to use the parameters of the signal directly instead of going back through the comboBox to get the selected values.</span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Hope that I was clear enough in my explications, and thanks already, <br></span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Edwin Ancaer.<br></span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:monospace,monospace"></span></div><span style="font-family:monospace,monospace"></span></div>

                        </blockquote>
                                        </div></body>