﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.4%2FDoc%2FHow_to%2FAdd_a_Pulldown_Menu</id>
	<title>Dev:2.4/Doc/How to/Add a Pulldown Menu - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.4%2FDoc%2FHow_to%2FAdd_a_Pulldown_Menu"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/How_to/Add_a_Pulldown_Menu&amp;action=history"/>
	<updated>2026-06-02T07:49:15Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/How_to/Add_a_Pulldown_Menu&amp;diff=56278&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/How_to/Add_a_Pulldown_Menu&amp;diff=56278&amp;oldid=prev"/>
		<updated>2018-06-28T17:52:26Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 17:52時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/How_to/Add_a_Pulldown_Menu&amp;diff=56277&amp;oldid=prev</id>
		<title>wiki&gt;Mindrones bot: Bot: Fixing redirects; cosmetic changes</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/How_to/Add_a_Pulldown_Menu&amp;diff=56277&amp;oldid=prev"/>
		<updated>2011-06-19T17:13:33Z</updated>

		<summary type="html">&lt;p&gt;Bot: Fixing redirects; cosmetic changes&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[File:BlenderDev-AddingAMenu-overview.png |right|thumb|200px|Adapted Window Header]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a Pulldown Menu ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you have finished the first tutorial (&amp;quot;[[Dev:2.4/Doc/How to/Add a Space|Adding A New Space Window]]&amp;quot;) successfully you are ready to add some stuff to the window header. This tutorial shall explain how to create a Pull-down menu and how to bind the selection events to your code. We will start reusing the source code we created for the new window space (especially header_demo.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Adding the Menu Title ===&lt;br /&gt;
&lt;br /&gt;
Edit ''demo_buttons()'' in file ''src/header_demo.c'' as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
	xco += XIC + 14;&lt;br /&gt;
&lt;br /&gt;
	/* draw pulldown menu */&lt;br /&gt;
	xmax= GetButStringLength(&amp;quot;Pulldown&amp;quot;);&lt;br /&gt;
	uiDefPulldownBut(block, draw_pulldownmenu, NULL, &amp;quot;Pulldown&amp;quot;, &lt;br /&gt;
						xco, -2, xmax-3, 24, &amp;quot;&amp;quot;);&lt;br /&gt;
	xco+= xmax;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we want to do is to create a Pull-down menu with the title &amp;quot;Pulldown&amp;quot;. In case we want to create addition header items we need to keep track of the distance of the next possible header item. This is done by requesting the string length of the menu title and adding the result to ''xco''. &lt;br /&gt;
The menu is created by the call ''uiDefPulldownBut()''. UI elements are contained in ''uiBlock''s. Each element in the ''uiBlock'' may contain new UI elements which are defined in new ''uiBlock''s. In case of the Pull-down menu a list of buttons will be drawn if the menu is selected. &lt;br /&gt;
Therefore a callback function ''draw_pulldownmenu()'' has to be added to ''src/header_demo.c'' which creates the lists of buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Adding the Item List ===&lt;br /&gt;
&lt;br /&gt;
Add the following code to ''src/header_demo.c'', before the definition of ''demo_buttons()'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
static uiBlock *draw_pulldownmenu(void *arg_unused)&lt;br /&gt;
{&lt;br /&gt;
	uiBlock *block;&lt;br /&gt;
	short yco= 0, menuwidth=120;&lt;br /&gt;
&lt;br /&gt;
	block= uiNewBlock(&amp;amp;curarea-&amp;gt;uiblocks, &amp;quot;draw_pulldownmenu&amp;quot;, &lt;br /&gt;
						UI_EMBOSSP, UI_HELV, curarea-&amp;gt;headwin);&lt;br /&gt;
						&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 1&amp;quot;,&lt;br /&gt;
						0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, &amp;quot;&amp;quot;);&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 2&amp;quot;, &lt;br /&gt;
						0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, &amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	/* draw spacing between menu items */&lt;br /&gt;
	uiDefBut(block, SEPR, 0, &amp;quot;&amp;quot;, 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, &amp;quot;&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 3&amp;quot;, &lt;br /&gt;
						0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, &amp;quot;&amp;quot;);&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 4&amp;quot;, &lt;br /&gt;
						0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, &amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	uiTextBoundsBlock(block, 50);&lt;br /&gt;
	&lt;br /&gt;
	return block;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above creates a new ''uiBlock'' containing five buttons (one defined as separator). If you compile and test the result you will see that the menu is overlapping with the bottom window. This can be avoided by appending following lines at the end of the button definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 4|NumPad .&amp;quot;, &lt;br /&gt;
				0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, &amp;quot;&amp;quot;);&lt;br /&gt;
	&lt;br /&gt;
	if(curarea-&amp;gt;headertype==HEADERTOP) {&lt;br /&gt;
		uiBlockSetDirection(block, UI_DOWN);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		uiBlockSetDirection(block, UI_TOP);&lt;br /&gt;
		uiBlockFlipOrder(block);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	uiTextBoundsBlock(block, 50);&lt;br /&gt;
	...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: I have no idea what ''uiTextBoundsBlock()'' is used for. I have played with the parameters and the menu width, but couldn't get it. If there is a wise guy who knows, please edit this part.&lt;br /&gt;
&lt;br /&gt;
=== One Call to bind them all ===&lt;br /&gt;
&lt;br /&gt;
Now we have a menu which looks nice and does nothing. This might get boring after some minutes so let's bind the menu items to a callback function named ''do_draw_pulldownmenu()''. &lt;br /&gt;
&lt;br /&gt;
Add the following function to your code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt; /* sprintf */&lt;br /&gt;
&lt;br /&gt;
void do_draw_pulldownmenu(void *arg, int event);&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
void do_draw_pulldownmenu(void *arg, int event)&lt;br /&gt;
{&lt;br /&gt;
	switch(event) {&lt;br /&gt;
	case 0:&lt;br /&gt;
		printf(&amp;quot;Item 1 selected\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	case 1:&lt;br /&gt;
		printf(&amp;quot;Item 2 selected\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	case 2:&lt;br /&gt;
		printf(&amp;quot;Item 3 selected\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	case 3:&lt;br /&gt;
		printf(&amp;quot;Item 4 selected\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: After analysing different code it seems to be some kind of standard to derive the name of the event based callbacks from the drawing callbacks. So I am trying to conform, even if I believe it's confusing.&lt;br /&gt;
&lt;br /&gt;
In ''draw_pulldownmenu()'' we need to add the following call in front of the first button definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	uiBlockSetButmFunc(block, do_draw_pulldownmenu, NULL);&lt;br /&gt;
							&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 1|Shift S&amp;quot;,&lt;br /&gt;
	...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All following buttons are now bound to this event callback.&lt;br /&gt;
&lt;br /&gt;
You should recompile and execute blender from the command line to see any effect.&lt;br /&gt;
&lt;br /&gt;
=== Maximize/Minimize the Menus ===&lt;br /&gt;
&lt;br /&gt;
If you have a look at one of the other window types (e.g. 3D View) you will see that it is possible to minimize and maximize Pull-down menus by clicking the small triangle next to the window type selection menu. This can be done by adding the following code in ''demo_buttons()'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void demo_buttons(ScrArea *sa)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
	xco += XIC + 14;&lt;br /&gt;
	&lt;br /&gt;
	// minimize/maximize pulldown menu&lt;br /&gt;
	uiBlockSetEmboss(block, UI_EMBOSSN);&lt;br /&gt;
	if (curarea-&amp;gt;flag &amp;amp; HEADER_NO_PULLDOWN) {&lt;br /&gt;
		uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, &lt;br /&gt;
					 ICON_DISCLOSURE_TRI_RIGHT,&lt;br /&gt;
					 xco,2,XIC,YIC-2,&lt;br /&gt;
					 &amp;amp;(curarea-&amp;gt;flag), 0, 0, 0, 0, &lt;br /&gt;
					 &amp;quot;Show pulldown menus&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, &lt;br /&gt;
					 ICON_DISCLOSURE_TRI_DOWN,&lt;br /&gt;
					 xco,2,XIC,YIC-2,&lt;br /&gt;
					 &amp;amp;(curarea-&amp;gt;flag), 0, 0, 0, 0, &lt;br /&gt;
					 &amp;quot;Hide pulldown menus&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	uiBlockSetEmboss(block, UI_EMBOSS);&lt;br /&gt;
	xco+=XIC;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds the small button next to the window type selection menu to the header. To evaluate the state of this button we wrap the definition of the Pull-down as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	if((curarea-&amp;gt;flag &amp;amp; HEADER_NO_PULLDOWN)==0) {&lt;br /&gt;
		/* draw pulldown menu */&lt;br /&gt;
		xmax= GetButStringLength(&amp;quot;Pulldown&amp;quot;);&lt;br /&gt;
		uiDefPulldownBut(block, draw_pulldownmenu, NULL, &amp;quot;Pulldown&amp;quot;, &lt;br /&gt;
							xco, -2, xmax-3, 24, &amp;quot;&amp;quot;);&lt;br /&gt;
		xco+= xmax;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	uiBlockSetEmboss(block, UI_EMBOSSN);&lt;br /&gt;
&lt;br /&gt;
	/* always as last */&lt;br /&gt;
	curarea-&amp;gt;headbutlen= xco+2*XIC;&lt;br /&gt;
	...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you should be able to maximize and minimize the ''uiBlock'' containing the Pull-down menu.&lt;br /&gt;
&lt;br /&gt;
== Resulting Code ==&lt;br /&gt;
&lt;br /&gt;
The resulting code should now look as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;DNA_screen_types.h&amp;quot; /* ScrArea */&lt;br /&gt;
#include &amp;quot;BIF_interface.h&amp;quot; /* uiNewBlock, uiBlockSetCol */&lt;br /&gt;
#include &amp;quot;BIF_screen.h&amp;quot; /* curarea pointer */&lt;br /&gt;
#include &amp;quot;BIF_resources.h&amp;quot; /* themes, icons, etc. (-&amp;gt; TH_HEADER) */&lt;br /&gt;
#include &amp;quot;BSE_headerbuttons.h&amp;quot; /* GetButStringLength */&lt;br /&gt;
#include &amp;quot;DNA_space_types.h&amp;quot; /* SPACE_DEMO */&lt;br /&gt;
#include &amp;quot;blendef.h&amp;quot;	&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt; /* sprintf */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void do_draw_pulldownmenu(void *arg, int event);&lt;br /&gt;
&lt;br /&gt;
static uiBlock *draw_pulldownmenu(void *arg_unused)&lt;br /&gt;
{&lt;br /&gt;
	uiBlock *block;&lt;br /&gt;
	short yco= 0, menuwidth=120;&lt;br /&gt;
&lt;br /&gt;
	block= uiNewBlock(&amp;amp;curarea-&amp;gt;uiblocks, &amp;quot;draw_pulldownmenu&amp;quot;, &lt;br /&gt;
						UI_EMBOSSP, UI_HELV, curarea-&amp;gt;headwin);&lt;br /&gt;
						&lt;br /&gt;
	uiBlockSetButmFunc(block, do_draw_pulldownmenu, NULL);&lt;br /&gt;
							&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 1&amp;quot;,&lt;br /&gt;
					0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, &amp;quot;&amp;quot;);&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 2&amp;quot;, &lt;br /&gt;
					0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, &amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	/* draw spacing between menu items */&lt;br /&gt;
	uiDefBut(block, SEPR, 0, &amp;quot;&amp;quot;,0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, &amp;quot;&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 3&amp;quot;, &lt;br /&gt;
				0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, &amp;quot;&amp;quot;);&lt;br /&gt;
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, &amp;quot;Item 4&amp;quot;, &lt;br /&gt;
				0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, &amp;quot;&amp;quot;);&lt;br /&gt;
	&lt;br /&gt;
	if(curarea-&amp;gt;headertype==HEADERTOP) {&lt;br /&gt;
		uiBlockSetDirection(block, UI_DOWN);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		uiBlockSetDirection(block, UI_TOP);&lt;br /&gt;
		uiBlockFlipOrder(block);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	uiTextBoundsBlock(block, 50);&lt;br /&gt;
	&lt;br /&gt;
	return block;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void demo_buttons(ScrArea *sa)&lt;br /&gt;
{&lt;br /&gt;
	/* draw buttons */&lt;br /&gt;
	uiBlock *block;&lt;br /&gt;
	short xco, xmax;&lt;br /&gt;
	char name[256];&lt;br /&gt;
	&lt;br /&gt;
	sprintf(name, &amp;quot;header %d&amp;quot;, curarea-&amp;gt;headwin);&lt;br /&gt;
	&lt;br /&gt;
	/* begin of a new UI block */&lt;br /&gt;
	block= uiNewBlock(&amp;amp;curarea-&amp;gt;uiblocks, name, &lt;br /&gt;
				UI_EMBOSS, UI_HELV, curarea-&amp;gt;headwin);&lt;br /&gt;
&lt;br /&gt;
	/* change color if mouse over header */&lt;br /&gt;
	if(area_is_active_area(curarea)) &lt;br /&gt;
		uiBlockSetCol(block, TH_HEADER);&lt;br /&gt;
	else &lt;br /&gt;
		uiBlockSetCol(block, TH_HEADERDESEL);&lt;br /&gt;
	&lt;br /&gt;
	curarea-&amp;gt;butspacetype= SPACE_DEMO;&lt;br /&gt;
&lt;br /&gt;
	xco = 8;&lt;br /&gt;
	&lt;br /&gt;
	/* draw window type selection menu */&lt;br /&gt;
	uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, &lt;br /&gt;
				windowtype_pup(), xco, 0, XIC+10, YIC, &lt;br /&gt;
				&amp;amp;(curarea-&amp;gt;butspacetype), 1.0, SPACEICONMAX, 0, 0, &lt;br /&gt;
				&amp;quot;Displays Current Window Type. &amp;quot;&lt;br /&gt;
				&amp;quot;Click for menu of available types.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	xco += XIC + 14;&lt;br /&gt;
	&lt;br /&gt;
	// minimize/maximize pulldown menu&lt;br /&gt;
	uiBlockSetEmboss(block, UI_EMBOSSN);&lt;br /&gt;
	if (curarea-&amp;gt;flag &amp;amp; HEADER_NO_PULLDOWN) {&lt;br /&gt;
		uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, &lt;br /&gt;
				ICON_DISCLOSURE_TRI_RIGHT,&lt;br /&gt;
				xco,2,XIC,YIC-2,&lt;br /&gt;
				&amp;amp;(curarea-&amp;gt;flag), 0, 0, 0, 0, &lt;br /&gt;
				&amp;quot;Show pulldown menus&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, &lt;br /&gt;
				ICON_DISCLOSURE_TRI_DOWN,&lt;br /&gt;
				xco,2,XIC,YIC-2,&lt;br /&gt;
				&amp;amp;(curarea-&amp;gt;flag), 0, 0, 0, 0, &lt;br /&gt;
				&amp;quot;Hide pulldown menus&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	uiBlockSetEmboss(block, UI_EMBOSS);&lt;br /&gt;
	xco+=XIC;&lt;br /&gt;
		&lt;br /&gt;
	if((curarea-&amp;gt;flag &amp;amp; HEADER_NO_PULLDOWN)==0) {&lt;br /&gt;
		/* draw pulldown menu */&lt;br /&gt;
		xmax= GetButStringLength(&amp;quot;Pulldown&amp;quot;);&lt;br /&gt;
		uiDefPulldownBut(block, draw_pulldownmenu, NULL, &amp;quot;Pulldown&amp;quot;, &lt;br /&gt;
							xco, -2, xmax-3, 24, &amp;quot;&amp;quot;);&lt;br /&gt;
		xco+= xmax;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	uiBlockSetEmboss(block, UI_EMBOSSN);&lt;br /&gt;
&lt;br /&gt;
	/* always as last */&lt;br /&gt;
	curarea-&amp;gt;headbutlen= xco+2*XIC;&lt;br /&gt;
&lt;br /&gt;
	uiDrawBlock(block);	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void do_draw_pulldownmenu(void *arg, int event)&lt;br /&gt;
{&lt;br /&gt;
	switch(event) {&lt;br /&gt;
	case 0:&lt;br /&gt;
		printf(&amp;quot;Item 1 selected\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	case 1:&lt;br /&gt;
		printf(&amp;quot;Item 2 selected\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	case 2:&lt;br /&gt;
		printf(&amp;quot;Item 3 selected\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	case 3:&lt;br /&gt;
		printf(&amp;quot;Item 4 selected\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Mindrones bot</name></author>
		
	</entry>
</feed>