PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > Ruby wishlist
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Ruby wishlist

Réponse
 
LinkBack Outils de la discussion
Vieux 08/06/2008, 04h18   #1
jzakiya
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Ruby wishlist

You can do this:

n1, n2, n3, n4 = nil

But you can't do this:

n1, n2, n3, n4 = [something]

And you can't do this:

n1, n2, n3, n4 [+,-,*, etc]= [something]

I really wish you could. I would make some of my
code so much more simple and concise.

Make the software work more for the user, and not the other
way around.
  Réponse avec citation
Vieux 08/06/2008, 04h35   #2
Rimantas Liubertas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

> But you can't do this:
>
> n1, n2, n3, n4 = [something]


Just add one simbol and you can:

$ irb --simple-prompt
>> n1, n2, n3, n4 = *[1, 2, 3, 4]

=> [1, 2, 3, 4]
>> n1

=> 1
>> n2

=> 2
>> n3

=> 3
>> n4

=> 4

> And you can't do this:
>
> n1, n2, n3, n4 [+,-,*, etc]= [something]


Not sure what you want here.

<...> Make the software work more for the user, and not the other
> way around.


Make sure you know the software.


Regards,
Rimantas
--
http://rimantas.com/

  Réponse avec citation
Vieux 08/06/2008, 05h00   #3
jzakiya
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

On Jun 7, 11:35 pm, Rimantas Liubertas <riman...@gmail.com> wrote:
> > But you can't do this:

>
> > n1, n2, n3, n4 = [something]

>
> Just add one simbol and you can:
>
> $ irb --simple-prompt>> n1, n2, n3, n4 = *[1, 2, 3, 4]
> => [1, 2, 3, 4]
> >> n1

> => 1
> >> n2

> => 2
> >> n3

> => 3
> >> n4

>
> => 4
>
> > And you can't do this:

>
> > n1, n2, n3, n4 [+,-,*, etc]= [something]

>
> Not sure what you want here.
>
> <...> Make the software work more for the user, and not the other
>
> > way around.

>
> Make sure you know the software.
>
> Regards,
> Rimantas
> --http://rimantas.com/


Sorry for the confusion.

I want to set multiple variable to the same value:

n1, n2, n3, n4 = 5

and do +=, -=, *=, etc with the same value

n1, n2, n3, n4 += 5

instead of

n1 += 9; n2 += 9; n3 += 9; n4 += 9

It would soooo much more expressive, and concise.

  Réponse avec citation
Vieux 08/06/2008, 06h30   #4
David Masover
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

On Saturday 07 June 2008 23:03:47 jzakiya wrote:
> On Jun 7, 11:35 pm, Rimantas Liubertas <riman...@gmail.com> wrote:


> > $ irb --simple-prompt>> n1, n2, n3, n4 = *[1, 2, 3, 4]


Probably easier to simply do

n1, n2, n3, n4 = 1, 2, 3, 4

But I'm not sure that's what you wanted.

> n1, n2, n3, n4 = 5


n1 = n2 = n3 = n4 = 5

This works because the result of the assignment is the value which was
assigned. It's also not Ruby-specific. Probably even works in C.

> and do +=, -=, *=, etc with the same value
>
> n1, n2, n3, n4 += 5


This doesn't work because of the semantics of multiple assignment. See, your
first example:

n1, n2, n3, n4 = nil

That doesn't work because there's anything magical about nil. It works because
nil is the value when nothing is provided. It parses out to something like
this:

n1, n2, n3, n4 = nil, nil, nil, nil

And you can see this effect, too:

n1, n2, n3, n4 = 5

n1 will be 5, but n2, n3, and n4 won't be.

Now, with your semantics of doing a += there, shouldn't it be more like:

n1, n2, n3, n4 += 1, 2, 3, 4

> instead of
>
> n1 += 9; n2 += 9; n3 += 9; n4 += 9


Erm... I can't ever remember needing this. Not ever.

If you're trying to do it on an array, maybe something like:

0.upto(a.length-1) { |i| a[i] += 9 }

But unless I'm missing something -- and feel free to correct me with a real
example -- what you're trying to do really suggests that you want to refactor
your program a bit.

  Réponse avec citation
Vieux 08/06/2008, 07h55   #5
David A. Black
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

Hi --

