<HTML><BODY><p style="margin-top: 0px;" dir="ltr">Hi Bruce. <br> That idea just came to me last night .. seems to work.</p> 
<p dir="ltr">Sorry </p> 
<div id="mail-app-auto-default-signature">
 <p dir="ltr">--<br> Thanks<br> Brian G</p>
</div>Monday, 09 August 2021, 11:46PM -07:00 from Brian G <a href="mailto:brian@westwoodsvcs.com">brian@westwoodsvcs.com</a>:<br><br><blockquote id="mail-app-auto-quote" cite="16285779740000043779" style="border-left:1px solid #0878BD; margin:0px 0px 0px 10px; padding:0px 0px 0px 10px;">
        



    









        
        


        
        
        
        
        

        
        

        
        



<div class="js-helper js-readmsg-msg">
        <style type="text/css"></style>
        <div >
                <base target="_self" href="https://e-aj.my.com/" />
                
                        <div id="style_16285779740000043779_BODY"><div class="cl_580284"><div style="font-family: arial, helvetica, sans-serif;font-size: 12pt;color: #000000"><div>Bruce, </div><div>If you make the following change your errors will go to the console</div><div>and all underlying C code errors will go to the pipe. No need for filters in the</div><div>File_read function. probably a good idea to log them in case anything really</div><div>does go wrong.</div><div>If you don't want to capture those errors at all then just make writer open as "/dev/null"</div><div>skip the whole open for read.</div><div><br></div><div >"Failure is the key to success; <br> each mistake teaches us something"  .. Morihei Ueshiba<br>Brian G</div><div><br><span id="zwchr_mr_css_attr" >----- On Aug 9, 2021, at 7:41 AM, Bruce Steers <<a href="mailto:bsteers4@gmail.com">bsteers4@gmail.com</a>> wrote:<br></span></div><div ><blockquote style="border-left: 2px solid #1010FF;margin-left: 5px;padding-left: 5px;color: #000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF;margin-left: 5px;padding-left: 5px;color: #000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;"><div dir="ltr"><div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;">Many Thanks BrianG.  With this and your other help I now have this routine....</div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><b>' Gambas class file<br><br>Extern dup2(OldFD As Integer, newfd As Integer) In "libc:6"<br>Private Writer As File<br>Private Reader As File<br>Private restore As File<br><br>Public Sub _new()<br>  Writer = Open Pipe "/tmp/testpipeout" For Write<br>  restore = File.Err<br>  dup2(Writer.handle, 2)<br>  Reader = Open Pipe "/tmp/testpipeout" For Read Watch<br>End</b></div></div></div></blockquote><div >Public Sub _new()</div><div >  Writer = Open Pipe "/tmp/testpipeout" For Write</div><div >  </div><div ><b style="color: #000000;font-family: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">' get the error destination to a known handle</b></div><div >  restore = Open "/dev/null" For Write                 ' open any old file to get a handle</div><div >  dup2(2, restore.handle)                                     ' Make that handle equal std error</div><div >  Error To restore                                                  ' point gambas's error output to the original term </div><div >  </div><div >  dup2(Writer.handle, 2)</div><div >  Reader = Open Pipe "/tmp/testpipeout" For Read Watch</div><div > </div><div >End</div><div ><br></div><div >Alternatively if not wanting to capture the other libc errors then just:</div><div ><br ></div><div ><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">Public Sub _new()</div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">  Writer = Open Pipe "/dev/null" For Write</div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">  </div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;"><b data-mce-style="color: #000000;font-family: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" style="color: rgb(0, 0, 0);font-family: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">' get the error destination to a known handle</b></div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">  restore = Open "/dev/null" For Write                 ' open any old file to get handle</div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">  dup2(2, restore.handle)                                     ' Make that handle equal std error</div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">  Error To restore                                                  ' point gambas's error output to the original term </div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">  </div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">  dup2(Writer.handle, 2)                                       ' All other outputs to null don't need file_read at all</div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;"> </div><div style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: arial, helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">End</div></div><div><br></div><blockquote style="border-left: 2px solid #1010FF;margin-left: 5px;padding-left: 5px;color: #000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF;margin-left: 5px;padding-left: 5px;color: #000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;"><div dir="ltr"><div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><b><br><br>Public Sub File_read()<br><br>  Dim buffer As String<br><br>  buffer = Read #Last, -Lof(Last)<br>  For Each sLine As String In Split(buffer, "\n")<br>    If Not sLine Then Continue<br>    If sLine Like "(" & Application.Name & ":*): G*k-*" Then Continue <br>    Print sLine<br>  Next<br><br>End</b></div></div></div></blockquote><b style="color: #000000;font-family: Helvetica, Arial, sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: Helvetica, Arial, sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">Public Sub File_read()<br>  Dim buffer As String<br>  buffer = Read #Last, -Lof(Last)</b></div><div ><b style="color: #000000;font-family: Helvetica, Arial, sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: Helvetica, Arial, sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">  '' write to some logfile here maybe</b></div><div ><b style="color: #000000;font-family: Helvetica, Arial, sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" data-mce-style="color: #000000;font-family: Helvetica, Arial, sans-serif;font-size: small;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: #ffffff;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">End</b></div><div ><div><br></div><blockquote style="border-left: 2px solid #1010FF;margin-left: 5px;padding-left: 5px;color: #000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF;margin-left: 5px;padding-left: 5px;color: #000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;"><div dir="ltr"><div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><b><br><br><b>Public Sub Form_Close()<br>  If Writer Then Writer.Close()<br>  If Reader Then Reader.Close()<br>  dup2(restore.handle, 2)<br>End<br><br></b></b></div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><b><br></b></div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><b>Public Sub Button1_Click()<br><br>  Print "Print Something"<br>  Debug "Debug Something"</b></div></div></div></blockquote><div>   Error "something"</div><blockquote style="border-left: 2px solid #1010FF;margin-left: 5px;padding-left: 5px;color: #000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF;margin-left: 5px;padding-left: 5px;color: #000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;"><div dir="ltr"><div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><b><br><br>End<br></b></div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;">I had to check each line of the buffer individually and used Like to pattern-match the Gtk- Gdk- messages<br></div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;">So with that code my own Debug and Error messages still output (albeit to stdout but that's fine) just the gtk/gdk messages are gone :)</div><div style="font-size: small;" class="gmail_default_mr_css_attr" data-mce-style="font-size: small;">Thanks again Brian , much respect :)<br></div>BruceS</div><br></div><br><br><br><div class="gmail_quote_mr_css_attr"><div dir="ltr" class="gmail_attr_mr_css_attr">On Sun, 8 Aug 2021 at 03:34, Brian G <<a href="mailto:brian@westwoodsvcs.com" target="_blank"  rel=" noopener noreferrer" >brian@westwoodsvcs.com</a>> wrote:<br></div><blockquote class="gmail_quote_mr_css_attr" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid #cccccc;padding-left: 1ex;" data-mce-style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid #cccccc;padding-left: 1ex;"><div><div style="font-family: arial,helvetica,sans-serif;font-size: 12pt;color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif;font-size: 12pt;color: #000000;"><div>Bruce replace your _new with this code</div><br><div><div>Extern dup2(OldFD As Integer, newfd As Integer) In "libc:6"</div><div>Static Dummy As File</div><div>Static Public Sub _init()</div><div>  dummy = Open "/dev/null" For Write</div><div>  dup2(dummy.Handle, 1)</div><div>  dup2(dummy.handle, 2)</div><div>End</div><br><div>Should give you what you want without all the fiddle</div></div><br><div>"Failure is the key to success; <br> each mistake teaches us something"  .. Morihei Ueshiba<br>Brian G</div><div><br><span id="m_6764088249479869363gmail-m_2058899195762317763zwchr_mr_css_attr">----- On Aug 7, 2021, at 12:39 PM, Bruce Steers <<a href="mailto:bsteers4@gmail.com" target="_blank"  rel=" noopener noreferrer" >bsteers4@gmail.com</a>> wrote:<br></span></div><div><blockquote style="border-left: 2px solid #1010ff;margin-left: 5px;padding-left: 5px;color: #000000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;" data-mce-style="border-left: 2px solid #1010ff;margin-left: 5px;padding-left: 5px;color: #000000;font-weight: normal;font-style: normal;text-decoration: none;font-family: Helvetica,Arial,sans-serif;font-size: 12pt;"><div dir="ltr"><div dir="ltr"><div style="font-size: small;" data-mce-style="font-size: small;"><br></div></div><br><div class="gmail_quote_mr_css_attr"><div dir="ltr" class="gmail_attr_mr_css_attr">On Thu, 5 Aug 2021 at 20:34, Bruce Steers <<a href="mailto:bsteers4@gmail.com" target="_blank"  rel=" noopener noreferrer" >bsteers4@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote_mr_css_attr" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid #cccccc;padding-left: 1ex;" data-mce-style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid #cccccc;padding-left: 1ex;"><div dir="ltr"><div dir="ltr"><div style="font-size: small;" data-mce-style="font-size: small;"><br></div></div><br><div class="gmail_quote_mr_css_attr"><div dir="ltr" class="gmail_attr_mr_css_attr">On Wed, 4 Aug 2021 at 00:53, <<a href="mailto:jose.rodriguez@cenpalab.cu" target="_blank"  rel=" noopener noreferrer" >jose.rodriguez@cenpalab.cu</a>> wrote:<br></div><blockquote class="gmail_quote_mr_css_attr" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid #cccccc;padding-left: 1ex;" data-mce-style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid #cccccc;padding-left: 1ex;"><div><div style="font-family: arial,sans-serif;font-size: 13px;" data-mce-style="font-family: arial,sans-serif;font-size: 13px;">August 3, 2021 2:29 PM, "Bruce Steers" <<a href="mailto:bsteers4@gmail.com?to=%22Bruce%20Steers%22%20%3Cbsteers4@gmail.com%3E" target="_blank"  rel=" noopener noreferrer" >bsteers4@gmail.com</a>> wrote:<br><blockquote><div><div><div dir="ltr"><div style="font-size: small;" data-mce-style="font-size: small;">I have this program i'm developing that was starting and stopping cleanly then i recently added some controls and did various other things and now it says this when it starts...</div><div style="font-size: small;" data-mce-style="font-size: small;">(Desktop-ish:12906): Gtk-WARNING **: 16:29:25.336: Theme parsing error: <data>:1:15: Expected a valid selectorIs there a way to track down what's causing it?</div><div style="font-size: small;" data-mce-style="font-size: small;">thanks</div><div style="font-size: small;" data-mce-style="font-size: small;">BruceS</div></div></div></div></blockquote><br><br>GTK has always output loads of different errors with many programs (not gambas ones, I mean), when run in a terminal. People say it depends on the current theme and whatnot...<br><br></div></div></blockquote><br><div style="font-size: small;" data-mce-style="font-size: small;">Indeed, Pluma was always my texteditor of choice and that used to pump out loads of warnings.</div><div style="font-size: small;" data-mce-style="font-size: small;">(but now of course i use my own editor i wrote with gambas that has all those cool Texteditor features ;) ) <br></div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;">Would be great to be able to catch the warnings though.</div><div style="font-size: small;" data-mce-style="font-size: small;">Either a way to track what exactly is causing them or just suppress the messages.</div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;">BruceS<br></div></div></div></blockquote><br><br><div style="font-size: small;" data-mce-style="font-size: small;">so best answer i have so far is this "hack"...</div><div style="font-size: small;" data-mce-style="font-size: small;">Uses gb.args</div><div style="font-size: small;" data-mce-style="font-size: small;">if the arg -q or --quiet is given then before the app loads it launches itself with any and all args plus "2>/dev/null" to redirect the error output and an additional arg -s.<br></div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;">when the 2nd run instance quits the 1st one that launched the second one also quits before it's even done anything.<br></div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;"><b>Public Sub _new()<br><br>  Args.Begin()<br>  Dim bQuiet As Boolean = Args.Has("q", "quiet", "supress gtk error messages")<br>  If bQuiet Then bQuiet = (Args.Has("s", "supressed", "supressed gtk error warnings") == False)<br>  Args.End()<br><br>  If bQuiet And File.In.IsTerm Then </b> ' if we are not run from a terminal then no need for any of this<b><br>    Dim sRestOfargs As String[] = Args.All.Copy()<br></b></div><div style="font-size: small;" data-mce-style="font-size: small;"><b><br></b></div><div style="font-size: small;" data-mce-style="font-size: small;"><b>    '</b> the next 2 lines just handle if being run from the IDE and make Arg[0] be executable name.<b><br></b></div><div style="font-size: small;" data-mce-style="font-size: small;"><b>    If Not InStr(sRestOfargs[0], "/") Then sRestOfargs[0] = Application.Path &/ Application.Name<br>    If File.Ext(sRestOfargs[0]) <> "gambas" Then sRestOfargs[0] &= ".gambas"   <br></b></div><div style="font-size: small;" data-mce-style="font-size: small;"><b><br></b></div><div style="font-size: small;" data-mce-style="font-size: small;"><b>    sRestOfargs.Insert(["-s", "2>/dev/null"])<br>    Shell sRestOfargs.Join(" ")<br>    Me.Close<br>    Return<br>  Endif<br><br>End<br></b></div><div style="font-size: small;" data-mce-style="font-size: small;"><b><br></b></div><div style="font-size: small;" data-mce-style="font-size: small;">Attached is a simple test app</div><div style="font-size: small;" data-mce-style="font-size: small;">It's a form with a tiny little TextArea in it, so small it produces warnings on my system when i move the mouse around the window...</div><div style="font-size: small;" data-mce-style="font-size: small;">(Test:79673): Gdk-CRITICAL **: 20:26:58.775: gdk_window_is_visible: assertion 'GDK_IS_WINDOW (window)' failed</div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;">Run with -q and all is quiet.</div><div style="font-size: small;" data-mce-style="font-size: small;">./Test.gambas -q<br></div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;">Of course this method will suppress ANY error messages , <br></div><div style="font-size: small;" data-mce-style="font-size: small;">shell commands can be fixed by adding '>2&1' <br></div><div style="font-size: small;" data-mce-style="font-size: small;">Shell "/run/mycommand 2>&1"</div><div style="font-size: small;" data-mce-style="font-size: small;">that redirects error output to stdout and stdout is still showing</div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;">Please somebody tell me there's a better way...</div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div><div style="font-size: small;" data-mce-style="font-size: small;">BruceS</div><div style="font-size: small;" data-mce-style="font-size: small;"><br></div></div></div><br><br>----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" target="_blank"  rel=" noopener noreferrer" >http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br></blockquote></div></div></div><br>----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" target="_blank"  rel=" noopener noreferrer" >http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br></blockquote></div></div><br><br>----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" target="_blank" >http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br></blockquote></div></div></div></div>
                        <div><br>
----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" target="_blank" >http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br>
<br>
</div>
                
                <base target="_self" href="https://e-aj.my.com/" />
        </div>

        
</div>


</blockquote></BODY></HTML>