Fun with FX ruby.... 
Author Message
 Fun with FX ruby....

I'm want to dynamicly add.delete rows to a table using
FX ruby, but I'm running into some difficulty.

In My dialog I have a connect for when I click an item
in my table

which runs this method (It looks in Col 4 for the
"add" button, adds a row, and changes the button to
delete. If it's delete, the delete the row)

   def push(sender, sel, ptr)
    x = ptr.col
    y = ptr.row
    return if y == 0

    if x == 4


        FXTable::ID_INSERT_ROW







        puts "DELETE"
        FXTable::ID_DELETE_ROW
      end
    end
  end

I'm sure I'm using FXTable::ID_INSERT_ROW and
FXTable::ID_DELETE_ROW incorrectly, how do you use it
correctly? How do you delete the row you are currently
 clicking on?

-Mark.

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://www.*-*-*.com/



Wed, 20 Apr 2005 06:15:33 GMT  
 Fun with FX ruby....
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

| I'm want to dynamicly add.delete rows to a table using
| FX ruby, but I'm running into some difficulty.
|
| In My dialog I have a connect for when I click an item
| in my table
|

|
| which runs this method (It looks in Col 4 for the
| "add" button, adds a row, and changes the button to
| delete. If it's delete, the delete the row)

<snip>

| I'm sure I'm using FXTable::ID_INSERT_ROW and
| FXTable::ID_DELETE_ROW incorrectly, how do you use it
| correctly? How do you delete the row you are currently
|  clicking on?

FXTable::ID_INSERT_ROW and FXTable::ID_DELETE_ROW are just constants
used as message identifiers -- they aren't themselves methods that you
can call directly. The most straightforward way for you to do this from
Ruby code is to just call the insertRows() or removeRows() methods
directly on the FXTable:

~    def push(theTable, sel, currentPos)
~      row = ptr.row
~      col = ptr.col
~      return if row == 0

~      if col == 4











~        end
~      end
~    end

Hope this helps,

Lyle
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE9xrABRy8FwLkdsRcRAvL/AJ92opPMBqJVfPufgRQpnQ0KZ1WY9ACfdyuH
gxGEeS3H3oTvR35jopJmXk0=
=22IQ
-----END PGP SIGNATURE-----



Sat, 23 Apr 2005 01:36:01 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. count bits, fun fun fun.

2. FX RUBY Dialog print

3. Drag and Drop example for FX/Ruby?

4. Yet another FX/Ruby question

5. FX/Ruby status line

6. Does FX/Ruby have some standard icons?

7. Core dumps with FX/Ruby tables

8. Novice needs help with FX Ruby

9. Problems installing FX/Ruby

10. Something fun -- but not Ruby

11. enough about Python -- here's something fun in Ruby :-)

12. fun with voicemodems, dtmf, soundcards &ruby

 

 
Powered by phpBB® Forum Software