On Sun, 8 Jun 2008, David Masover wrote:

> If you're trying to do it on an array, maybe something like:
>
> 0.upto(a.length-1) { |i| a[i] += 9 }


You could also use each_index there:

a.each_index {|i| a[i] += 9 }

or even:

a.map! {|e| e + 9 }


David

--
Rails training from David A. Black and Ruby Power and Light:
INTRO TO RAILS June 9-12 Berlin
ADVANCING WITH RAILS June 16-19 Berlin
ADVANCING WITH RAILS July 21-24 Edison, NJ
See http://www.rubypal.com for details and updates!

  Réponse avec citation
Vieux 08/06/2008, 08h03   #6
ProgramDragon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut GUI library/framework?

I think someone already asked this, but I want to confirm:

I am trying to write a program with a GUI, but I don't know what GUI
framework is the best.

I have heard that JRuby is a good option, but also heard that Swing was
a bad idea to use with JRuby.

I want to be able to write this program so that the end user can install
ruby, then run the program and it will start with no other installation
needed (like installing gems, etc, however I can do the gems in the program
on first run if it comes down to it).


I hope that makes sense, any ideas?


Sincerely,

Jayce Meade


  Réponse avec citation
Vieux 08/06/2008, 08h23   #7
David Masover
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

On Sunday 08 June 2008 02:03:23 ProgramDragon wrote:
> I think someone already asked this, but I want to confirm:


In the future, try to find the old thread and reply to it instead of starting
a new one.

> I am trying to write a program with a GUI, but I don't know what GUI
> framework is the best.


Nobody knows that yet, I think. That's why there's so many of them.

> I want to be able to write this program so that the end user can install
> ruby, then run the program and it will start with no other installation
> needed (like installing gems, etc, however I can do the gems in the program
> on first run if it comes down to it).


That's a completely separate problem from what GUI library to use. If you're
afraid to use libraries for this reason, SOLVE THIS PROBLEM NOW, and then
worry about GUI libraries. Simplifying your installation program is not an
excuse for NIH syndrome -- and just think how much time you'll have to polish
it if you find that half the program you wanted is already a gem.

If it's an open source project, or at least free-as-in-beer, you might
consider simply making it a gem. Then, all your users need to do is type:

gem install my_great_program

and all the dependent gems will be installed.

  Réponse avec citation
Vieux 08/06/2008, 08h38   #8
ProgramDragon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

David,


Sorry, lol.

I am not afraid to use libraries, it's just that this is a bot
program for deviantART's chat network, and usually the people that want to
get them are not really that coherent in how to actually get one, so I'm
trying to make it as simple as I can. It's just a few ruby source files that
can be run with a batch file on Windows. It is open source, GNU GPL license.
The user just has to download and extract the program from a zip file,
however would that work with the Gems? It doesn't use a command prompt
window, the main file is a .rbw file.

One bot is installed by installing ruby, and then downloading,
extracting it, and then installing a gem for colors, and then running it
with a batch file. I would prefer to keep it simple as installing ruby,
download, extract, and run. I don't mind using gems or having to install
them, but the user that gets the program might.

--------------------------------------------------
From: "David Masover" <ninja@slaphack.com>
Sent: Sunday, June 08, 2008 12:23 AM
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Subject: Re: GUI library/framework?

> On Sunday 08 June 2008 02:03:23 ProgramDragon wrote:
>> I think someone already asked this, but I want to confirm:

>
> In the future, try to find the old thread and reply to it instead of
> starting
> a new one.
>
>> I am trying to write a program with a GUI, but I don't know what GUI
>> framework is the best.

>
> Nobody knows that yet, I think. That's why there's so many of them.
>
>> I want to be able to write this program so that the end user can
>> install
>> ruby, then run the program and it will start with no other installation
>> needed (like installing gems, etc, however I can do the gems in the
>> program
>> on first run if it comes down to it).

>
> That's a completely separate problem from what GUI library to use. If
> you're
> afraid to use libraries for this reason, SOLVE THIS PROBLEM NOW, and then
> worry about GUI libraries. Simplifying your installation program is not an
> excuse for NIH syndrome -- and just think how much time you'll have to
> polish
> it if you find that half the program you wanted is already a gem.
>
> If it's an open source project, or at least free-as-in-beer, you might
> consider simply making it a gem. Then, all your users need to do is type:
>
> gem install my_great_program
>
> and all the dependent gems will be installed.
>
>


  Réponse avec citation
