[Glade-users] A click-less interface [SOLVED]



2008/11/3 Tristan Van Berkom <tristan.van.berkom at gmail.com>

On Mon, Nov 3, 2008 at 3:27 PM, BalaKrishna Kolluru
<balakkvj at dcs.shef.ac.uk> wrote:
Hello all,
            So here is the problem and any suggestions are welcome.

I am building a click-less interface, driven by an automatic speech
recogniser.
When I run my main function, I load the appropriate glade file, get the
input from the speech recogniser, load the appropriate widget.
To show the window, I use Gtk::Main::run().  But the problem is the
speech
recogniser is kept on hold as this function waits for a return when the
window is stopped.

Try reading this thoroughly:
http://library.gnome.org/devel/gtk/stable/gtk-General.html

Remember that the only thing that usually follows "gtk_main()"
is "return" or "exit()" - this is event based programming, you are
not to control your program flow at all :)

Cheers,
                -Tristan


Hey Tristan and all,
                               I found a work-around this problem and it is
working pretty well :)
As we can have only one method (typically main) calling and painting the
gui, I left the Gtk::Main::run()
in the main. However, I dynamically change the Glib::RefPtr based on the
spoken command which runs in a different
thread ahead of the run. As you speak, the interface gets updated
accordingly.

I have tested it for quite some time now, and it is yet to break.
Hope this helps for any of you now or in the future.

Thanks.

Regards,
B

PS: Thanks Tristan, it was your suggested url that helped me find a way out
in the end.

-- 
BalaKrishna Kolluru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20081106/2a71555d/attachment.html 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]