[#3109] Is divmod dangerous? — Dave Thomas <Dave@...>

14 messages 2000/06/06

[#3149] Retrieving the hostname and port in net/http — Roland Jesse <jesse@...>

Hi,

12 messages 2000/06/07

[#3222] Ruby coding standard? — Robert Feldt <feldt@...>

16 messages 2000/06/09

[#3277] Re: BUG or something? — Aleksi Niemel<aleksi.niemela@...>

> |I am new to Ruby and this brings up a question I have had

17 messages 2000/06/12
[#3281] Re: BUG or something? — Dave Thomas <Dave@...> 2000/06/12

Aleksi Niemel<aleksi.niemela@cinnober.com> writes:

[#3296] RE: about documentation — Aleksi Niemel<aleksi.niemela@...>

> I want to contribute to the ruby project in my spare time.

15 messages 2000/06/12

[#3407] Waffling between Python and Ruby — "Warren Postma" <embed@...>

I was looking at the Ruby editor/IDE for windows and was disappointed with

19 messages 2000/06/14

[#3410] Exercice: Translate into Ruby :-) — Jilani Khaldi <jilanik@...>

Hi All,

17 messages 2000/06/14

[#3415] Re: Waffling between Python and Ruby — Andrew Hunt <andy@...>

>Static typing..., hmm,...

11 messages 2000/06/14

[#3453] Re: Static Typing( Was: Waffling between Python and Ruby) — Andrew Hunt <andy@...>

32 messages 2000/06/16

[#3516] Deep copy? — Hugh Sasse Staff Elec Eng <hgs@...>

Given that I cannot overload =, how should I go about ensuring a deep

20 messages 2000/06/19

[#3694] Why it's quiet — hal9000@...

We are all busy learning the new language

26 messages 2000/06/29
[#3703] Re: Why it's quiet — "NAKAMURA, Hiroshi" <nahi@...> 2000/06/30

Hi,

[#3705] Re: Why it's quiet — matz@... (Yukihiro Matsumoto) 2000/06/30

Hi,

[ruby-talk:03081] Glade/Ruby: some idea for API

From: Yasushi Shoji <yashi@...>
Date: 2000-06-01 23:37:36 UTC
List: ruby-talk #3081
hi,

I was just thinking about changing API for Glade/ruby last night.
this is more like talking to myself ;) but of cause any comments will
be really appreciated.

methods are:

glade = Glade.new('file_name')

  create new glade object which contain all information the file
  'file_name' has.

glade = Glade.new('file_name', 'base')

  create new glade object which contain all information under an
  object 'base' in file 'file_name'.

glade.include?('obj_name')

  check to see glade has information of object name 'obj_name'

[] = glade.toplevels

  returns array of toplevel object names, which is usually
  Gtk::Window.

base_obj = glade.generate

  create all gtk object which glade has information of.
  # what if glade has more than one toplevel object?
  # should it generate array of objects? or just make it error?

base_obj = glade.generate('base')

  create new gtk object(s) under the object 'base'
  # this is guaranteed to work.

base_obj = glade.generate('signal_handler_{hash,module})

base_obj = glade.generate('base', 'signal_handler_{hash,module}')

  took the idea from [ruby-talk:03001] (thanks Conrad!).  I don't know
  which is better.  module with functions for callback, or Proc object
  hash with function name as the key?

Marshal.dump(glade)

  well, this is not glade API but you can dump glade object.  

glade = Marshal.load(port)

  load dumped glade object. hope it's faster than parsing xml file.

MyClass = glade.new_class('base')

  create new subclass of object 'base'. instance of class 'MyClass'
  will contain all the object which base has.

  if you keep creating and deleting Gtk object, you can define method
  in the subclass rather than defining singleton method to each
  time.



don't know yet how to retrieve an object once you generated with
Glade#generate.

should I add singleton method 'retrieve' to toplevel widget when
generated? so that we can do:

glade = Glade.new('file')
window = glade.generate

l = window.retrieve('label')
l.signal_connect....

or just let Gtk to handle this?

l = window.child.child.child.child.child
l.signal_connect....


regards,
--
              yashi

In This Thread

Prev Next