View Full Version : Ruby Application
merrua
October 3rd, 2006, 08:39 AM
This is my first time through making a ruby gui application and my first time on my own making a gui application.
I'm trying to understand how to change the 'page' of the windows application. When I have done what i want with this 'page' and want to load the next one. I dont want to make more than one window.
I think what im looking for is a top window. Do I change the frame holding the widgits? I dont think thats it as you can have more than one frame in a window. The root?
Im a bit lost on this subject. Could someone talk me through simply what i do here.
Im sorry the terms arent correct, ill try to explain myself again if anyone is having any difficult with my clumsy explaination.
Thank you very much
i5m
October 4th, 2006, 08:10 AM
What GUI toolkit are you using?
I've only ever used Tk to do simple one window applications. If this is the first GUI app you've ever built it might be worth starting off with something simple
Here's some links/references I used when creating my simple apps:
http://del.icio.us/i5m/tk
I don't fully understand what you mean (perhaps a sketch would help?), but did find these messages on the ruby-talk mailing list:
Ruby/Tk :: Opening a new window when selecting menu items (http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/67223)
Followups:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/67259
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/67261
merrua
October 4th, 2006, 09:16 AM
Im just using tk and ruby and writing it in sciTE.
Should I be using a toolkit?
Is there one for ruby tk?
Ill check out the links.
-----
| A |
-----
to
----
| B |
-----
I mean when for example when you log into an application
and it brings you to the main page.
i5m
October 4th, 2006, 11:52 AM
By toolkit I meant tk (or Fox, wxRuby, etc).
I'm not going to be much help to you (very much a beginner), but hopefully some of those links will.
merrua
October 5th, 2006, 11:44 AM
well hopeful either I find it in the links or someone can explain it.
i5m
October 6th, 2006, 03:27 AM
Here's a quick example (http://www.i5m.me.uk/relay/filestore/idisk/rubyforums/windowswop1.rb) that swops between two windows.
I'm still not sure I understand what you want, but at least this way you can try it out and say whether it's right.
I've got a slightly different example I'm working on as well that I'll try and post later.
i5m
October 6th, 2006, 05:32 AM
Here's example two (http://www.i5m.me.uk/relay/filestore/idisk/rubyforums/windowswop2.rb)
This uses packer instead of grid layout (not that it makes much difference for such a simple example) and swops between two frames within one window.
I hope these are of some use.
If you are on windows it is worth launching your ruby tk scripts from the command line rather than double clicking on the file when developing - that way you will at least get some feedback/error messages if it fails to launch the GUI
merrua
October 6th, 2006, 05:56 AM
The second example is exactly what i need to understand. No movement of the window onscreen, but the window changes to the next 'page' (frame).
perfect. I'll go through the code and try to understand everything.
thanks a lot!
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.