I would think you can put the GUI in a while(true) type loop so that it
doesn't close immediately. There should be nicer way though.

found a workaround using `wait()`

qnew_class("mwin", "QtGui.QMainWindow") ## QtGui -- not just Qt.
w = qnew_class_instance("mwin")
qset_method(w, :closeEvent) do e
 w[:close]()
 notify(closeCondition)
end

raise(w)

closeCondition = Condition()
wait(closeCondition)

I had to redefine the `closeEvent` so that it could notify the process to stop waiting and exit

Sam


--J


On Friday, March 28, 2014 1:54:10 PM UTC-4, Samuele Carcagno wrote:

    A few more PySide.jl questions. I haven't been able to figure out the
    following conversions from Python:

    self.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.CustomizeWindowHint |
    QtCore.Qt.WindowMinimizeButtonHint |
    QtCore.Qt.WindowMaximizeButtonHint)


    below is my failed attempt:

    rbw[:setWindowFlags](QtCore["Qt"]["Window"] |
    QtCore["Qt"]["CustomizeWindowHint"] |
    QtCore["Qt"]["WindowMinimizeButtonHint"] |
    QtCore["Qt"]["WindowMaximizeButtonHint"])

    the problem seems to be with the "|" operator, superficially it looks
    like a bitwise OR which should be the same in Julia and Python, but I'm
    not sure what it means in Qt4 context. The error I get is "ERROR: no
    method |(PyObject, PyObject)".
    I tried setting each flag one by one, but this doesn't seem to have the
    desired effects.

    I also haven't been able to figure out the following two:
    setWindowModality(Qt.NonModal)
    setFocusPolicy(Qt.NoFocus)

    Finally, is there a way to start a PySide GUI without having the Julia
    shell? I've tried with `julia --eval 'reload("myapp.jl")'`, but the
    program exits immediately after evaluation. I've also tried with `Julia
    --load "myapp.jl"` but the Julia shell starts in the background.

    Cheers,

    Sam


Reply via email to