Vieux 08/06/2008, 08h45   #9
Martin DeMello
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

On Sun, Jun 8, 2008 at 12:38 AM, ProgramDragon <programdragon@live.com> wrote:
> I am not afraid to use libraries, it's just that this is a bot program
> for deviantART's chat network, and usually the people that want to get them
> are not really that coherent in how to actually get one, so I'm trying to
> make it as simple as I can. It's just a few ruby source files that can be


Look up rubyscript2exe. It packages your program, all its libraries
and the ruby interpreter itself into a single executable.

martin

  Réponse avec citation
Vieux 08/06/2008, 08h51   #10
ProgramDragon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

Martin,

Thanks, I had forgotten about that. Can it also load files from other
folders such as a Plugins folder? This program is supposed to be able to
have extensions added once it's completed. I am fairly new to Ruby, I've
only been working with it a few months. Sorry if I am asking stupid
questions, just trying to get advice from experts. =P

--------------------------------------------------
From: "Martin DeMello" <martindemello@gmail.com>
Sent: Sunday, June 08, 2008 12:45 AM
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Subject: Re: GUI library/framework?

> On Sun, Jun 8, 2008 at 12:38 AM, ProgramDragon <programdragon@live.com>
> wrote:
>> I am not afraid to use libraries, it's just that this is a bot
>> program
>> for deviantART's chat network, and usually the people that want to get
>> them
>> are not really that coherent in how to actually get one, so I'm trying to
>> make it as simple as I can. It's just a few ruby source files that can be

>
> Look up rubyscript2exe. It packages your program, all its libraries
> and the ruby interpreter itself into a single executable.
>
> martin
>
>


  Réponse avec citation
Vieux 08/06/2008, 09h31   #11
Martin DeMello
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

On Sun, Jun 8, 2008 at 12:51 AM, ProgramDragon <programdragon@live.com> wrote:
> Martin,
>
> Thanks, I had forgotten about that. Can it also load files from other
> folders such as a Plugins folder? This program is supposed to be able to
> have extensions added once it's completed. I am fairly new to Ruby, I've
> only been working with it a few months. Sorry if I am asking stupid
> questions, just trying to get advice from experts. =P


As long as it knows where to find your plugins folder, that shouldn't
be a problem. You won't be able to use relative paths, of course, but
something like a C:\yourapp\plugins should be fine. (Internally,
rubyscript2exe unpacks your app into a temp directory on the fly and
then executes it)

martin

  Réponse avec citation
Vieux 08/06/2008, 09h51   #12
Martin DeMello
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

On Sat, Jun 7, 2008 at 8:18 PM, jzakiya <jzakiya@mail.com> wrote:
> You can do this:
>
> n1, n2, n3, n4 = nil
>
> But you can't do this:
>
> n1, n2, n3, n4 = [something]
>
> And you can't do this:
>
> n1, n2, n3, n4 [+,-,*, etc]= [something]


This really suggests that n1, n2, n3, n4 want to be n[1..4]. Then see
http://weblog.raganwald.com/2007/10/stringtoproc.html

martin

  Réponse avec citation
Vieux 08/06/2008, 10h05   #13
Robert Klemme
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

On 08.06.2008 06:00, jzakiya wrote:
> On Jun 7, 11:35 pm, Rimantas Liubertas <riman...@gmail.com> wrote:
>>> But you can't do this:
>>> n1, n2, n3, n4 = [something]

>> Just add one simbol and you can:
>>
>> $ irb --simple-prompt>> n1, n2, n3, n4 = *[1, 2, 3, 4]
>> => [1, 2, 3, 4]
>>>> n1

>> => 1
>>>> n2

>> => 2
>>>> n3

>> => 3
>>>> n4

>> => 4
>>
>>> And you can't do this:
>>> n1, n2, n3, n4 [+,-,*, etc]= [something]

>> Not sure what you want here.
>>
>> <...> Make the software work more for the user, and not the other
>>
>>> way around.

>> Make sure you know the software.


!

> Sorry for the confusion.
>
> I want to set multiple variable to the same value:
>
> n1, n2, n3, n4 = 5


