changeset 159:c305c5eda7ed

Fix for scrollarea bug.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 14 Oct 2008 08:30:20 +0000
parents 63de2dea08e6
children 9a05ba6735b1
files clients/pychan_demo/gui/scrollarea.xml clients/pychan_demo/pychan_test.py engine/extensions/pychan/widgets.py
diffstat 3 files changed, 39 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/clients/pychan_demo/gui/scrollarea.xml	Tue Oct 14 08:30:20 2008 +0000
@@ -0,0 +1,36 @@
+<Window title="ScrollArea">
+	<Label text="A bullet list in a ScrollArea" />
+	<ScrollArea size="400,200">
+		<VBox>
+			<HBox name="hbox1">
+				<Button text="*"/><Spacer/><Label text="1. Documentation"/>
+			</HBox>
+			<HBox name="hbox2">
+				<Button text="*"/><Spacer/><Label text="2. Documentation"/>
+			</HBox>
+			<HBox name="hbox3">
+				<Button text="*"/><Spacer/><Label text="3. Documentation"/>
+			</HBox>
+			<HBox name="hbox4">
+				<VBox>
+					<HBox name="hbox3_1">
+						<Button text="*"/><Spacer/><Label text="3.1. Documentation"/>
+					</HBox>
+					<HBox name="hbox3_2">
+						<Button text="*"/><Spacer/><Label text="3.2. Documentation"/>
+					</HBox>
+					<HBox name="hbox3_3">
+						<Button text="*"/><Spacer/><Label text="3.3. Documentation"/>
+					</HBox>
+				</VBox>
+			</HBox>
+			<HBox name="hbox5">
+				<Button text="*"/><Spacer/><Label text="1. Documentation"/>
+			</HBox>
+		</VBox>
+	</ScrollArea>
+	<HBox>
+		<Spacer />
+		<Button name="okButton" text="Close"/>
+	</HBox>
+</Window>
\ No newline at end of file
--- a/clients/pychan_demo/pychan_test.py	Tue Oct 14 07:53:05 2008 +0000
+++ b/clients/pychan_demo/pychan_test.py	Tue Oct 14 08:30:20 2008 +0000
@@ -61,9 +61,10 @@
 		
 		self.examples = {
 			'Absolute Positioning' : PyChanExample('gui/absolute.xml'),
+			'All Widgets' : PyChanExample('gui/all_widgets.xml'),
 			'Basic Styling' : StylingExample(),
-			'All Widgets' : PyChanExample('gui/all_widgets.xml'),
 			'Dynamic Widgets' : DynamicExample(),
+			'ScrollArea' : PyChanExample('gui/scrollarea.xml'),
 		}
 		self.demoList = self.gui.findChild(name='demoList')
 		self.demoList.items += self.examples.keys()
--- a/engine/extensions/pychan/widgets.py	Tue Oct 14 07:53:05 2008 +0000
+++ b/engine/extensions/pychan/widgets.py	Tue Oct 14 08:30:20 2008 +0000
@@ -1546,7 +1546,7 @@
 	content = property(_getContent,_setContent)
 
 	def deepApply(self,visitorFunc):
-		if self._content: visitorFunc(self._content)
+		if self._content: self._content.deepApply(visitorFunc)
 		visitorFunc(self)
 
 	def resizeToContent(self,recurse=True):