Results 1 to 3 of 3

Thread: Glade + Ruby

  1. #1
    Join Date
    Apr 2005
    Location
    Louisiana (USA)
    Beans
    162

    Glade + Ruby

    I am just learning GTK GUI design with glade, and I knwo a little Ruby from Rails, so I am going to attempt a board game as my first project to learn this with.

    MY first, and hopefully simple, question, is if I have a widget (image2), and I want to relocate that image when a button is click (change x from 100 to 50), how is it done? I've tried guessing with random @glade.get_widget("image2").everything and can not seem to get it to work =/

    Any help is appreciated!

  2. #2
    Join Date
    Apr 2005
    Location
    Louisiana (USA)
    Beans
    162

    Re: Glade + Ruby

    If it helps, the code can be found here:
    https://sourceforge.net/projects/gameoftrace/



    I'd like the show button to simply give the flag image a new x,y coordinate set.



  3. #3
    Join Date
    Apr 2005
    Location
    Louisiana (USA)
    Beans
    162

    Re: Glade + Ruby

    After more hours of Googling, I realize I must have been searching for the wrong thing.

    The image must be in a GTK::Layout (?).

    The test function I used, that worked:
    Code:
      def test_relocate(widget)
        @playericon = @glade.get_widget("image2")
        @glade["layout1"].move(@playericon, 5, 5)
      end

    I hope this can end up helping someone!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •