librelist archives

« back to archive

qt-ruby branch

qt-ruby branch

From:
Steve Klabnik
Date:
2010-08-24 @ 14:16
Hey guys!

I've started working on porting Shoes to qt-ruby, to see what it'd be
like. I've  already stubbed out (what I think is) all of Shoes, and a
few simple examples run.

You can check it out on my branch here:
http://github.com/steveklabnik/shoes/tree/qtruby

Thoughts? I'm going to play with this for about a week to see how hard it'll be.

Re: [shoes] qt-ruby branch

From:
Fela Winkelmolen
Date:
2010-08-25 @ 10:47
I also commited my code to github ( http://github.com/fela/qtshoes )

I think the hardest part will be a good way to combine text (like in
para and title) with items like buttons and images, in the flow
layout. Text behaves differently as it can be split. I thought about
using QTextEdit, which supports images, but there don't seem to be an
easy way to also include buttons and similar widgets.

The most easy way to implement it would be to split the text in single
elements of one word in length (or one character depending on the
wrapping mode). But it's probably not the best and most efficient way.

In general QGraphicsScene/QGraphicsView seems promizing, I've "ported"
the initial example code to it.

On Tue, Aug 24, 2010 at 4:16 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
> Hey guys!
>
> I've started working on porting Shoes to qt-ruby, to see what it'd be
> like. I've  already stubbed out (what I think is) all of Shoes, and a
> few simple examples run.
>
> You can check it out on my branch here:
> http://github.com/steveklabnik/shoes/tree/qtruby
>
> Thoughts? I'm going to play with this for about a week to see how hard it'll be.
>

Re: [shoes] qt-ruby branch

From:
Zachary Scott
Date:
2010-08-25 @ 16:42
Just thought I'd move this from the other thread Steve. That was not the
appropriate thread to add my opinion on qt, hence the (unrelated).

>> (Unrelated) While I'm not against shoes being in qt, I'm not sure it
makes
>> sense for shoes to rely on software licensed by a cell phone maker.

> Why would that matter?

To answer your question, it doesn't, really. In fact nokia is a pretty
decent company from what I gather (I remember using a 770 before, which came
with a variation of debian :) ). Qt is fortunately LGPL'd and even offers a
commercial licensing option.

I guess what I'm trying to say is that my gut tells me not to trust cell
phone companies, they're constantly being bought out and sold or traded. Who
knows what the future of Nokia is, let alone Qt.

That's something to consider at least.


On Wed, Aug 25, 2010 at 6:47 AM, Fela Winkelmolen <fela.kde@gmail.com>wrote:

