[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Looking for good reads on Ruby TK GUI programming

Harry Truax

3/9/2006 5:35:00 PM

Thanks so much for the code. I think that is what I am looking for - I need
to understand what the routines you have provided do and their implications.
I will study them closely. My problem is, I can find some TK examples, but
it is hard to find corresponding Ruby/TK coding for the examples.

You are correct about the 'mind clarification' thing, tough to explain
something when you do not really have the tool-set knowledge in the first
place. But, we all start somewhere.

Here is a brief description of my application:

I am writing an Investment Manager application. This is comprised of a View
Manager, a Program Manager, a Spend Manager, an Account Manager, and perhaps
a Main Menu screen.

I am working on the View Manager right now. When started, it draws 12 months
on the screen starting with the current month - for example, right now it
shows March 2006 up to February 2007. All of the days are button widgets.
The View Manager will read a database file of spends in various programs.
When it finds spends that are due to mature for the 12 month view, the
appropriate day will be highlighted in green, and a textual description of
the spend will be displayed in a listbox at the bottom of the screen. I am
also considering to have this info displayed when you press a particular
highlighted day button. At the right of the screen or at the bottom,
depending on the available screen area, a selection box will list the
programs currently invested in. One will be able to set the 12 month view to
either all programs invested in or, it could show sub-sets of the current
programs. Also viewable on the same screen will be a section that shows the
money invested in each of the programs - a program status so to speak.

I haven't done this yet, but I would like the user to be able to select
either the View Manager screen, the Spend Manager screen, the Program
Manager screen or the Account Manager screen from a main screen that comes
up when you start the program. Or perhaps, a way to select the screens from
each of the manager screens. So from the View Manager screen, you could
choose to go to the Spend Manager screen, for example.

The Spend Manager screen would show a bunch of input text fields that would
enable you to make a spend in one of the programs curently available. It
would also allow you to edit/delete a particular spend. The Account Manager
Screen would have a bunch of input text fields that would enable you to
add/edit/delete an e-currency account in the current list - this is where
the Spend Manager gets the info on what account is being used to fund the
spend. The Program Manager would allow you to enter information into various
text fields about a new investment program,
as well as edit/update current program info.

Obviously, all of this stuff cannot fit on one screen. So I want to
functionally break-up my application per screen. The View Manager is almost
done, got the packing and class creation stuff down, but I do not have the
Ruby TK know-how yet on how to jump between screens - however, your code I
am sure will help.

Thanks again for your help,

Harry

-----Original Message-----
From: Hidetoshi NAGAI [mailto:nagai@ai.kyutech.ac.jp]
Sent: Thursday, March 09, 2006 11:44 AM
To: ruby-talk ML
Subject: Re: Looking for good reads on Ruby TK GUI programming

From: "Harry Truax" <htruax@stf.com>
Subject: Re: Looking for good reads on Ruby TK GUI programming
Date: Thu, 9 Mar 2006 23:12:58 +0900
Message-ID: <200603090912662.SM02816@htruax>
> I basically want to switch between one or more windows, each window
> takes up the whole screen, the user would enter/view data in each
> window, basic GUI stuff.

First of all, you'll have to clarify the design concept of your GUI.
# Probably, it will be clarified in your mind. ;-)

Do you mean the concept is such like as the following?
==========================================================================
require 'tk'

def window_setup(top)
top.overrideredirect(true)
top.geometry("#{top.winfo_screenwidth}x#{top.winfo_screenheight}+0+0")
top.pack_propagate(false)
TkFrame.new(top, :borderwidth=>2,
:relief=>:ridge).pack(:expand=>:true)
end

Tk.root.lower # This is important. If all toplevel windows (not iconified or
# withdrawn) are set overrideredirect flags, the application
# may not be able to get keyboard focus. So, keep the root
# widget under administration of window-manager, but put it
# lowest layer.

top0 = TkToplevel.new
top0_f = window_setup(top0)

top1 = TkToplevel.new
top1_f = window_setup(top1)

top2 = TkToplevel.new
top2_f = window_setup(top2)

Tk.update_idletasks
top0.raise

#-------------------------------------------------------------

v1 = TkVariable.new
v2 = TkVariable.new

#-------------------------------------------------------------
# top2

TkLabel.new(top1_f, :text=>'edit STR1').pack
e1 = TkEntry.new(top1_f, :textvariable=>v1).pack(:side=>:left)
b1 = TkButton.new(top1_f, :text=>'OK',
:command=>proc{top0.raise}).pack(:side=>:left)

e1.bind('Return', proc{b1.invoke})

#-------------------------------------------------------------
# top2

TkLabel.new(top2_f, :text=>'edit STR2').pack
e2 = TkEntry.new(top2_f, :textvariable=>v2).pack(:side=>:left)
b2 = TkButton.new(top2_f, :text=>'OK',
:command=>proc{top0.raise}).pack(:side=>:left)

e2.bind('Return', proc{b2.invoke})

#-------------------------------------------------------------
# top0

TkFrame.new(top0_f){|f|
TkLabel.new(f, :text=>'STR1:').pack(:side=>:left)
l = TkLabel.new(f, :textvariable=>v1, :anchor=>:w,
:width=>25, :relief=>:sunken).pack(:side=>:left)
b = TkButton.new(f, :text=>'edit', :command=>proc{
top1.raise
e1.focus # or e1.focus(true) (if 'force' flag is
required)
}).pack(:side=>:left)
l.bind('ButtonPress-1', proc{b.invoke}) }.pack

