Help with FXRuby widgets layout

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Help with FXRuby widgets layout

    Hello World,
    I am trying to write a GUI ruby program using FXRuby.
    I am having some difficulties laying out the buttons,
    text fields and other widgets. I have been able to
    place these objects underneath each other, but that's
    not what I want.
    I would like to have a label with an entry field to
    the right of it.
    For example:

    First Name:_______________ Middle Name:______________
    Last Name:________________

    Phones - Office:_________ Home:__________
    Cell:________
    Fax:____________
    Pager:_______________

    button1 button1 Etc.

    I could create all of the above stacked.
    I've been reading the layout manager but can't find
    any example on how to do this.
    Any help will be appreciated.

    Thank you

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software
    [url]http://sitebuilder.yahoo.com[/url]

    Ruby Ruby Guest

  2. Similar Questions and Discussions

    1. Widgets
      I don't understand your question. What problems are you haveing 'with the window that is poped up'? "Rose Roland" <kicker@txucom.net> wrote in...
    2. Disappearing Widgets
      It's hard to know exactly what it looks like, but a client in Hawaii says a site we are testing has a disappearing menu. I have a Spry Horizontal...
    3. spry widgets
      cannot seem to get the validation select to work need to have code as dwcs3 does not do this automatically according to the help notes
    4. Curses::Widgets::Menu Question
      Anyone with experience using this module--the following code fragment is supposed to run a sub after menu item selection is finished. What...
    5. What are the best 'presentational' tools, widgets, language
      Does anyone know what is the best way is to create a highly attractive presentation set of screens for a (large) intranet Internet based business...
  3. #2

    Default Re: Help with FXRuby widgets layout

    Ruby Ruby wrote:
    > I am trying to write a GUI ruby program using FXRuby.
    > I am having some difficulties laying out the buttons,
    > text fields and other widgets. I have been able to
    > place these objects underneath each other, but that's
    > not what I want.
    > I would like to have a label with an entry field to
    > the right of it.
    > For example:
    <snip>

    For this kind of layout you'll usually need to nest layout managers
    inside of each other. It takes some experimentation at first, but after
    some practice it will become more natural to "see" which combinations of
    layout managers are appropriate for a given GUI.

    For the case you're describing, you'll probably work with a collection
    of FXHorizontalFrames stacked on top of each other, perhaps inside an
    FXVerticalFrame:

    stack = FXVerticalFrame.new(parent, ...)
    row1 = FXHorizontalFrame.new(stack, LAYOUT_FILL_X)
    row2 = FXHorizontalFrame.new(stack, LAYOUT_FILL_X)
    row3 = FXHorizontalFrame.new(stack, LAYOUT_FILL_X)
    row4 = FXHorizontalFrame.new(stack, LAYOUT_FILL_X)
    #
    # ... and so on ...
    #

    An FXHorizontalFrame lays out its child widgets from left to right
    (horizontally), so the widgets in 'row1' would be added like this:

    FXLabel.new(row1, "First Name:")
    FXTextField.new(row1, ...)
    FXLabel.new(row1, "Middle Name:")
    FXTextField.new(row1, ...)

    Continuing on down the form,

    FXLabel.new(row2, "Last Name:")
    FXTextField.new(row2, ...)

    FXLabel.new(row3, "Phones - Office:")
    FXTextField.new(row3, ...)
    FXLabel.new(row3, "Home:")
    FXTextField.new(row3, ...)

    and so on.

    Hope this helps,

    Lyle

    Lyle Johnson Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139