<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Dropdown Widgets]]></title><description><![CDATA[<p dir="auto"> </p>
<h2><a class="anchor-offset" name="prerequisite"></a>Prerequisite</h2>
<ul>
<li><a href="/topic/66/introduction-to-widgets-with-the-label-widget">Introduction to Widgets with the Label Widget</a></li>
</ul>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="description"></a>Description</h2>
<p dir="auto">Dropdown widgets allow the user to select an item from a list of choices. It is easier to use compared to asking the user to input the choices in a textbox, and it also occupies less screen space compared to adding a button for each choice.</p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="adding-the-dropdown-widget"></a>Adding the Dropdown Widget</h2>
<p dir="auto">You can use this block to add a new dropdown widget:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/62abd0ef-6da3-4c03-9b97-d46175f4be4c.png" width="700" style="filter:drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5))" /></p>
<p dir="auto"> </p>
<h3><a class="anchor-offset" name="parameters"></a>Parameters</h3>
<ul>
<li><strong>Center Position</strong>: The <strong>x</strong> and <strong>y</strong> positions of the center point of the dropdown.</li>
<li><strong>Size</strong>: The <strong>width</strong> and <strong>height</strong> of the dropdown.</li>
<li><strong>List</strong>: To specify the list of choices, you first need to create a new list, and put all the choices in that list. After that, you can specify that list in this block. For example, you can create a list named “gender”, and add 2 items to it: “Boy” and “Girl”. Then in this block, select “gender” after “using list”.</li>
</ul>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/94544c40-6ad0-49c5-9e23-248c2491695e.png" width="800" style="margin-left:40px;border-radius:5px;border:1px solid #29622d" /></p>
<ul>
<li><strong>Widget Name</strong>: The name of this dropdown, so that you can refer to it in other blocks.</li>
</ul>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="when-the-user-selects-an-item-in-the-dropdown"></a>When the user selects an item in the dropdown</h2>
<p dir="auto">When the user makes a selection, our program needs to respond to that. You can attach your code to this hat block:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/0f856e05-16cf-47ba-bf08-c1f44ccdc64b.png" width="400" style="filter:drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5))" /></p>
<p dir="auto">Note that you first need to add the dropdown widget to the stage. After that, you can choose that dropdown’s name from the “Please select” menu in this block.</p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="selected-item-in-the-dropdown"></a>Selected Item in the Dropdown</h2>
<p dir="auto">To find out which item is currently selected in the dropdown, you can use this reporter block:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/47701176-b93f-4297-9466-b844c31d3035.png" width="500" style="filter:drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5))" /></p>
<p dir="auto">Note that you first need to add the dropdown widget to the stage. After that, you can choose that dropdown’s name from the “Please select” menu in this block.</p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="demo"></a>Demo</h2>
<p dir="auto">In this demo, we add a dropdown named “menu1” with 2 choices. Whenever the user changes the selected value, we show that value in an alert window.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/fc124063-28a0-45bc-965c-dcede37ef558.gif" width="1000" style="border-radius:5px;border:1px solid #29622d" /></p>
]]></description><link>https://forum.creaticode.com/topic/163/dropdown-widgets</link><generator>RSS for Node</generator><lastBuildDate>Tue, 12 May 2026 09:42:55 GMT</lastBuildDate><atom:link href="https://forum.creaticode.com/topic/163.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 May 2022 14:29:04 GMT</pubDate><ttl>60</ttl></channel></rss>