TkFrame.new(top0_f){|f|
TkLabel.new(f, :text=>'STR2:').pack(:side=>:left)
l = TkLabel.new(f, :textvariable=>v2, :anchor=>:w,
:width=>25, :relief=>:sunken).pack(:side=>:left)
b = TkButton.new(f, :text=>'edit', :command=>proc{
top2.raise
e2.focus # or e2.focus(true) (if 'force' flag is
required)
}).pack(:side=>:left)
l.bind('ButtonPress-1', proc{b.invoke}) }.pack

TkButton.new(top0_f, :text=>'QUIT', :command=>proc{exit}).pack

#-------------------------------------------------------------

Tk.mainloop
==========================================================================
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)






6 Answers

Hidetoshi NAGAI

3/10/2006 7:52:00 AM

0

The Peeler

9/24/2013 6:48:00 PM

0

On Tue, 24 Sep 2013 11:42:19 -0700, The Rectum, the resident psychopath of
sci, impersonating his master "NEMO", wrote:

>> > ...because TRUTH HURTS, you fucking unibrowed Grik asshole! LOL
>>
>> Looks like I PWN you ...and TOTALLY! LOL!
>>
>> Your amused master
>>
>> The Peeler
>
> LO!

Someone hit you a bit too often in your stupid gob, The Rectum? Or why can't
you laugh properly anymore? LMAO!

--
Retarded, anal, subnormal and extremely proud of it: our resident
psychopath, The Retard (aka "The Rectum").

NEMO

9/24/2013 7:56:00 PM

0

On 9/24/2013 11:47 AM, The Peeler wrote:
> On Tue, 24 Sep 2013 11:42:19 -0700, "NEMO", wrote:
>
>>>> ...because TRUTH HURTS, you fucking unibrowed Grik asshole! LOL
>>>
>>> Looks like you PWN me ...and TOTALLY! LOL!
>>>
>>> Your amusing anus
>>>
>>> The Foreskin Peeler
>>
>> LO!
>
> Seems, someone hit, me a bit too, often in my stupid Grik gob innit, The Rectum? Or, why can't,
> I laugh properly anymore innit? LMAP1

Good, question anus! Innit! AFAIR/ISTR! LMAP9

The Peeler

9/24/2013 8:00:00 PM

0

On Tue, 24 Sep 2013 12:55:56 -0700, The Rectum, the resident psychopath of
sci, impersonating his master "NEMO", wrote:

>> >> > ...because TRUTH HURTS, you fucking unibrowed Grik asshole! LOL
>> >>
>> >> Looks like I PWN you ...and TOTALLY! LOL!
>> >>
>> >> Your amused master
>> >>
>> >> The Peeler
>> >
>> > LO!
>>
>> Someone hit you a bit too often in your stupid gob, The Rectum? Or why can't
>> you laugh properly anymore? LMAO!
>
> Good, question anus! Innit! AFAIR/ISTR! LMAP9

Obviously someone hit you a bit on the right side of your stupid gob,
Radavic! WHO was it? LMAO!

--
Retarded, anal, subnormal and extremely proud of it: our resident
psychopath, The Retard (aka "The Rectum").

NEMO

9/24/2013 8:57:00 PM

0

On 9/24/2013 1:00 PM, The Peeler wrote:
> On Tue, 24 Sep 2013 12:55:56 -0700, "NEMO", wrote:
>
>>>>>> ...because TRUTH HURTS, you fucking unibrowed Grik asshole! LOL
>>>>>
>>>>> Looks like you PWN me ...and TOTALLY! LOL!
>>>>>
>>>>> Your amusing anus
>>>>>
>>>>> The Foreskin Peeler
>>>>
>>>> LO!
>>>
>>> Someone hit, me a bit too often in, my stupid Grik gob, The Rectum? Or why, can't
>>> I laugh properly anymore? LMAP1
>>
>> Good, question anus! Innit! AFAIR/ISTR! LMAP9
>
> Obviously someone hit, me a bit on, the right side of my, stupid Grik gob innit,
> Radavic! WHO was it? WAS it my PWNER the Revd? LMAO!

Seems! AFAIR/ISTR! LO!



The Peeler

9/24/2013 9:15:00 PM

0

On Tue, 24 Sep 2013 13:56:34 -0700, The Rectum, the resident psychopath of
sci, impersonating his master "NEMO", wrote:

>> >> >> > ...because TRUTH HURTS, you fucking unibrowed Grik asshole! LOL
>> >> >>
>> >> >> Looks like I PWN you ...and TOTALLY! LOL!
>> >> >>
>> >> >> Your amused master
>> >> >>
>> >> >> The Peeler
>> >> >
>> >> > LO!
>> >>
>> >> Someone hit you a bit too often in your stupid gob, The Rectum? Or why can't
>> >> you laugh properly anymore? LMAO!
>> >
>> > Good, question anus! Innit! AFAIR/ISTR! LMAP9
>>
>> Obviously someone hit you a bit on the right side of your stupid gob,
>> Radavic! WHO was it? LMAO!
>
> Seems! AFAIR/ISTR! LO!

....and WHO beat you to pulp like that, you fucked up beaten psychotic
cripple? Curious minds would like to know!

<VBG>


--
Silk from "uk.rec.driving" to our resident psycho:
"It's a shame there isn't a degree in wanking. They'd make YOU a professor."
MID: <1378226604380668849.677318me-privacy.net@news.aioe.org>