<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[alguichan] widget frames</title>
		<link>http://www.allegro.cc/forums/view/606439</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 19 Feb 2011 13:31:53 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In guichan (and hence also in alguichan) there is a concept of frames around a widget. I&#39;m not completely happy with this... </p><p>So, what is a frame? Essentially it&#39;s something drawn <i>around</i> a widget, which is more or less a rectangular area with content. It serves to give the impression of a 3D-effect, like showing the widget somewhat deeper than the rest of the screen. </p><p>There are two problems with this. One is, the frame is <i>outside</i> the widget itself, so it looks strange when widgets are close together. The other is, depending on what you want to see, some widgets should have a frame (like a button or a window), other should not (like a label or a checkbox). Then there are widgets (like listbox) that should have a frame in some places, but not in others. </p><p>Of course each widget can have an individual setting of frame size, so there might be no problem at all. I&#39;m thinking about the defaults however, introducing the concept of a <i>style</i> into alguichan, and that&#39;s where I want to have reasonable defaults that don&#39;t need much tweaking aside from setting values in the style object. </p><p>Is there any need for frames at all? If so, how can I specify which widgets should have a frame (with given size) with only a few numbers in the style object? </p><p>Here&#39;s the usual test program, showing almost all widgets, with all frames 0: <br /><span class="remote-thumbnail"><span class="json">{"name":"603404","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/a\/7a128080f0ca944193e6ddfb51729ad7.jpg","w":645,"h":503,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/a\/7a128080f0ca944193e6ddfb51729ad7"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/7/a/7a128080f0ca944193e6ddfb51729ad7-240.jpg" alt="603404" width="240" height="187" /></span></p><p>And here&#39;s the same with frame size 1 for &#39;buttons&#39; and &#39;areas&#39;: <br /><span class="remote-thumbnail"><span class="json">{"name":"603405","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/8\/d8e86ab9b04b292fb1e91cfba7266061.jpg","w":644,"h":502,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/8\/d8e86ab9b04b292fb1e91cfba7266061"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/d/8/d8e86ab9b04b292fb1e91cfba7266061-240.jpg" alt="603405" width="240" height="187" /></span></p><p>Note that the TextField and the DropDown seems to have a frame in the first image, but that&#39;s a border, like the border of the Button. This border is <i>inside</i> the widget, and it doesn&#39;t look completely consistent, given that most other widgets don&#39;t have a border. </p><p>So next question is, should all widgets (or at least most of them) have a border?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (tobing)</author>
		<pubDate>Fri, 18 Feb 2011 14:30:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Those buttons are nayasty <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" /></p><p>In my quest to skin my gui, I&#39;ve collected a few images of UIs that have a generally nice and unimposing appearance.  I have attached a bunch.</p><p>My latest iteration is drawn using only allegro primitives:<br /><span class="remote-thumbnail"><span class="json">{"name":"603417","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/1\/01584578488c1c70315ff4b9e8bf8244.png","w":495,"h":188,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/1\/01584578488c1c70315ff4b9e8bf8244"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/0/1/01584578488c1c70315ff4b9e8bf8244-240.jpg" alt="603417" width="240" height="91" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 18 Feb 2011 14:49:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m not sure I&#39;d call that pink-and-gold monstrosity &quot;unimposing&quot;...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Fri, 18 Feb 2011 14:50:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You are correct.  <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>In that one, the yellow glow follows the mouse staying along the bottom (clipped with al_clip_whatever) and &quot;pink-and-golds&quot; on hover only.  Like the win button:<br /><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/6/2/62acc56644a8b2e4c79eced8e22da9f2.png" alt="603419" width="177" height="41" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 18 Feb 2011 14:52:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Graphically, yes, things should generally have borders. </p><p>This is how I decided to implement it for my GUI:
</p><ul><li><p>Every widget has an inner clipped rectangle where its contents lie.
</p></li><li><p>By default, that rectangle is full size.
</p></li><li><p>By default, resizing the widget resizes the entire widget (the outer area, regardless of the inner area)
</p></li><li><p>Each cell in the layout manager has a margin. </p></li></ul><p>So I leave it up to the theme manager to decide how to do the border. My included theme has no concept of customizable borders. E.g., the button widget draws its border as part of the inner clipped contents.</p><p>The only widget so far that has a true border is the frame (window) widget. It overloads the resize method and resizes the inner clipped rectangle to the request size. Thus a <span class="source-code">algui_resize<span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_865.html" target="_blank">window</a>, <span class="n">640</span>, <span class="n">480</span><span class="k2">)</span></span> creates a window with an inner width of 640x480. </p><p>For a widget with a border (e.g., a framed window), the theme would set the dimensions of the inner clipped rectangle. Then all of its widgets are drawn accordingly to that rectangle.</p><p>If somebody really wants to add borders to all items without redrawing all of the built-in widgets, my response is simply to create your own <span class="source-code">BORDER_WIDGET</span> container and add things to it. e.g.:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">void</span> add_with_border<span class="k2">(</span><span class="k1">void</span> <span class="k3">*</span>parent, <span class="k1">void</span> <span class="k3">*</span>child, <span class="k1">int</span> width<span class="k2">)</span>
<span class="k2">{</span>
  BORDER_WIDGET <span class="k3">*</span>border <span class="k3">=</span> create_border<span class="k2">(</span>width<span class="k2">)</span><span class="k2">;</span> 
  algui_add<span class="k2">(</span>border, child<span class="k2">)</span><span class="k2">;</span>
  algui_add<span class="k2">(</span>parent, border<span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>

BUTTON <span class="k3">*</span>button <span class="k3">=</span> algui_create_button<span class="k2">(</span><span class="s">"Foo Bar"</span><span class="k2">)</span><span class="k2">;</span>
add_with_border<span class="k2">(</span>desktop, button, <span class="n">2</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
So now you get a border wrapped around your object. Of course if the object already has a border, you&#39;d get a double border. But, again, I consider this something that the theme creator gets to decide.</p><p>Personally, I didn&#39;t want to bother creating widgets with borders that both look good and can be modified, so I hardcoded them into the widget.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 18 Feb 2011 15:16:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Matthew, I&#39;m curious, have you considered menu dropdowns that show outside of the current display, eg <a href="http://www.allegro.cc/files/attachment/603421">this</a>, when a window is at the edge of the screen?  Perhaps as a separate frameless display (though frameless displays are not completely supported across platforms)?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 18 Feb 2011 15:33:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, the theme manager has a &quot;place object&quot; function it can override. By default it simply places the object at x,y on its parent. But it could then draw a shadow outside that on the parent&#39;s canvas. That&#39;s the tentative plan anyway.</p><p>I&#39;m currently using that approach to draw shadows on framed windows.</p><p>Note that I implement both framed windows and pop-up menus as null-rooted components. So they aren&#39;t constrained to the apparent root desktop widget in any way. That is you may have:</p><ul><li><p>display (640,480)
</p><ul><li><p>desktop (320x240 at 0,0)
</p><ul><li><p>button
</p></li></ul></li><li><p>window</p></li></ul></li></ul><p>(Any component can be null-rooted, although most commonly you&#39;d have a desktop widget.)</p><p>Clicking the button creates the window, which is rooted at the display area. Now if that button were sitting on a corner and had a shadow that spilled outside the 320x240 bounds of its desktop, it wouldn&#39;t get drawn due to clipping. (Unless the theme manager cheated, and drew directly to the display buffer.)</p><p>But the window, as it sits outside of the desktop&#39;s constraints, can easily have a shadow drawn outside of its main canvas area without having to &quot;cheat.&quot;
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 18 Feb 2011 15:44:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>But all of this takes place within the application&#39;s window, correct?  I&#39;m asking specifically about dropdowns outside the program&#39;s window itself, inside the OS.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 18 Feb 2011 16:04:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, by &quot;display&quot; in my list above, I mean an <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a></span>. </p><p>You can also create native windows (their own <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a></span>), but on those it&#39;s up to the OS to draw the frame and shadow.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 18 Feb 2011 16:08:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hm.. I don&#39;t follow.  Here&#39;s a <a href="http://www.allegro.cc/files/attachment/603422">picture</a> using a different example.</p><p>In this case, it&#39;s necessary for the dropdown menu to extend beyond the confines of the application-which-contains-the-gui&#39;s window, so it would (theoretically) create a separate ALLEGRO_DISPLAY for the list dropdown.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 18 Feb 2011 16:41:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I wouldn&#39;t bother setting up a separate OS window for drop downs inside an allegro app.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 18 Feb 2011 16:55:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904044#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>I wouldn&#39;t bother setting up a separate OS window for drop downs inside an allegro app.</p></div></div><p>I only ask because in Matthew&#39;s 3rd(?) algui video he shows a dialogue where a native dialogue window still retains as an extension of the underlying algui (a separate display with algui widgets, I&#39;m assuming, as opposed to one of the <a href="http://alleg.sourceforge.net/a5docs/refman/native_dialog.html">native dialogues</a>).  It seems like a &quot;pop-out&quot; dropdown would be a consistent next step.</p><p>[edit] <a href="http://www.youtube.com/watch?v=gFwnsa0CEZ0&amp;feature=related">here</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 18 Feb 2011 17:00:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904045#target">Mark Oates</a> said:</div><div class="quote"><p>It seems like a &quot;pop-out&quot; dropdown would be a consistent next step.</p></div></div><p>But creating a new ALLEGRO_DISPLAY for that is a bit heavy handed. Especially on linux and OpenGL where it has to do a lot of work when creating a new display.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 18 Feb 2011 17:10:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>When I look at it, doing something like a theme (manager) or styles right is more difficult and complicated than I want to deal with now. So I think for me it&#39;s probably best to keep it as simple as possible for the time being. I&#39;ll think about these things though, and continue to make changes here and there. Thanks for all your input and thought!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (tobing)</author>
		<pubDate>Fri, 18 Feb 2011 19:29:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904044#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> I wouldn&#39;t bother setting up a separate OS window for drop downs inside an allegro app.
</p></div></div><p>I don&#39;t. The only time I use a separate OS window is if the user requests one. The point of that video was to show that internally you can treat the widget as if it were drawn by algui. </p><p>Regarding pop-up menus, there could be some problems with clipping. I don&#39;t intend to solve the core one of not being able to draw outside of the <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a></span> area.* I will work around it by moving the dialog up/left such that you can see it. (Just like your OS would do if you tried to pop up a menu near the bottom of the desktop.)</p><p>What I was getting at earlier is that you don&#39;t have to worry about internal clipping issues with popup menus. Say you have:
</p><ul><li><p>a 1280x1024 screen resolution
</p></li><li><p>a 640x480 <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a></span>
</p></li><li><p>a 200x200 algui desktop widget 
</p></li><li><p>a tiny internal algui window of dimensions 100x50.</p></li></ul><p>The window, if owned by the desktop widget, is constrained to the 200x200 area. However, if you click on its menu bar and a menu item pops up, it is not constrained to the 100x50 area. Neither is it constrained to the 200x200 desktop widget, because it gets created as a stand alone component with full access to the 640x480 display. But it cannot draw beyond those constraints.</p><p>So in your screenshot, take the yellow outline and shove it up such that the bottom of it is aligned with the bottom of the cyan outline.</p><p><sub>* Disclaimer: At least, I wouldn&#39;t try to solve it before the first released version.</sub></p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904066#target">tobing</a> said:</div><div class="quote"><p> When I look at it, doing something like a theme (manager) or styles right is more difficult and complicated than I want to deal with now
</p></div></div><p>If you can strike the right balance, it&#39;s not too hard. But I would definitely be sure to have a good plan before starting, because it&#39;s not stuff you want to just hack in. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sat, 19 Feb 2011 00:23:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904026#target">Mark Oates</a> said:</div><div class="quote"><p> My latest iteration is drawn using only allegro primitives: </p></div></div><p>

Could I see the code you used to draw these with Allegro primitives?</p><p>Thanks
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sat, 19 Feb 2011 03:23:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904117#target">Matthew Leverton</a> said:</div><div class="quote"><p>Regarding pop-up menus, there could be some problems with clipping.</p></div></div><p>If you use the border-less flag on a ALLEGRO_DISPLAY, there shouldn&#39;t be any clipping issues, you&#39;d get a top level window with no border or title bar to do with as you see fit.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 19 Feb 2011 03:26:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904147#target">jmasterx</a> said:</div><div class="quote"><p>Could I see the code you used to draw these with Allegro primitives?</p></div></div><p>Sure!</p><p>Here&#39;s the first button (<img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/3/5/35b75cdafad14652b22c9184eaf41851.png" alt="603425" width="113" height="42" />)
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">void</span> ui_button_default_draw<span class="k2">(</span><span class="k1">void</span> <span class="k3">*</span>obj, <span class="k1">void</span> <span class="k3">*</span>user<span class="k2">)</span>
<span class="k2">{</span>
  UIButton <span class="k3">*</span>b <span class="k3">=</span> <span class="k1">static_cast</span><span class="k3">&lt;</span>UIButton <span class="k3">*</span><span class="k3">&gt;</span><span class="k2">(</span>obj<span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/al_draw_filled_rounded_rectangle"><span class="a">al_draw_filled_rounded_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;roundness, b-&gt;roundness, b-&gt;background_color<span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/al_draw_rounded_rectangle"><span class="a">al_draw_rounded_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;roundness, b-&gt;roundness, b-&gt;border_color, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/al_draw_rounded_rectangle"><span class="a">al_draw_rounded_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span><span class="n">1</span>, b-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span><span class="n">1</span>, b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">-</span><span class="n">1</span>, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">-</span><span class="n">1</span>, b-&gt;roundness, b-&gt;roundness, b-&gt;inner_border_color, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/al_draw_filled_rectangle"><span class="a">al_draw_filled_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">3</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span><span class="n">3</span>.<span class="n">5</span>, b-&gt;x<span class="k3">+</span>b-&gt;w-3.5, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">/</span><span class="n">2</span>, b-&gt;hilight_color<span class="k2">)</span><span class="k2">;</span>

  <span class="k1">if</span> <span class="k2">(</span>b-&gt;font<span class="k2">)</span> <a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span>b-&gt;font, b-&gt;text_color,
    b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">/</span><span class="n">2</span><span class="k3">+</span>b-&gt;label_displacement_x, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">/</span><span class="n">2</span><span class="k3">-</span><a href="http://www.allegro.cc/manual/al_get_font_ascent"><span class="a">al_get_font_ascent</span></a><span class="k2">(</span>b-&gt;font<span class="k2">)</span><span class="k3">/</span><span class="n">2</span><span class="k3">+</span>b-&gt;label_displacement_y,
    ALLEGRO_ALIGN_CENTRE, b-&gt;label.c_str<span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>

  <span class="k1">if</span> <span class="k2">(</span>b-&gt;click_in<span class="k2">)</span>
    <a href="http://www.allegro.cc/manual/al_draw_rounded_rectangle"><span class="a">al_draw_rounded_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span><span class="n">1</span>, b-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span><span class="n">1</span>, b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">-</span><span class="n">1</span>, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">-</span><span class="n">1</span>, b-&gt;roundness, b-&gt;roundness, <a href="http://www.allegro.cc/manual/al_color_name"><span class="a">al_color_name</span></a><span class="k2">(</span><span class="s">"yellow"</span><span class="k2">)</span>, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

The last one... uses a bitmap for the glow, apparently (<img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/8/7/87bb2d5d210e3e2dd1e388904b8c3350.png" alt="603426" width="101" height="31" />)
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a> <span class="k3">*</span>button_hilight<span class="k2">;</span>
<span class="number">  2</span><span class="k1">float</span> button_hilight_opacity<span class="k2">;</span>
<span class="number">  3</span><span class="k1">float</span> button_hilight_x<span class="k2">;</span>
<span class="number">  4</span>
<span class="number">  5</span><span class="k1">void</span> ui_glowing_button_draw_func<span class="k2">(</span><span class="k1">void</span> <span class="k3">*</span>obj, <span class="k1">void</span> <span class="k3">*</span>user<span class="k2">)</span>
<span class="number">  6</span><span class="k2">{</span>
<span class="number">  7</span>  UIButton <span class="k3">*</span>b <span class="k3">=</span> <span class="k1">static_cast</span><span class="k3">&lt;</span>UIButton <span class="k3">*</span><span class="k3">&gt;</span><span class="k2">(</span>obj<span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span>  <a href="http://www.allegro.cc/manual/al_draw_filled_rounded_rectangle"><span class="a">al_draw_filled_rounded_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;roundness, b-&gt;roundness, b-&gt;background_color<span class="k2">)</span><span class="k2">;</span>
<span class="number">  9</span>
<span class="number"> 10</span>  <span class="k1">if</span> <span class="k2">(</span>b-&gt;mouse_over<span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>
<span class="number"> 11</span>  <span class="k2">{</span>
<span class="number"> 12</span>    <span class="k1">int</span> x, y, w, h<span class="k2">;</span>
<span class="number"> 13</span>    <a href="http://www.allegro.cc/manual/al_get_clipping_rectangle"><span class="a">al_get_clipping_rectangle</span></a><span class="k2">(</span><span class="k3">&amp;</span>x, <span class="k3">&amp;</span>y, <span class="k3">&amp;</span>w, <span class="k3">&amp;</span>h<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>    <a href="http://www.allegro.cc/manual/al_set_clipping_rectangle"><span class="a">al_set_clipping_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">1</span>, b-&gt;y<span class="k3">+</span><span class="n">1</span>, b-&gt;w-2, b-&gt;h-2<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>    button_hilight_opacity <span class="k3">=</span> <span class="n">0</span>.<span class="n">3</span><span class="k2">;</span>
<span class="number"> 16</span>
<span class="number"> 17</span>    <a href="http://www.allegro.cc/manual/al_set_blender"><span class="a">al_set_blender</span></a><span class="k2">(</span>ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 18</span>
<span class="number"> 19</span>    <a href="http://www.allegro.cc/manual/al_draw_tinted_bitmap"><span class="a">al_draw_tinted_bitmap</span></a><span class="k2">(</span>button_hilight,
<span class="number"> 20</span>      <a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span>button_hilight_opacity, button_hilight_opacity, button_hilight_opacity, button_hilight_opacity<span class="k2">)</span>,
<span class="number"> 21</span>      button_hilight_x-al_get_bitmap_width<span class="k2">(</span>button_hilight<span class="k2">)</span><span class="k3">/</span><span class="n">2</span>, b-&gt;y<span class="k3">+</span>b-&gt;h-al_get_bitmap_height<span class="k2">(</span>button_hilight<span class="k2">)</span>, NULL<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span>
<span class="number"> 23</span>    <a href="http://www.allegro.cc/manual/al_set_blender"><span class="a">al_set_blender</span></a><span class="k2">(</span>ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 24</span>
<span class="number"> 25</span>    <a href="http://www.allegro.cc/manual/al_set_clipping_rectangle"><span class="a">al_set_clipping_rectangle</span></a><span class="k2">(</span>x, y, w, h<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 26</span>  <span class="k2">}</span>
<span class="number"> 27</span>  
<span class="number"> 28</span>  <a href="http://www.allegro.cc/manual/al_draw_rounded_rectangle"><span class="a">al_draw_rounded_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, b-&gt;roundness, b-&gt;roundness, b-&gt;border_color, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 29</span>  <a href="http://www.allegro.cc/manual/al_draw_rounded_rectangle"><span class="a">al_draw_rounded_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span><span class="n">1</span>, b-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span><span class="n">1</span>, b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">-</span><span class="n">1</span>, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">-</span><span class="n">1</span>, b-&gt;roundness, b-&gt;roundness, b-&gt;inner_border_color, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 30</span>
<span class="number"> 31</span>  <a href="http://www.allegro.cc/manual/al_draw_filled_rectangle"><span class="a">al_draw_filled_rectangle</span></a><span class="k2">(</span>b-&gt;x<span class="k3">+</span><span class="n">3</span>.<span class="n">5</span>, b-&gt;y<span class="k3">+</span><span class="n">3</span>.<span class="n">5</span>, b-&gt;x<span class="k3">+</span>b-&gt;w-3.5, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">/</span><span class="n">2</span>, b-&gt;hilight_color<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 32</span>
<span class="number"> 33</span>  <span class="k1">if</span> <span class="k2">(</span>b-&gt;font<span class="k2">)</span> <a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span>b-&gt;font, b-&gt;text_color,
<span class="number"> 34</span>    b-&gt;x<span class="k3">+</span>b-&gt;w<span class="k3">/</span><span class="n">2</span><span class="k3">+</span>b-&gt;label_displacement_x, b-&gt;y<span class="k3">+</span>b-&gt;h<span class="k3">/</span><span class="n">2</span><span class="k3">-</span><a href="http://www.allegro.cc/manual/al_get_font_ascent"><span class="a">al_get_font_ascent</span></a><span class="k2">(</span>b-&gt;font<span class="k2">)</span><span class="k3">/</span><span class="n">2</span><span class="k3">+</span>b-&gt;label_displacement_y,
<span class="number"> 35</span>    ALLEGRO_ALIGN_CENTRE, b-&gt;label.c_str<span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 36</span><span class="k2">}</span>
</div></div><p>

The second button requires a soft gradient, drawn onto a bitmap and overlayed on the button.</p><p>Ahnd, here&#39;s the HSlider (<span class="remote-thumbnail"><span class="json">{"name":"603427","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/9\/f9fdd1ebc28a8b83d87153d536e43690.png","w":248,"h":34,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/9\/f9fdd1ebc28a8b83d87153d536e43690"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/f/9/f9fdd1ebc28a8b83d87153d536e43690-240.jpg" alt="603427" width="240" height="32" /></span>)
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="k1">void</span> ui_hslider_default_draw<span class="k2">(</span><span class="k1">void</span> <span class="k3">*</span>obj, <span class="k1">void</span> <span class="k3">*</span>user<span class="k2">)</span>
<span class="number">  2</span><span class="k2">{</span>
<span class="number">  3</span>  UIHSlider <span class="k3">*</span>slider <span class="k3">=</span> <span class="k1">static_cast</span><span class="k3">&lt;</span>UIHSlider <span class="k3">*</span><span class="k3">&gt;</span><span class="k2">(</span>obj<span class="k2">)</span><span class="k2">;</span>
<span class="number">  4</span>
<span class="number">  5</span>  <a href="http://www.allegro.cc/manual/al_draw_filled_rounded_rectangle"><span class="a">al_draw_filled_rounded_rectangle</span></a><span class="k2">(</span>slider-&gt;x, slider-&gt;y, slider-&gt;x<span class="k3">+</span>slider-&gt;w, slider-&gt;y<span class="k3">+</span>slider-&gt;h,
<span class="number">  6</span>    <span class="n">5</span>, <span class="n">5</span>, <a href="http://www.allegro.cc/manual/al_color_html"><span class="a">al_color_html</span></a><span class="k2">(</span><span class="s">"f9f9f9"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span>  <a href="http://www.allegro.cc/manual/al_draw_rounded_rectangle"><span class="a">al_draw_rounded_rectangle</span></a><span class="k2">(</span>slider-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, slider-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, slider-&gt;x<span class="k3">+</span>slider-&gt;w<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, slider-&gt;y<span class="k3">+</span>slider-&gt;h<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>,
<span class="number">  8</span>    <span class="n">5</span>, <span class="n">5</span>, <a href="http://www.allegro.cc/manual/al_color_html"><span class="a">al_color_html</span></a><span class="k2">(</span><span class="s">"f0f0f0"</span><span class="k2">)</span>, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  9</span>
<span class="number"> 10</span>  <span class="k1">float</span> radius <span class="k3">=</span> <span class="n">6</span>.<span class="n">5</span><span class="k2">;</span>
<span class="number"> 11</span>
<span class="number"> 12</span>  <a href="http://www.allegro.cc/manual/al_draw_filled_rectangle"><span class="a">al_draw_filled_rectangle</span></a><span class="k2">(</span>slider-&gt;x<span class="k3">+</span>slider-&gt;axis_padding, slider-&gt;y<span class="k3">+</span>slider-&gt;h<span class="k3">/</span><span class="n">2</span><span class="k3">-</span><span class="n">2</span>,
<span class="number"> 13</span>    slider-&gt;x<span class="k3">+</span>slider-&gt;w-slider-&gt;axis_padding, slider-&gt;y<span class="k3">+</span>slider-&gt;h<span class="k3">/</span><span class="n">2</span><span class="k3">+</span><span class="n">2</span>,
<span class="number"> 14</span>    <a href="http://www.allegro.cc/manual/al_color_name"><span class="a">al_color_name</span></a><span class="k2">(</span><span class="s">"lightgrey"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>
<span class="number"> 16</span>  <a href="http://www.allegro.cc/manual/al_draw_rectangle"><span class="a">al_draw_rectangle</span></a><span class="k2">(</span>slider-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span>, slider-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span>slider-&gt;h<span class="k3">/</span><span class="n">2</span><span class="k3">-</span><span class="n">2</span>,
<span class="number"> 17</span>    slider-&gt;x<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span>slider-&gt;w, slider-&gt;y<span class="k3">+</span><span class="n">0</span>.<span class="n">5</span><span class="k3">+</span>slider-&gt;h<span class="k3">/</span><span class="n">2</span><span class="k3">+</span><span class="n">2</span>,
<span class="number"> 18</span>    <a href="http://www.allegro.cc/manual/al_color_html"><span class="a">al_color_html</span></a><span class="k2">(</span><span class="s">"f7f7f7"</span><span class="k2">)</span>, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 19</span>
<span class="number"> 20</span>  <span class="k1">float</span> circle_center <span class="k3">=</span> slider-&gt;x<span class="k3">+</span>slider-&gt;axis_padding<span class="k3">+</span><span class="k2">(</span>slider-&gt;w-slider-&gt;axis_padding<span class="k3">*</span><span class="n">2</span><span class="k2">)</span><span class="k3">*</span>slider-&gt;val<span class="k2">;</span>
<span class="number"> 21</span>  <a href="http://www.allegro.cc/manual/al_draw_filled_circle"><span class="a">al_draw_filled_circle</span></a><span class="k2">(</span>circle_center, slider-&gt;y<span class="k3">+</span>slider-&gt;h<span class="k3">/</span><span class="n">2</span>, radius, <a href="http://www.allegro.cc/manual/al_color_html"><span class="a">al_color_html</span></a><span class="k2">(</span><span class="s">"629f4a"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span> <span class="c">//f7f7f7</span>
<span class="number"> 22</span>
<span class="number"> 23</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_COLOR"><span class="a">ALLEGRO_COLOR</span></a> hilight_color <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span><span class="n">0</span>.<span class="n">6</span>, <span class="n">0</span>.<span class="n">6</span>, <span class="n">0</span>.<span class="n">6</span>, <span class="n">0</span>.<span class="n">6</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 24</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_COLOR"><span class="a">ALLEGRO_COLOR</span></a> border_color <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_color_html"><span class="a">al_color_html</span></a><span class="k2">(</span><span class="s">"4e8638"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 25</span>
<span class="number"> 26</span>  <a href="http://www.allegro.cc/manual/al_draw_filled_rectangle"><span class="a">al_draw_filled_rectangle</span></a><span class="k2">(</span>slider-&gt;x<span class="k3">+</span><span class="n">3</span>.<span class="n">5</span>, slider-&gt;y<span class="k3">+</span><span class="n">3</span>.<span class="n">5</span>, slider-&gt;x<span class="k3">+</span>slider-&gt;w-3.5, slider-&gt;y<span class="k3">+</span>slider-&gt;h<span class="k3">/</span><span class="n">2</span>, hilight_color<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 27</span>
<span class="number"> 28</span>  <a href="http://www.allegro.cc/manual/al_draw_circle"><span class="a">al_draw_circle</span></a><span class="k2">(</span>circle_center, slider-&gt;y<span class="k3">+</span>slider-&gt;h<span class="k3">/</span><span class="n">2</span>, radius-1, <a href="http://www.allegro.cc/manual/al_color_html"><span class="a">al_color_html</span></a><span class="k2">(</span><span class="s">"87bf70"</span><span class="k2">)</span>, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 29</span>  <a href="http://www.allegro.cc/manual/al_draw_circle"><span class="a">al_draw_circle</span></a><span class="k2">(</span>circle_center, slider-&gt;y<span class="k3">+</span>slider-&gt;h<span class="k3">/</span><span class="n">2</span>, radius, border_color, <span class="n">1</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 30</span><span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Sat, 19 Feb 2011 04:18:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904149#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> If you use the border-less flag on a ALLEGRO_DISPLAY, there shouldn&#39;t be any clipping issues, you&#39;d get a top level window with no border or title bar to do with as you see fit.
</p></div></div><p>Right. In the part you quoted, I was referring to clipping issues caused by <i>not</i> using a separate <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a></span>. </p><p>@Mark, time to create your own integer based line and rectangle drawing functions. Sure beats adding the +0.5 and trying to remember the rules. <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sat, 19 Feb 2011 05:32:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904171#target">Matthew Leverton</a> said:</div><div class="quote"><p>@Mark, time to create your own integer based line and rectangle drawing functions.</p></div></div><p><span class="remote-thumbnail"><span class="json">{"name":"603429","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/4\/b48fb1dba9a419bec3fa6f55d99bbe7c.png","w":448,"h":104,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/4\/b48fb1dba9a419bec3fa6f55d99bbe7c"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/b/4/b48fb1dba9a419bec3fa6f55d99bbe7c-240.jpg" alt="603429" width="240" height="55" /></span><br />Looks pretty gnarly, doesn&#39;t it? <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Sat, 19 Feb 2011 05:48:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In my GUI there&#39;s only one widget size, the one that the container widgets work with.<br />Each widget has a view which renders it, when you set the size/content of a widget, the preferred size of the widget is decided by the Request_size function of its view.</p><p>How the size is handled by containers vary. I haven&#39;t put margin support in anywhere yet, but I think that should be handled in the containers , not the regular widgets.</p><p>If a widget should have a frame that goes outside its own area, I think I&#39;d create a container with one child that has a view which renders the frame and the child, it would request a size that holds the childs requested size and the frames size. That way I could frame anything from a single widget to a whole sublayout.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trezker)</author>
		<pubDate>Sat, 19 Feb 2011 12:52:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904233#target">Trezker</a> said:</div><div class="quote"><p>I haven&#39;t put margin support in anywhere yet, but I think that should be handled in the containers , not the regular widgets.</p></div></div><p>agreed.</p><p>For me, the widget&#39;s coordinates and width/height are also the bounding boxes for mouse_over mouse_out events.  So if you want padding, move the widget.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Sat, 19 Feb 2011 13:12:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606439/904233#target">Trezker</a> said:</div><div class="quote"><p> That way I could frame anything from a single widget to a whole sublayout.
</p></div></div><p>Other than my framed windows, that&#39;s how my GUI works. (And I may ultimately change framed windows to act the same way.)</p><p>Margins are set by the layout manager. e.g.:
</p><div class="source-code snippet"><div class="inner"><pre>tabs <span class="k3">=</span> algui_create_tab_panel<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
algui_set_tab_panel_margins<span class="k2">(</span>tabs, <span class="n">16</span>, <span class="n">16</span>, <span class="n">16</span>, <span class="n">16</span><span class="k2">)</span><span class="k2">;</span>
algui_add_to_tab_panel<span class="k2">(</span>tabs, <span class="s">"Tab 1"</span>, algui_create_button<span class="k2">(</span><span class="s">"Foo"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
algui_add_to_tab_panel<span class="k2">(</span>tabs, <span class="s">"Tab 2"</span>, algui_create_button<span class="k2">(</span><span class="s">"Bar"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
The tab panel widget is composed of an implicit vbox container with a tab strip on the top and an empty stretched slot in the bottom (for the user&#39;s widget). Setting the tab panel margin actually sets the margin of the bottom slot of its vbox container:
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">// in the tab panel code</span>
algui_set_layout_margins<span class="k2">(</span>this-&gt;vbox, <span class="c">/*index*/</span> <span class="n">1</span>, n, e, s, w<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

The default tab widget draws its own outer border. If you want inner borders, you&#39;d have to create some sort of border frame widget and add things to it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sat, 19 Feb 2011 13:31:53 +0000</pubDate>
	</item>
</rss>