Your variable naming indicates that you are probably using the wrong
tool: you rather want an Array of values vs. a number of variables. If
you do that, life becomes much easier:

> and do +=, -=, *=, etc with the same value
>
> n1, n2, n3, n4 += 5


ns.map! {|n| n + 5}

Kind regards

robert
  Réponse avec citation
Vieux 08/06/2008, 15h56   #14
jzakiya
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

On Jun 8, 5:05 am, Robert Klemme <shortcut...@googlemail.com> wrote:
> On 08.06.2008 06:00, jzakiya wrote:
>
>
>
> > On Jun 7, 11:35 pm, Rimantas Liubertas <riman...@gmail.com> wrote:
> >>> But you can't do this:
> >>> n1, n2, n3, n4 = [something]
> >> Just add one simbol and you can:

>
> >> $ irb --simple-prompt>> n1, n2, n3, n4 = *[1, 2, 3, 4]
> >> => [1, 2, 3, 4]
> >>>> n1
> >> => 1
> >>>> n2
> >> => 2
> >>>> n3
> >> => 3
> >>>> n4
> >> => 4

>
> >>> And you can't do this:
> >>> n1, n2, n3, n4 [+,-,*, etc]= [something]
> >> Not sure what you want here.

>
> >> <...> Make the software work more for the user, and not the other

>
> >>> way around.
> >> Make sure you know the software.

>
> !
>
> > Sorry for the confusion.

>
> > I want to set multiple variable to the same value:

>
> > n1, n2, n3, n4 = 5

>
> Your variable naming indicates that you are probably using the wrong
> tool: you rather want an Array of values vs. a number of variables. If
> you do that, life becomes much easier:
>
> > and do +=, -=, *=, etc with the same value

>
> > n1, n2, n3, n4 += 5

>
> ns.map! {|n| n + 5}
>
> Kind regards
>
> robert


The names of the variables are not array values, they
are just different variable names, they could be any
names.

Remember, I would LIKE ruby to be able to do this.
It is my "whishlist". I know Ruby doesn't do it now,
but I would like it to be able to in the future. OK! :-)

Peace

Jabari
  Réponse avec citation
Vieux 08/06/2008, 18h07   #15
Charles Oliver Nutter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

ProgramDragon wrote:
> I think someone already asked this, but I want to confirm:
>
> I am trying to write a program with a GUI, but I don't know what GUI
> framework is the best.
>
> I have heard that JRuby is a good option, but also heard that Swing
> was a bad idea to use with JRuby.


Not at all, Swing is a great idea. In fact, I'd go so far as to say
Swing is a lot better idea from JRuby than from Java.

> I want to be able to write this program so that the end user can
> install ruby, then run the program and it will start with no other
> installation needed (like installing gems, etc, however I can do the
> gems in the program on first run if it comes down to it).


Monkeybars + Rawr can package up an application with all requirements
into a single executable .jar, .app, or .exe...awesome stuff.

- Charlie

  Réponse avec citation
Vieux 08/06/2008, 19h30   #16
AzimuthDragon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

Is that so? Sounds cool. So I would be able to package my entire program
into a jar, .app or executable? I'm still not quite sure how to get it to
load things from outside the executable though, because the program isn't
installed into C:\Program Files. Most often it's extracted into a folder on
the user's desktop, so it needs to be able to generate a filepath. I have
been using Dir.getwd to generate a filepath to my main file, and then an
argument passed to the filepath method adds folder names onto the end, lol.
Would that still work, do you think? Here is my basic structure for the
program's directory, say it's in a folder called Ecko (doh). It would look
like this, if you outlined it.

/Ecko
Main.rbw
/System
config.rb
/Core
connection.class.rb
parse.class.rb
users.class.rb
extensions.class.rb
/Extensions
/Logs
/Images
/Screenshots
/Splash
/Data
/Docs
index.html


Basic layout, but that's what it would have to be able to go into if it was
an executable. Lol, I must sound like an idiot. xP


--------------------------------------------------
From: "Charles Oliver Nutter" <charles.nutter@sun.com>
Sent: Sunday, June 08, 2008 10:07 AM
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Subject: Re: GUI library/framework?