> I also commited my code to github ( http://github.com/fela/qtshoes )
>
> I think the hardest part will be a good way to combine text (like in
> para and title) with items like buttons and images, in the flow
> layout. Text behaves differently as it can be split. I thought about
> using QTextEdit, which supports images, but there don't seem to be an
> easy way to also include buttons and similar widgets.
>
> The most easy way to implement it would be to split the text in single
> elements of one word in length (or one character depending on the
> wrapping mode). But it's probably not the best and most efficient way.
>
> In general QGraphicsScene/QGraphicsView seems promizing, I've "ported"
> the initial example code to it.
>
> On Tue, Aug 24, 2010 at 4:16 PM, Steve Klabnik <steve@steveklabnik.com>
> wrote:
> > Hey guys!
> >
> > I've started working on porting Shoes to qt-ruby, to see what it'd be
> > like. I've  already stubbed out (what I think is) all of Shoes, and a
> > few simple examples run.
> >
> > You can check it out on my branch here:
> > http://github.com/steveklabnik/shoes/tree/qtruby
> >
> > Thoughts? I'm going to play with this for about a week to see how hard
> it'll be.
> >
>



-- 
Zachary Scott

Re: [shoes] qt-ruby branch

From:
Steve Klabnik
Date:
2010-08-25 @ 17:25
Gotcha. I hate cell phone companies too, but QT isn't going anywhere.
It's just about as stable of a project as you can have.

Re: [shoes] qt-ruby branch

From:
ashbb
Date:
2010-08-24 @ 14:35
Same post.
I thought it's better to replay here again. ;-)

ashbb

--------------------------
Hi Steve, Fela and folks,

Awesome!

Look at this: http://www.rin-shun.com/tmp/Qt_Shoes_snapshot.png

I just did the following.

- gem install qtbindings
- git clone git://github.com/steveklabnik/shoes.git
- git checkout qtruby
- ruby test1.rb
- then got the above snapshot!

  # test1.rb
  require './lib/shoes'

  Shoes.app :height => 250, :width => 200 do
    button 'push me' do
      alert 'Qt met Shoes!'
    end
  end

Your QtShoes worked with ruby 1.9.1 mingw32 on my Windows 7 32bit laptop!

ashbb

Re: [shoes] qt-ruby branch

From:
Vojtěch Šalbaba
Date:
2010-08-24 @ 14:39
please, check the thread support. I switched to shoes from qtruby because of
it. One year back, native QT threads + ruby green threads (or whatever it
is) equaled no threads.
regards
  Vojtěch Šalbaba



2010/8/24 Steve Klabnik <steve@steveklabnik.com>

> Hey guys!
>
> I've started working on porting Shoes to qt-ruby, to see what it'd be
> like. I've  already stubbed out (what I think is) all of Shoes, and a
> few simple examples run.
>
> You can check it out on my branch here:
> http://github.com/steveklabnik/shoes/tree/qtruby
>
> Thoughts? I'm going to play with this for about a week to see how hard
> it'll be.
>

Re: [shoes] qt-ruby branch

From:
Steve Klabnik
Date:
2010-08-24 @ 14:59
I will, but Ruby 1.9.2 has native threads, so even if QT doesn't
support them directly, I don't see why we couldn't just use Ruby's.

Re: [shoes] qt-ruby branch

From:
Martin DeMello
Date:
2010-08-24 @ 15:11
On Tue, Aug 24, 2010 at 7:46 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
> Hey guys!
>
> I've started working on porting Shoes to qt-ruby, to see what it'd be
> like. I've  already stubbed out (what I think is) all of Shoes, and a
> few simple examples run.
>
> You can check it out on my branch here:
> http://github.com/steveklabnik/shoes/tree/qtruby

martin@mercury (qtruby) ~/code/shoes
$ rake
(in /home/martin/code/shoes)
Missing manifest. You can build one with 'rake manifest'.

$ rake manifest
(in /home/martin/code/shoes)
rake aborted!
Malformed version number string 4.0.0-pre
/home/martin/code/shoes/Rakefile:5:in `new'
(See full trace by running task with --trace)

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

martin

Re: [shoes] qt-ruby branch

From:
Steve Klabnik
Date:
2010-08-24 @ 15:13
Yeah, I didn't try building the actual gem yet. Sorry. Just run "ruby
test.rb" to try it out.

Re: [shoes] qt-ruby branch

From:
Martin DeMello
Date:
2010-08-24 @ 15:44
No joy:

$ ruby test.rb
/home/martin/tmp/shoes/lib/shoes/app.rb:326:in `throw': uncaught throw
Shoes::NotImplementedError (ArgumentError)
	from /home/martin/tmp/shoes/lib/shoes/app.rb:326:in `background'
	from test.rb:44:in `block in <main>'
	from /home/martin/tmp/shoes/lib/shoes/app.rb:17:in `instance_eval'
	from /home/martin/tmp/shoes/lib/shoes/app.rb:17:in `initialize'
	from /home/martin/tmp/shoes/lib/shoes.rb:49:in `new'
	from /home/martin/tmp/shoes/lib/shoes.rb:49:in `app'
	from test.rb:43:in `<main>'

martin

On Tue, Aug 24, 2010 at 8:43 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
> Yeah, I didn't try building the actual gem yet. Sorry. Just run "ruby
> test.rb" to try it out.
>

Re: [shoes] qt-ruby branch

From:
Steve Klabnik
Date:
2010-08-24 @ 15:50
Sorry. I updated test.rb in the latest version. The only things that
don't throw NotImplementedErrors are alert, ask, and button.

So if this was your test.rb, (like it was a few commits ago...)

> require './lib/shoes'
>
> Shoes.app do
> 	button "Try Me!" do
> 		name = ask("What is your name?")
> 		alert("Hello, #{name}!")
> 	end
> end

it works.

Right now, test.rb is the 'calculator.rb' example, and I'll be working
on filling out the methods to get it work tonight.

This branch is extremely minimal right now, I started with Fela's gist
at like 8pm last night, went to bed at 2, woke up at 8, and put in two
hours before work. 95% of Shoes is just stubbed, and will get you the
same NotImplementedErrror.

Re: [shoes] qt-ruby branch

From:
Martin DeMello
Date:
2010-08-24 @ 15:54
Okay, great :) Looking forward to playing with this!

martin

On Tue, Aug 24, 2010 at 9:20 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
> Sorry. I updated test.rb in the latest version. The only things that
> don't throw NotImplementedErrors are alert, ask, and button.
>
> So if this was your test.rb, (like it was a few commits ago...)
>
>> require './lib/shoes'
>>
>> Shoes.app do
>>       button "Try Me!" do
>>               name = ask("What is your name?")
>>               alert("Hello, #{name}!")
>>       end
>> end
>
> it works.
>
> Right now, test.rb is the 'calculator.rb' example, and I'll be working
> on filling out the methods to get it work tonight.
>
> This branch is extremely minimal right now, I started with Fela's gist
> at like 8pm last night, went to bed at 2, woke up at 8, and put in two
> hours before work. 95% of Shoes is just stubbed, and will get you the
> same NotImplementedErrror.
>

Re: [shoes] qt-ruby branch

From:
Steve Klabnik
Date:
2010-08-24 @ 16:05
I should mention that the only thing I'm not sure about with this
branch is how to do the whole 'blocks don't modify self' bit:
http://shoes.heroku.com/manual/Rules.html

Gotta investigate that.

Re: [shoes] qt-ruby branch

From:
Cecil Coupe
Date:
2010-08-25 @ 06:28
On Tue, 2010-08-24 at 12:05 -0400, Steve Klabnik wrote:
> I should mention that the only thing I'm not sure about with this
> branch is how to do the whole 'blocks don't modify self' bit:
> http://shoes.heroku.com/manual/Rules.html
> 
> Gotta investigate that.

I think that page will be key to getting it working along with some
tedious grind and test. It really is the foundation of Shoes, redefines
self and catching events to be forwarded to slots. My head swims in
contradictions every time I read that page. 

Re: [shoes] qt-ruby branch

From:
Devyn Cairns
Date:
2010-08-25 @ 03:23
Shoes.app creates a new Shoes app and 'instance_eval's the block in its
context.

The rest of the blocks are just invoked normally, through 'yield' or #call.

<Shoes Object>#app does something like @app.instance_eval &blk

Is that good, or did I miss something?

On Tue, Aug 24, 2010 at 9:05 AM, Steve Klabnik <steve@steveklabnik.com>wrote:

> I should mention that the only thing I'm not sure about with this
> branch is how to do the whole 'blocks don't modify self' bit:
> http://shoes.heroku.com/manual/Rules.html
>
> Gotta investigate that.
>



-- 
    ~devyn

Re: [shoes] qt-ruby branch

From:
Steve Klabnik
Date:
2010-08-24 @ 15:14
I made that manifest, by the way, because I think that qtshoes could
be distributed as a gem, and we could use a separate shoes-packager
gem to actually package up shoes apps. Someone mentioned that in the
long thread, and I think it's a great idea.