From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.86.59.13 with SMTP id h13cs54656fga; Mon, 22 Feb 2010 07:42:45 -0800 (PST) Received: by 10.224.66.129 with SMTP id n1mr6137362qai.220.1266853363059; Mon, 22 Feb 2010 07:42:43 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 26si10310155qwa.22.2010.02.22.07.42.40; Mon, 22 Feb 2010 07:42:40 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 00F4A185830B; Mon, 22 Feb 2010 10:42:39 -0500 (EST) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by rubyforge.org (Postfix) with ESMTP id 8122718582E3 for ; Mon, 22 Feb 2010 10:42:26 -0500 (EST) Received: by qw-out-2122.google.com with SMTP id 8so415473qwh.29 for ; Mon, 22 Feb 2010 07:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=SxXB+wRpcvawfYd2JAKqSq2Sp1TS9KL7cHlE4byocUg=; b=moYZRYbQIngH0CfiK7AYt5VN1GKByPVubtMavbiOhSz1lD7h6kH//bRvk6W4VDYPof W40MrVxdr3rVk8Miy2xgKJ99RSqysywI9MNtrJCfHMhPE9eFu5c7zkt1zQoJyo0CQTb+ /DJue5+pqGkOIM3aFa5qqH2CfL0ENiId4nqFQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=rTxjSbrYYkHn6I6/kChQSu3olbVwmXmh2kkv+pN/u+Zu1Yc3YE+sJhl/8WinFUpTo9 ooaH7aB4Ct4D4BRvESJIVZVSm/dPT7oSDKcX+8uxk9nFYN0acjAsRjzDSu2Y4o7P2VHw vnfy2VsbBVjR2NAJbXMZww1xST0DncM6XHtss= MIME-Version: 1.0 Received: by 10.229.128.82 with SMTP id j18mr1740811qcs.61.1266853346180; Mon, 22 Feb 2010 07:42:26 -0800 (PST) In-Reply-To: References: <1255292940-sup-5558@masanjin.net> <1255611057-sup-1320@masanjin.net> <1255620005-sup-7616@masanjin.net> From: Dan Falcone Date: Mon, 22 Feb 2010 10:41:46 -0500 Message-ID: To: William Morgan Cc: sup-talk Subject: Re: [sup-talk] curses exception X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0904798723==" Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org --===============0904798723== Content-Type: multipart/alternative; boundary=001517570a8eae7fb204803247d6 --001517570a8eae7fb204803247d6 Content-Type: text/plain; charset=ISO-8859-1 Just checking on this... On Fri, Jan 15, 2010 at 2:49 PM, Dan Falcone wrote: > Hi William, > > Sorry I didn't get back to you sooner. I finally got back around to > playing with this again. Here are the answers to your questions: > > >gem list --local | grep curse > ncurses (0.9.1) > > The test script prints: > true > > The ncurses examples all seem to work and display color. I did have to > edit them to add require 'rubygems' at the top. > > I also tried playing with the sup code a bit. If I comment out lines 133-4 > in lib/sup/colormap.rb: > > # Curses.init_pair id, fg, bg or raise ArgumentError, > # "couldn't initialize curses color pair #{fg}, #{bg} (key #{id})" > > sup loads, but everything is in black and white and a bit difficult to > read. I also tried uncommenting that, then changing Curses to Ncurses so it > looks like this: > > Nurses.init_pair id, fg, bg or raise ArgumentError, > "couldn't initialize curses color pair #{fg}, #{bg} (key #{id})" > > sup loads with that as well, and displays some color, but most of the > screen is unreadable (I'm guessing it's displaying as white text on white > background). > > Any ideas? I tried changing more things from Curses to Ncurses, but that > quickly started generating method undefined errors. > > Thanks! > Dan > > > > On Thu, Oct 15, 2009 at 11:27 AM, William Morgan > wrote: > >> Reformatted excerpts from Dan Falcone's message of 2009-10-15: >> > Hmm... good question. I regularly use emacs with colors enabled, but >> > I'm not sure if that uses curses. I tried typespeed and that seemed >> > to work. According to its man page, it uses curses. >> >> Hm. What version of the ncurses gem do you have? (gem list --local >> should tell you.) >> >> What does this program print? >> >> require 'rubygems' >> require 'ncurses' >> >> x = begin >> Ncurses::initscr(); >> Ncurses::has_colors?() >> ensure >> Ncurses::endwin(); >> end >> >> puts x >> >> If it prints true, then, if you look in the contents of the gem >> (wherever that is on your system), there should be an examples/ >> directory. If you run examples/tlock.rb or examples/rain.rb, (probably >> with ruby -rubygems), do you see color? >> -- >> William >> _______________________________________________ >> sup-talk mailing list >> sup-talk@rubyforge.org >> http://rubyforge.org/mailman/listinfo/sup-talk >> > > --001517570a8eae7fb204803247d6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Just checking on this...

On Fri, Jan 15, = 2010 at 2:49 PM, Dan Falcone <danfalcone@gmail.com> wrote:
Hi William,

Sorry I didn't get back to you sooner.=A0 I finally = got back around to playing with this again.=A0 Here are the answers to your= questions:

>gem list --local | grep curse
ncurses (0.9.1)

The test script prints:
true

The ncurses examples all seem to wor= k and display color.=A0 I did have to edit them to add require 'rubygem= s' at the top.=A0

I also tried playing with the sup code a bit.= =A0 If I comment out lines 133-4 in lib/sup/colormap.rb:

#=A0=A0=A0=A0=A0 Curses.init_pair id, fg, bg or raise ArgumentError,#=A0=A0=A0=A0=A0=A0 "couldn't initialize curses color pair #{fg},= #{bg} (key #{id})"

sup loads, but everything is in black and w= hite and a bit difficult to read.=A0 I also tried uncommenting that, then c= hanging Curses to Ncurses so it looks like this:

=A0=A0=A0=A0=A0 Nurses.init_pair id, fg, bg or raise ArgumentError,
= =A0=A0=A0=A0=A0=A0 "couldn't initialize curses color pair #{fg}, #= {bg} (key #{id})"

sup loads with that as well, and displays som= e color, but most of the screen is unreadable (I'm guessing it's di= splaying as white text on white background).=A0

Any ideas?=A0 I tried changing more things from Curses to Ncurses, but = that quickly started generating method undefined errors.=A0

Thanks!=
Dan


On Thu, Oct 15, 2009 at 11:27 AM, William Mo= rgan <wmorgan-sup@masanjin.net> wrote:
Reformatted excer= pts from Dan Falcone's message of 2009-10-15:
> Hmm... good question. =A0I regularly use emacs with colors enable= d, but
> I'm not sure if that uses curses. =A0I tried typespeed and that se= emed
> to work. =A0According to its man page, it uses curses.

Hm. What version of the ncurses gem do you have? (gem list --local should tell you.)

What does this program print?

=A0require 'rubygems'
=A0require 'ncurses'

=A0x =3D begin
=A0 =A0Ncurses::initscr();
=A0 =A0Ncurses::has_colors?()
=A0ensure
=A0 =A0Ncurses::endwin();
=A0end

=A0puts x

If it prints true, then, if you look in the contents of the gem
(wherever that is on your system), there should be an examples/
directory. If you run examples/tlock.rb or examples/rain.rb, (probably
with ruby -rubygems), do you see color?
--
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyfo= rge.org
http://rubyforge.org/mailman/listinfo/sup-talk


--001517570a8eae7fb204803247d6-- --===============0904798723== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk --===============0904798723==--