<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Recent Posts in 'Problem with understanding the PhotoView class' | Pragmatic Forums</title>
    <link>https://forums.pragprog.com/forums/53/topics/210</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <description></description>
    <item>
      <title>Problem with understanding the PhotoView class posted by Thomas Wieczorek @ Sat, 12 Jan 2008 10:46:08 -0000</title>
      <description>&lt;p&gt;It&amp;#8217;s a great book and I like how you go through the iterations.&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;IMHO&lt;/span&gt; it is more readable, when I add &lt;code&gt;self&lt;/code&gt; to attributes which belong to the current class. I learned the hard way in Java that it is not much more to write to add &lt;code&gt;this&lt;/code&gt;, but it keeps the code clearer for later reviews.&lt;/p&gt;</description>
      <pubDate>Sat, 12 Jan 2008 10:46:08 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:53:210:2160</guid>
      <author>Thomas Wieczorek</author>
      <link>https://forums.pragprog.com/forums/53/topics/210</link>
    </item>
    <item>
      <title>Problem with understanding the PhotoView class posted by Lyle Johnson @ Fri, 11 Jan 2008 22:38:16 -0000</title>
      <description>&lt;p&gt;Thomas, you are a fast reader! Glad you figured it out on your own, but I&amp;#8217;ll make a note to myself that that could be clearer in the book&amp;#8217;s discussion of the code.&lt;/p&gt;</description>
      <pubDate>Fri, 11 Jan 2008 22:38:16 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:53:210:2157</guid>
      <author>Lyle Johnson</author>
      <link>https://forums.pragprog.com/forums/53/topics/210</link>
    </item>
    <item>
      <title>Problem with understanding the PhotoView class posted by Thomas Wieczorek @ Fri, 11 Jan 2008 18:09:59 -0000</title>
      <description>&lt;p&gt;All right, I get it!&lt;br /&gt;&lt;code&gt;app&lt;/code&gt; is an instance variable of the superclass. You could also write &lt;code&gt;self.app&lt;/code&gt; instead.&lt;/p&gt;


	&lt;p&gt;Sorry for the ruckus&lt;/p&gt;</description>
      <pubDate>Fri, 11 Jan 2008 18:09:59 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:53:210:2154</guid>
      <author>Thomas Wieczorek</author>
      <link>https://forums.pragprog.com/forums/53/topics/210</link>
    </item>
    <item>
      <title>Problem with understanding the PhotoView class posted by Thomas Wieczorek @ Fri, 11 Jan 2008 17:49:47 -0000</title>
      <description>&lt;p&gt;I finished the third chapter and I am right now starting the fourth, but I don&amp;#8217;t get one thing. Where does the PhotoView class gets its knowlegde of the &lt;code&gt;app&lt;/code&gt; instance(page 33, pdf)?&lt;br /&gt;Here&amp;#8217;s the code:&lt;br /&gt;&lt;pre&gt;
class PhotoView &amp;lt; FXImageFrame

    def initialize(p, photo)
        super(p, nil)
        load_image(photo.path)
    end

    def load_image(path)    
        File.open(path, "rb") do |file|
            # I don't get it why "app" works!
            self.image = FXJPGImage.new(app, file.read)
        end
    end
end
&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;app&lt;/code&gt; is only defined in the PictureBook class. How come that it works?&lt;/p&gt;</description>
      <pubDate>Fri, 11 Jan 2008 17:49:47 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:53:210:2153</guid>
      <author>Thomas Wieczorek</author>
      <link>https://forums.pragprog.com/forums/53/topics/210</link>
    </item>
  </channel>
</rss>