> ProgramDragon wrote:
>> I think someone already asked this, but I want to confirm:
>>
>> I am trying to write a program with a GUI, but I don't know what GUI
>> framework is the best.
>>
>> I have heard that JRuby is a good option, but also heard that Swing
>> was a bad idea to use with JRuby.

>
> Not at all, Swing is a great idea. In fact, I'd go so far as to say Swing
> is a lot better idea from JRuby than from Java.
>
>> I want to be able to write this program so that the end user can
>> install ruby, then run the program and it will start with no other
>> installation needed (like installing gems, etc, however I can do the gems
>> in the program on first run if it comes down to it).

>
> Monkeybars + Rawr can package up an application with all requirements into
> a single executable .jar, .app, or .exe...awesome stuff.
>
> - Charlie
>
>


  Réponse avec citation
Vieux 08/06/2008, 19h38   #17
David Masover
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

On Sunday 08 June 2008 09:58:41 jzakiya wrote:

> The names of the variables are not array values, they
> are just different variable names, they could be any
> names.


Yes, we understand that. It's just probably better design for your program as
a whole to use an array here.

Can you give us more detail as to why you want this feature?

  Réponse avec citation
Vieux 08/06/2008, 23h08   #18
Charles Oliver Nutter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

AzimuthDragon wrote:
> Is that so? Sounds cool. So I would be able to package my entire program
> into a jar, .app or executable? I'm still not quite sure how to get it
> to load things from outside the executable though, because the program
> isn't installed into C:\Program Files. Most often it's extracted into a
> folder on the user's desktop, so it needs to be able to generate a
> filepath. I have been using Dir.getwd to generate a filepath to my main
> file, and then an argument passed to the filepath method adds folder
> names onto the end, lol. Would that still work, do you think? Here is my
> basic structure for the program's directory, say it's in a folder called
> Ecko (doh). It would look like this, if you outlined it.


Yeah, that's the goal behind David Koontz's stuff in Monkeybars and
Rawr. I'm pretty sure you can provide your own structure, but he'd
probably know better. David, you out there?

Alternatively, try #monkeybars on freenode during the week.

- Charlie

  Réponse avec citation
Vieux 09/06/2008, 05h51   #19
AzimuthDragon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

Okay, I will give that a whirl Tuesday. SCHOOLS OUT! WOOT

--------------------------------------------------
From: "Charles Oliver Nutter" <charles.nutter@sun.com>
Sent: Sunday, June 08, 2008 3:08 PM
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Subject: Re: GUI library/framework?

> AzimuthDragon wrote:
>> Is that so? Sounds cool. So I would be able to package my entire program
>> into a jar, .app or executable? I'm still not quite sure how to get it to
>> load things from outside the executable though, because the program isn't
>> installed into C:\Program Files. Most often it's extracted into a folder
>> on the user's desktop, so it needs to be able to generate a filepath. I
>> have been using Dir.getwd to generate a filepath to my main file, and
>> then an argument passed to the filepath method adds folder names onto the
>> end, lol. Would that still work, do you think? Here is my basic structure
>> for the program's directory, say it's in a folder called Ecko (doh). It
>> would look like this, if you outlined it.

>
> Yeah, that's the goal behind David Koontz's stuff in Monkeybars and Rawr.
> I'm pretty sure you can provide your own structure, but he'd probably know
> better. David, you out there?
>
> Alternatively, try #monkeybars on freenode during the week.
>
> - Charlie
>
>


  Réponse avec citation
Vieux 09/06/2008, 11h50   #20
Robert Klemme
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby wishlist

2008/6/8 jzakiya <jzakiya@mail.com>:
> On Jun 8, 5:05 am, Robert Klemme <shortcut...@googlemail.com> wrote:
>> On 08.06.2008 06:00, jzakiya wrote:


>> > I want to set multiple variable to the same value:

>>
>> > n1, n2, n3, n4 = 5

>>
>> Your variable naming indicates that you are probably using the wrong
>> tool: you rather want an Array of values vs. a number of variables. If
>> you do that, life becomes much easier:
>>
>> > and do +=, -=, *=, etc with the same value

>>
>> > n1, n2, n3, n4 += 5

>>
>> ns.map! {|n| n + 5}

>
> The names of the variables are not array values, they
> are just different variable names, they could be any
> names.


The names are irrelevant: the mere fact that you want to treat them
uniformly indicates that it is a bad idea to have them as separate
local variables and not in some type of collection.

