[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    Re: [Kde-bindings] RubyQt getting output when app quit
From:       Abdelrahman Ghanem <abom.jdev () gmail ! com>
Date:       2015-03-31 20:19:19
Message-ID: CAFB+irOhDh4iON3UU8WDp=Wc40zYqZThaSV5pDU2TeLrCTAeQA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Can't get what you want exactly, but you can try this simple app:

require 'Qt4'

class Window < Qt::Widget

  def initialize(values)
    super(nil) # no parent

    @combo = Qt::ComboBox.new
    @combo.addItems(values)
    @layout = Qt::VBoxLayout.new
    @layout.addWidget(@combo)

    self.windowTitle = "Combo App"
    self.resize(300, 50)
    self.layout = @layout
  end

  def closeEvent(event)
    puts @combo.currentText
  end

end

if $0 == __FILE__
  app = Qt::Application.new(ARGV) # you may use the QApplication
lastWindowClosed
  win = Window.new(('A'..'Z').to_a)
  win.show
  app.exec
end

http://pastebin.com/CxtiA3SP

On Sun, Mar 29, 2015 at 4:11 PM, Yvon Thoraval <yvon.thoraval@gmail.com>
wrote:

> I'm trying a simple app it shows in a combobox some values and I want to
> output the choosen value when quitting the app.
> this little app will be use from command line that's the reason i want the
> choosen value to STDOUT.
>
> best.
>
>
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings@kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings
>
>

[Attachment #5 (text/html)]

<div dir="ltr">Can&#39;t get what you want exactly, but you can try this simple \
app:<div><br></div><div><div>require &#39;Qt4&#39;</div><div><br></div><div>class Window &lt; \
Qt::Widget</div><div><br></div><div>   def initialize(values)</div><div>      super(nil) # no \
parent</div><div><br></div><div>      @combo = Qt::ComboBox.new</div><div>      \
@combo.addItems(values)</div><div>      @layout = Qt::VBoxLayout.new</div><div>      \
@layout.addWidget(@combo)</div><div><br></div><div>      self.windowTitle = &quot;Combo \
App&quot;</div><div>      self.resize(300, 50)</div><div>      self.layout = @layout</div><div>   \
end</div><div><br></div><div>   def closeEvent(event)</div><div>      puts @combo.currentText</div><div>  \
end</div><div><br></div><div>end</div><div><br></div><div>if $0 == __FILE__</div><div>   app = \
Qt::Application.new(ARGV) # you may use the QApplication lastWindowClosed</div><div>   win = \
Window.new((&#39;A&#39;..&#39;Z&#39;).to_a)</div><div>   win.show</div><div>   \
app.exec</div><div>end</div></div><div><br></div><div><a \
href="http://pastebin.com/CxtiA3SP">http://pastebin.com/CxtiA3SP</a><br></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 29, 2015 at 4:11 PM, Yvon Thoraval <span \
dir="ltr">&lt;<a href="mailto:yvon.thoraval@gmail.com" \
target="_blank">yvon.thoraval@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I&#39;m trying a \
simple app it shows in a combobox some values and I want to output the choosen value when quitting the \
app.<div>this little app will be use from command line that&#39;s the reason i want the choosen value to \
STDOUT.</div><div><br></div><div>best.</div><div><br></div></div> \
<br>_______________________________________________<br> Kde-bindings mailing list<br>
<a href="mailto:Kde-bindings@kde.org">Kde-bindings@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-bindings" \
target="_blank">https://mail.kde.org/mailman/listinfo/kde-bindings</a><br> \
<br></blockquote></div><br></div>


[Attachment #6 (text/plain)]

_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic