Layout Manager questions in FxRuby

Hi All,

I posted this earlier but it seems to have been rejected, perhaps because I
and 143kb snapshots WordPad documtment attached. I zipped that document,
so hopefully this post will succeed.

The attached program is an example I got from Hal Fulton's book, or rather,
from his publisher's web site. As the attached WordPad doc. shows with
three images (resulting from running an enhanced version with optional
arguments):

1. The original program presents a window that displays two buttons arrayed
vertically.
2. When an additional button is added, however, a narrower and shorter
window is presented.
3. When the second window is expanded by dragging its border, all three
buttons become fully visible.

This raises the following questions.

1. The default layout manager seems to be FXVerticalFrame. Is that true?
2. The height of the window is appropriate when there are two buttons, but
not when there are three. Why?
3. The width of the window is dictated by width of the last button added.
True?
4. I found some good documentation on Layout Managers at
http://www.eng.cse.dmu.ac.uk/~hgs/ruby/FXRuby/fox-1.0.40/doc/layout.html,
but it didn't answer the foregoing questions. Is there other helpful on-line
documentation for layout managers?

Regards,
Richard

···

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.705 / Virus Database: 461 - Release Date: 6/12/2004

begin 666 Enabling&DisablingBtns.rb
M(R!&.EQ?4')O:F5C='-?0W5R<F5N=%Q?4')O:F5C='-?4G5B>5Q!,#$S8RU%
M;F%B;&EN9R9$:7-A8FQI;F="=&YS#0HC($8Z7%]0<F]J96-T<U]#=7)R96YT
M7%]0<F]J96-T<U]2=6)Y7$$P,3,@+4984G5B>5!G;6EN9UQ4:&52=6)Y5V%Y
M+49U;'1O;BU%>&%M<&QE<UQP,S,V;#8M,3 N<F(-"B,@:'1T<#HO+W=W=RYI
M;F9O<FUI="YC;VTO8V]N=&5N="]I;6%G97,O,#8W,C,R,#@S-2]D;W=N;&]A
M9',O=')W+7-R8RYZ:7 -"@T*55-%7U%5250@(" @/2!!4D=66S!=/3TB,2(@
M(U),33H@(%1O(&%D9" B475I="(@8G5T=&]N( T*55-%7T%,3" @(" @/2!!
M4D=66S%=/3TB,2(@(U),33H@(%1O(&5X<&%N9"!D96-O<F%T:6]N<R!T;R!$
M14-?04Q,#0H-"G)E<75I<F4@(F9O>"(-"G)E<75I<F4@(F9O>"]R97-P;VYD
M97(B#0H-"FEN8VQU9&4@1F]X#0H-"F-L87-S(%1W;T)U='1O;E5P9&%T95=I
M;F1O=R \($9836%I;E=I;F1O=PT*#0H@(&EN8VQU9&4@4F5S<&]N9&5R#0H-
M"B @(R!-97-S86=E(&ED96YT:69I97)S(&9O<B!T:&ES(&-L87-S#0H@($E$
M7U1/1T=,15]"55143TX@/2!&6$UA:6Y7:6YD;W<Z.DE$7TQ!4U0-"@T*("!D
M968@:6YI=&EA;&EZ92AA<' I#0H@(" @(R!);G9O:V4@8F%S92!C;&%S<R!I
M;FET:6%L:7IE(&9I<G-T#0H@(" @(R!23$TZ($%P<&5N9" G+" P+" P+" V
M,# L(#8P,"<@87)G<R!T;R!G970@;&%R9V5R('=I;F1O=PT*(" @(&EF(%53
M15]!3$P-"B @(" @(" @<W5P97(H87!P+" B57!D871E($5X86UP;&4B+"!N
M:6PL(&YI;"P@#0H@(" @(" @(" @(" @($1%0T]27T%,3"D@(" @(" @(" @
M(" @(" @(" @(",@4DQ-.B!!;&QO=R!W:6YD;W<G<R!B;W)D97(@=&\@8F4@
M9')A9V=E9"P@971C+@T*(" @(&5L<V4-"B @(" @(" @<W5P97(H87!P+" B
M57!D871E($5X86UP;&4B+"!N:6PL(&YI;"P@#0H@(" @(" @(" @(" @($1%
M0T]27U1)5$Q%('P@1$5#3U)?0TQ/4T4I(" @(",@4DQ-.B!/<FEG:6YA;"!D
M96-O<F%T:6]N<PT*(" @(&5N9 T*(" @( T*(" @(",@1&5F:6YE('1H92!M
M97-S86=E(&UA<"!F;W(@=&AE(&-L87-S#0H@(" @1EA-05!&54Y#*%-%3%]#
M3TU-04Y$+"!)1%]43T='3$5?0E545$].+" -"B @(" @(" @(" @(" @(F]N
M0V]M;6%N9"(I#0H@(" @1EA-05!&54Y#*%-%3%]54$1!5$4L("!)1%]43T='
M3$5?0E545$].+" -"B @(" @(" @(" @(" @(F]N57!D871E(BD-"@T*(" @
M(",@1FER<W0@8G5T=&]N#0H@(" @0&)U='1O;E]O;F4@/2!&6$)U='1O;BYN
M97<H<V5L9BP@(D5N86)L92!"=71T;VX@,B(L#0H@(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @;FEL+"!S96QF+" -"B @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @("!)1%]43T='3$5?0E545$].*0T*(" @($!B=71T;VY?
M;VYE7V5N86)L960@/2!T<G5E#0H-"B @(" C(%-E8V]N9"!B=71T;VX-"B @
M("! 8G5T=&]N7W1W;R ]($980G5T=&]N+FYE=RAS96QF+" B16YA8FQE($)U
M='1O;B Q(BP@#0H@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @;FEL
M+"!S96QF+" -"B @(" @(" @(" @(" @(" @(" @(" @(" @(" @("!)1%]4
M3T='3$5?0E545$].*0T*(" @(&EF(%5315]154E4#0H@(" @(" @(",@475I
M="!B=71T;VX@+2T@4DQ-.B!A9&1E9" U+C$R+C(P,#0-"B @(" @(" @0&)U
M='1O;E]Q=6ET(#T@1EA"=71T;VXN;F5W*'-E;&8L(")1=6ET(BP@#0H@(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(&YI;"P@<V5L9BP@#0H@
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @($9807!P.CI)1%]1
M54E4*0T*(" @(&5N9 T*#0H@(" @0&)U='1O;E]T=V\N9&ES86)L90T*(" @
M($!B=71T;VY?='=O7V5N86)L960@/2!F86QS90T*("!E;F0-"@T*("!D968@
M;VY#;VUM86YD*'-E;F1E<BP@<V5L+"!P='(I#0H@(" @(R!5<&1A=&4@=&AE
M(&%P<&QI8V%T:6]N('-T871E#0H@(" @0&)U='1O;E]O;F5?96YA8FQE9" ]
M("% 8G5T=&]N7V]N95]E;F%B;&5D#0H@(" @0&)U='1O;E]T=V]?96YA8FQE
M9" ]("% 8G5T=&]N7W1W;U]E;F%B;&5D#0H@(&5N9 T*#0H@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F0N?_R%$5_D[5:?XO:52%CZDB\W^,414^I@KG_SAO5>%6M<\CLOD>\8;H
MOW3+67\3/,&[)[Q4_3=>[@1/\.X5K]^K.$&^/S0L"-ZP<%UXF/XK%L4I3">_
M'K]5;].)L;^FDW_Y?U!+`0(4`!0````(`!>=S3"]PI5E3AL``%<A`@`-````
M``````$`( "V@0````!3;F%P<VAO=',N<G1F4$L%!@`````!``$`.P```'D;
$````````
`
end

The attached program is an example I got from Hal Fulton's book, or rather,
from his publisher's web site. As the attached WordPad doc. shows with
three images (resulting from running an enhanced version with optional
arguments):

1. The original program presents a window that displays two buttons arrayed
vertically.
2. When an additional button is added, however, a narrower and shorter
window is presented.
3. When the second window is expanded by dragging its border, all three
buttons become fully visible.

This raises the following questions.

1. The default layout manager seems to be FXVerticalFrame. Is that true?

You're adding the buttons directly as children of the FXMainWindow; FXMainWindow is just a subclass of FXTopWindow. According to this page from the FOX documentation:

  http://www.fox-toolkit.com/layout.html

the FXTopWindow "acts like an FXPacker window." I think that in your case it appears that it's using a vertical layout because the default layout hints for an FXButton are LAYOUT_SIDE_TOP and LAYOUT_SIDE_LEFT; in other words, unless you explicitly override those defaults, each new button will get "packed" to the top & left corner of the remaining space in the packer's cavity.

2. The height of the window is appropriate when there are two buttons, but
not when there are three. Why?

Actually, the height of the window *is* appropriate when I run it here on my Mac (i.e. under X11). I will have to see if I can reproduce your problem under Windows and try to go from there.

3. The width of the window is dictated by width of the last button added.
True?

No, I'm pretty sure the width of the window is dictated by the width of the widest button.

4. I found some good documentation on Layout Managers at
http://www.eng.cse.dmu.ac.uk/~hgs/ruby/FXRuby/fox-1.0.40/doc/layout.html,
but it didn't answer the foregoing questions. Is there other helpful on-line
documentation for layout managers?

No, not that I know of.

···

On Jun 15, 2004, at 10:28 AM, Richard Lionheart wrote:

OK, I tried it under Windows and I'm seeing the (different) behavior that you reported. Don't know why this doesn't work the same way, but I did find a workaround; just override your main window's create() method and add a line that tells the main window to resize itself to its preferred width and height, i.e.

  class TwoButtonUpdateWindow
    def create
      super
      resize(defaultWidth, defaultHeight)
    end
  end

This gives the desired result for both Windows and X11.

Hope this helps,

Lyle

···

On Jun 15, 2004, at 8:29 PM, Lyle Johnson wrote:

2. The height of the window is appropriate when there are two buttons, but
not when there are three. Why?

Actually, the height of the window *is* appropriate when I run it here on my Mac (i.e. under X11). I will have to see if I can reproduce your problem under Windows and try to go from there.

Hi Lyle,

Thanks very much for your response.

the FXTopWindow "acts like an FXPacker window."
I think that in your case it appears that it's using a
vertical layout because the default layout hints for an
FXButton are LAYOUT_SIDE_TOP and LAYOUT_SIDE_LEFT;

Great explanation! One minor detail: given those two hints, how is it
determined that the 2nd button goes *below* the first. Is it because it
selects the left-most position it can find in the remaining space, and then
the top-most position consistent with that in the remaining space. BTW, I
had read the http://www.fox-toolkit.com/layout.html page, but didn't
understand it as well as I do now with the benefit of your explanation.

Actually, the height of the window *is* appropriate when
I run it here on my Mac (i.e. under X11). I will have to see
if I can reproduce your problem under Windows and
try to go from there.

Kaspar Schiess gave me some guidance which helped me understand my error.
In my initial mod. to Hal Fulton's code, I directed a button to target self
for an FxApp::ID_QUIT event, and self is a object of a classs deriving from
FXMainWindow, which apparently doesn't handle that event, nor does its
super class FXTopWindow.

Furthermore, it appears the FOX differs from MS Windows messaging in that
messages unhandled by a MainWindow object will be passeed to the app.
object.

The code below includes the correction suggested Kaspar's guidance by
targeting getApp() for FxApp::ID_QUIT.

No, I'm pretty sure the width of the window is dictated by the
width of the widest button.

That appears to be true, now that I correct the error which messed things
up.

Again, I thank you for taking the time to offer your expert advice.

Regards,

Richard

P.S. I post to the RubyUsers listserver indirectly through the
comp.lang.ruby newsgroup supported by the news.md.comcast.giganews.com
news-server. This NG mirrors the RubyUsers list. However, when I posted
the question to which your post responds, I never saw my post listed on
the NG. I'm now of the opinion that the NG doesn't allows posts with
attachments. For the benefit of other users on this NG, I've included the
modified and now corrected code below, which includes a reference to the
original code from Hal Fulton.

========= Testing Buttons.rb =================

# Original code:
http://www.informit.com/content/images/0672320835/downloads/trw-src.zip,
p336l6-10

require "fox"
require "fox/responder"

include Fox

class TwoButtonUpdateWindow < FXMainWindow # which derives from TopWindow.
                                                # The TopWindow operates
like an FXPacker window.
  include Responder

  # Message identifiers for this class
  ID_TOGGLE_BUTTON = FXMainWindow::ID_LAST

  def initialize(app)
    # Invoke base class initialize first
    super(app, "Update Example", nil, nil,
          DECOR_TITLE | DECOR_CLOSE) # RLM: Original decorations

    # Define the message map for the class
    FXMAPFUNC(SEL_COMMAND, ID_TOGGLE_BUTTON,
              "onCommand")
    FXMAPFUNC(SEL_UPDATE, ID_TOGGLE_BUTTON,
              "onUpdate")

    # First button
    @button_one = FXButton.new(self, "Enable Button 2",
                               nil, self,
                               ID_TOGGLE_BUTTON)
    @button_one_enabled = true

    # Second button
    @button_two = FXButton.new(self, "Enable Button 1",
                               nil, self,
                               ID_TOGGLE_BUTTON)

    # Initialize the first two buttons
    @button_two.disable
    @button_two_enabled = false

    # Quit button -- RLM: added 5.12.2004
    # Erroneously had "self" instead of "getApp()" below,
    # which I corrected after guidance from Kaspar Schiess
    @button_quit = FXButton.new(self, "Quit",
                               nil, getApp(), FXApp::ID_QUIT)
  end

  def onCommand(sender, sel, ptr)
    # Update the application state
    @button_one_enabled = !@button_one_enabled
    @button_two_enabled = !@button_two_enabled
  end

  def onUpdate(sender, sel, ptr)
    # Update the buttons based on the application state
    @button_one_enabled ?
      @button_one.enable : @button_one.disable
    @button_two_enabled ?
      @button_two.enable : @button_two.disable
  end

end

def run
  application = FXApp.new("UpdateExample",
                          "Sample programs")
  application.init(ARGV)
  main = TwoButtonUpdateWindow.new(application)
  application.create
  main.show(PLACEMENT_SCREEN)
  application.run
end

run

···

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.705 / Virus Database: 461 - Release Date: 6/13/2004

Richard Lionheart wrote:

[...]

P.S. I post to the RubyUsers listserver indirectly through the
comp.lang.ruby newsgroup supported by the news.md.comcast.giganews.com
news-server. This NG mirrors the RubyUsers list. However, when I posted
the question to which your post responds, I never saw my post listed on
the NG.

[For interest only]

My news service uses Giganews (which you mention) but I didn't receive it
and it's not on Google Groups (but Lyle's reply is).

However, your post did appear on Usenet because it was seen by the gateway
and mirrored to the ruby-talk mailing list (with attachments), which is why
Lyle was able to see it.

I'm now of the opinion that the NG doesn't allows posts with attachments.

There must be some other reason that we didn't see it on the NG but these
things happen :frowning:

daz

Hi Daz,

Here's an attempt to reply with a 15-byte attachment. Let's see whether
either of us see it on Giganews.

Regards,
Richard

···

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.705 / Virus Database: 461 - Release Date: 6/13/2004

begin 666 HelloWorld.txt
/2&5L;&\L(%=O<FQD(0T*
`
end

Well Daz,

I guess you're right, attachments per se are not the issue. Still, maybe
size is. Or maybe number of attachments (I had two.) I'll give it another
try when I really have a need to provide an attachment.

Regards,
Richard

···

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.705 / Virus Database: 461 - Release Date: 6/13/2004