> Remember, I would LIKE ruby to be able to do this.
> It is my "whishlist". I know Ruby doesn't do it now,
> but I would like it to be able to in the future. OK! :-)


The question is whether it is *reasonable* to build this into the
language. It does not make sense to put something into the language
to support a) an esoteric case or b) sub optimal design.

Kind regards

robert


--
use.inject do |as, often| as.you_can - without end

  Réponse avec citation
Vieux 09/06/2008, 22h29   #21
David Koontz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?


On Jun 8, 2008, at 3:08 PM, Charles Oliver Nutter wrote:

> AzimuthDragon wrote:
>> Is that so? Sounds cool. So I would be able to package my entire
>> program into a jar, .app or executable? I'm still not quite sure
>> how to get it to load things from outside the executable though,
>> because the program isn't installed into C:\Program Files. Most
>> often it's extracted into a folder on the user's desktop, so it
>> needs to be able to generate a filepath. I have been using
>> Dir.getwd to generate a filepath to my main file, and then an
>> argument passed to the filepath method adds folder names onto the
>> end, lol. Would that still work, do you think? Here is my basic
>> structure for the program's directory, say it's in a folder called
>> Ecko (doh). It would look like this, if you outlined it.

>
> Yeah, that's the goal behind David Koontz's stuff in Monkeybars and
> Rawr. I'm pretty sure you can provide your own structure, but he'd
> probably know better. David, you out there?
>
> Alternatively, try #monkeybars on freenode during the week.
>
> - Charlie
>


Rawr will let you package everything up into a single jar that you can
double click on to launch your app. Inside your program you'll want
to use the get_resource method Rawr provides to find your files inside
your jar (it works outside as well). The nice thing about that is if
you decide to later split out some data portion of your app into its
own jar (which rawr can generate for you as well) you don't have to
change anything. The Java resource lookup system is pretty good, so
as long as the data jar file is loaded on your classpath (which rawr
takes care of for you) it "just works". We can answer more specific
questions over on #monkeybars on Freenode.

David Koontz

  Réponse avec citation
Vieux 10/06/2008, 05h12   #22
AzimuthDragon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: GUI library/framework?

Thanks, David. I will be sure to meet up tomorrow night, I have 2 1/2 hours
to submit many assignments, XD. Anyways, thanks for your time, I look
forward to trying this out over the summer.

--------------------------------------------------
From: "David Koontz" <david@koontzfamily.org>
Sent: Monday, June 09, 2008 2:29 PM
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Subject: Re: GUI library/framework?

>
> On Jun 8, 2008, at 3:08 PM, Charles Oliver Nutter wrote:
>
>> AzimuthDragon wrote:
>>> Is that so? Sounds cool. So I would be able to package my entire
>>> program into a jar, .app or executable? I'm still not quite sure how to
>>> get it to load things from outside the executable though, because the
>>> program isn't installed into C:\Program Files. Most often it's
>>> extracted into a folder on the user's desktop, so it needs to be able
>>> to generate a filepath. I have been using Dir.getwd to generate a
>>> filepath to my main file, and then an argument passed to the filepath
>>> method adds folder names onto the end, lol. Would that still work, do
>>> you think? Here is my basic structure for the program's directory, say
>>> it's in a folder called Ecko (doh). It would look like this, if you
>>> outlined it.

>>
>> Yeah, that's the goal behind David Koontz's stuff in Monkeybars and
>> Rawr. I'm pretty sure you can provide your own structure, but he'd
>> probably know better. David, you out there?
>>
>> Alternatively, try #monkeybars on freenode during the week.
>>
>> - Charlie
>>

>
> Rawr will let you package everything up into a single jar that you can
> double click on to launch your app. Inside your program you'll want to
> use the get_resource method Rawr provides to find your files inside your
> jar (it works outside as well). The nice thing about that is if you
> decide to later split out some data portion of your app into its own jar
> (which rawr can generate for you as well) you don't have to change
> anything. The Java resource lookup system is pretty good, so as long as
> the data jar file is loaded on your classpath (which rawr takes care of
> for you) it "just works". We can answer more specific questions over on
> #monkeybars on Freenode.
>
> David Koontz
>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h21.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,32451 seconds with 30 queries