I have a checkbox in a panel. I have assigned a toggle hotkey to it. But when i press the hotkey then the checkbox does not change its state until you move with the mouse over the checkbox.  How can i force a redraw at the checkbox when i press the hotkey?  To reproduce, add keymap item with wm.context_toggle and the Context Attribute window_manager.deselect_bool  The script:  ﻿import bpy from bpy.props import BoolProperty  class LayoutDemoPanel(bpy.types.Panel):     bl_label = "Demo Panel"     bl_space_type = 'VIEW_3D'     bl_region_type = 'UI'      def draw(self, context):         layout = self.layout          wm = context.window_manager # Our bool is in the windows_manager         layout.prop(wm, "deselect_bool") # Our checkbox  def register():     bpy.types.WindowManager.deselect_bool = bpy.props.BoolProperty(     name="Checkbox", description="A checkbox", default = False)     bpy.utils.register_module(__name__)  def unregister():     del bpy.types.WindowManager.deselect_bool # Unregister our flag when unregister.     bpy.utils.unregister_module(__name__)  if __name__ == "__main__":     register()
71146
I have a self made checkbox in a script. Now I want to create a hotkey in the Input manager to toggle it.  What I have done so far is to create a keymap item with wm.context_toggle. But I cannot get the Context Attribute to work. I grab the one from my script, the Python term in the tooltip. Which is WindowManager.deselect_bool and with that I get an error that the "Object has no attribute WindowManager".  What is the proper Context Attribute term here? Is it even possible to do it this way? If not, what is the proper way to assign a toggle hotkey for my custom checkbox?  Script:  import bpy from bpy.props import BoolProperty  class LayoutDemoPanel(bpy.types.Panel):     bl_label = "Demo Panel"     bl_space_type = 'VIEW_3D'     bl_region_type = 'UI'      def draw(self, context):         layout = self.layout          wm = context.window_manager # Our bool is in the windows_manager         layout.prop(wm, "deselect_bool") # Our checkbox  def register():     bpy.types.WindowManager.deselect_bool = bpy.props.BoolProperty(     name="Checkbox", description="A checkbox", default = False)     bpy.utils.register_module(__name__)  def unregister():     del bpy.types.WindowManager.deselect_bool # Unregister our flag when unregister.     bpy.utils.unregister_module(__name__)  if __name__ == "__main__":     register()
117868
The basic idea that I wanted was to create a key to pass a value that would inform \makebox how the contents of the box should be aligned.  Big fail here.    The intended contents of the \makebox are not passed as arguments to \makebox and I seem to have random components of my keys ignored or inserted into the text.  What's happening here?  \documentclass{article} \usepackage{xparse} \ExplSyntaxOn  \tl_new:N  \l_aefl_position_tl \tl_set:Nn \l_aefl_position_tl { [l] }  \keys_define:nn { aefl }     {         pos   .code:n   = {                             \str_case:nnn { #1 }                             {                                 { left   } { \tl_set:Nn \l_aefl_position_tl {[l]} }                                 { center } { \tl_set:Nn \l_aefl_position_tl {}    }                             }                             {                                 { right } { \tl_set:Nn \l_aefl_position_tl {[r]} }                             }                           },     }  \NewDocumentCommand{\aecurrfile}{ o }     {         \group_begin:         \IfNoValueF{#1}{\keys_set:nn { aefl }{#1}}          \makebox[0pt] \l_aefl_position_tl                       { contents ~ of ~ my ~ box }         \group_end:     }  \ExplSyntaxOff \pagestyle{empty} \begin{document}  \begin{tabular}{lcl} unexpected &amp; \verb=[l]=      &amp; \aecurrfile                        \\ unexpected &amp; \verb=[l]=      &amp; Front \aecurrfile[pos=left] Back   \\            &amp;                 &amp; Front \aecurrfile[pos=center] Back \\ unexpected &amp; \verb=right[l]= &amp; Front \aecurrfile[pos=right] Back \end{tabular}  \end{document}   EDIT  Finally, I see why I'm getting the unexpected right in my output.  Argh!
57836
The machine that I'm currently using is an extremely slow netbook. Whenever I go to change user preferences in Blender, it stalls out. What I need to do is activate the "emulate 3 button mouse" checkbox. Is there a way to do this via console/script?
123761
When working in full screen mode, I'd like a way to quickly switch between host and VM using a toggle key. How can I do this? Thanks.
95344
I am still learning settings API so please forgive my noob question. I have three fields: a checkbox, colorpicker and text field (they are working), but I would like to do this: when the theme is installed add "checked" state to my checkbox but allow user to "unchecked" it ,and if empty add default color to my colorpicker... I have no idea how to do this so please help me!  My code looks like this now (thanks to @Chip Bennett! ) :  &lt;?php add_action('admin_menu','create_theme_options_page'); function create_theme_options_page(){ add_options_page('Theme Options','Theme Options','administrator',__FILE__,'build_options_page'); }    function build_options_page(){    ?&gt;    &lt;div id="theme-options-wrap"&gt;    &lt;div style="float:left;margin-top:19px;position:absolute;" class="icon32" id="icon-tools"&gt;&lt;br/&gt;&lt;/div&gt;    &lt;h2&gt;My options page&lt;/h2&gt;    &lt;form method="post" action="options.php"&gt;    &lt;?php settings_fields('plugin_options');?&gt;    &lt;?php do_settings_sections(__FILE__); ?&gt;    &lt;p class="submit"&gt;    &lt;input name="Submit" type="submit" class="button-primary" value="&lt;?php esc_attr_e('Save changes');?&gt;"/&gt;    &lt;/p&gt;    &lt;/form&gt;    &lt;/div&gt;    &lt;?php    }       add_action('admin_init','register_and_build_fields');      function register_and_build_fields(){      register_setting('plugin_options','plugin_options','validate_setting');      add_settings_section('main_section','&lt;br/&gt;&lt;br/&gt;Main Settings','section_cb',__FILE__);      add_settings_field('banner_heading','Banner Heading:','banner_heading_setting',__FILE__,'main_section');      add_settings_field('display_sidebar','Display Sidebar:','display_sidebar_setting',__FILE__,'main_section');      add_settings_field('display_colorpicker','Display Colorpicker:','display_colorpicker_setting',__FILE__,'main_section');      }        //Install Iris colorpicker        add_action( 'admin_enqueue_scripts', 'mw_enqueue_color_picker' );        function mw_enqueue_color_picker( $hook_suffix ) {        // first check that $hook_suffix is appropriate for your admin page        wp_enqueue_style( 'wp-color-picker' );        wp_enqueue_script( 'my-script-handle', get_template_directory_uri() . '/js/my-script.js', array( 'wp-color-picker' ), false, true );        }           //Colorpicker          //Now how to add a default color on theme install?          function display_colorpicker_setting(){          $options = get_option('plugin_options');          echo"&lt;input type='text' id='color1' name='plugin_options[display_colorpicker]' value='{$options['display_colorpicker']}'/&gt;";          }            //Sidebar checkbox           //Now how to add a default state "checked" on theme install?           function display_sidebar_setting(){           $options = get_option('plugin_options');           echo "&lt;input type='checkbox' name='plugin_options[display_sidebar]' {$options['display_sidebar']} id='display_sidebar' /&gt;";           }              //Banner Heading             function banner_heading_setting(){             $options = get_option('plugin_options');             echo "&lt;input name='plugin_options[banner_heading]' type='text' value='{$options['banner_heading']}'/&gt;";             }               //Validate our settings here               function validate_setting($plugin_options){                  return $plugin_options;               }                 function section_cb(){                } ?&gt;
46282
So I'm not sure if this will be possible at all, but someone might have an idea for a workaround for this problem.  So if I have made a toolbar, e.g. (short version)  class add_item(Panel):     bl_space_type = 'VIEW_3D'     bl_region_type = 'TOOLS'   But I would like to have this toolbar placed in multiple toolbars so it'd become something like this (code below doesn't actually work, just an example of what I'd like):  class add_item(Panel):     bl_space_type = ['VIEW_3D', 'IMAGE_EDITOR', 'NODE_EDITOR']     bl_region_type = 'TOOLS'   Would something similar to this be possible to do without duplicating all the code for the toolbar multiple times, just to then change the bl_space_type?
120412
Is there a way to bind a Minecraft command to a hotkey?  For example, I’d like a way to toggle between modes (survivla/creative) by pressing the Tab so that if I’m in a nasty pinch (like getting poisoned by a spider and being unable to fight back because the game suddenly lags really badly) and want to avoid losing a full inventory of valuables that I worked hard to get over the past five hours, I can quickly switch to creative mode.  I searched for a mod to do this and (surprisingly) came up empty; all I could find was the  mod which requires LiteLoader and doesn’t seem to be able to bind arbitrary commands to keys.  The closest thing to a solution that I could find were suggestions to automate it with AutoHotkey, but that is no good because some keystrokes to get lost (probably due to the game’s CPU load), so pressing the hotkey will result in amemode 1 or /amemo 0 and such.  Is there a way to bind a command to a key so that it always works correctly?
30235
Suppose I have a list of 100+ pieces of data that I'm displaying in a table that's paginating 40 elements per page.  Each row has 'select' checkbox that enables the user to select/unselect an individual item. On top of the list, there's also a 'select/unselect all' checkbox. For the moment, I have the functionality designed so that when the user clicks that checkbox, the action of toggling the selection is performed only on the elements currently displayed in the page. What are the best practices on 'select all'?  Should the action operate on:   a) only the visible elements being paginated, or   b) the entire list?
113428
is a simple way to script small GUIs.  Can anyone give a nice example with a button and a text widget. When the button is pressed should a shell command be executed and the output piped to the text widget.  If you have other nice and clean examples for useful tasks, please add them too.
107111
Upon page load I want to move the cursor to a particular field.  No problem.  But I also need to select and highlight the default value that is placed in that text field.
119046
As a long time user of other prominent 3d software, I'm used to being able to be in object mode and press 1 hotkey to go directly to vertex, edge, or face mode.    I'm using 2.8 and love it, but for the life of me, I can't get used to pressing "Tab" before I hit 1,2,or 3.  To make things worse, those keys (in object mode) hide and unhide collections.  It's driving me crazy.    I just want a smart hotkey that allows me to press 1,2,or 3 in object mode and automatically puts me in edit mode.  Pressing "Tab" would behave as it already does - toggling between object or edit mode.    Is there a way to do this?  Thanks, Chris
59753
I will often click on a button expecting it to be clicked but instead all that happens is the application it is in becomes active, and I have to click again to actually click the button.  It would be nice if this second click wasn't needed, which leads me to my question:     How can I make it so that when I move the mouse cursor over an inactive window, it becomes active?
13401
I am trying to transition to using the etoolbox package, but seem to have run into some difficulties and they appear related to the hyperref and bm packages which to me seem totally unrelated.  The MWE example compiles since \RemoveEToolbox is defined and shows that there is no apparent problem before etoolbox was used.    Commenting out the \def\RemoveEToolbox{} line produces two problems:   With both the \renewcommand, and the usepackage{hyperref} commented, this results in "Runaway argument? Paragraph ended before \bm@test@token was complete". Including the usepackage{hyperref} (with \renewcommand commented) results in "Undefined control  sequence. \Call@AtVeryEndDocument ...cumentHook \@undefined"   But if uncomment the \renewcommand{\bm}{#1} line (effectively doing without any \bm), then this seems to compile.  I have been using this for a while now and things appeared to have been working fine, but now that I attempt to use etoolbox I seem to run into problems.  \documentclass{standalone} \def\RemoveEToolbox{}% Shows that this works fine without {etoolbox}  \usepackage{amsmath} \usepackage{xcolor} \usepackage{bm}  \ifdefined\RemoveEToolbox     \newcommand*{\iftoggle}[3]{#2}% Default to true value of "if" \else     \usepackage{etoolbox}     \newtoggle{paper}     \toggletrue{paper}      %\renewcommand{\bm}[1]{#1}% Why can't I have a normal \bm with {etoolbox}? \fi  % \usepackage{hyperref}  \begin{document}  This document is intended for  \iftoggle{paper}{paper}{electronic} distribution.  \bm{\textcolor{blue}{Solve $x^2-1=0$}}  \begin{align*}     a &amp;= b\\     \iftoggle{paper}{         c &amp;= d\\     }{}     e &amp;= f\\ \end{align*} \end{document}
111601
When you hold Shift while right-clicking a folder in Windows, the context menu includes the option to Open command window here.  Is there a registry tweak, or an extension/add-on, which frees you from the need to hold Shift for this operation?
6699
I'm trying to find out how to add a checkbox to a panel header so panel can be deacivated (as well as storing that checkbox value in some property). It may be quite obious task, but I didn't find any info about it in the docs so far.  Example of what I'm trying to achive is the "Gravity" panel, that can be turned off with the checkbox.    Any suggestions or leads? I would be grateful for any code examples with it.
109505
I'm programmatically adding ToolStripButton items to a context menu.  That part is easy.  this.tsmiDelete.DropDownItems.Add("The text on the item.");   However, I also need to wire up the events so that when the user clicks the item something actually happens!  How do I do this? The method that handles the click also needs to receive some sort of id or object that relates to the particular ToolStripButton that the user clicked.
24886
I am having some issues. In ArcGIS, I created a custom toolbar (with the python addin wizard) to do the following: 1. Button to connect to feature class, 2-5. A series of comboboxes to view, edit data in a field in the feature class. I want each of the combo box classes to directly connect to the field. And be able to write new data from the boxes into the fields.  Example: Combobox 1 to connect to field 1. So that when I deploy this a user can edit data without doing this the traditional way. Its a way to have inexperienced users edit data. I am new to python and willing to pay for the time required to help me as I am out of ideas. And ESRI doesn't have a solution either.   import arcpy import pythonaddins from arcpy import env   class ButtonClass1(object):     """Implementation for QuickTableEdit_addin.button (Button)"""     def __init__(self):         self.enabled = True         self.checked = False     def onClick(self):         print("Button1 Clicked")         env.workspace = "C:/data"         arcpy.CreateTable_management("C:/data", "test_table.dbf","template.dbf")         mxd = arcpy.mapping.MapDocument("CURRENT")         df = arcpy.mapping.ListDataFrames(mxd)[0]         dbf_Table = arcpy.mapping.TableView(r"C:\data\test_table.dbf")         arcpy.mapping.AddTableView(df, dbf_Table)         arcpy.RefreshTOC()         pass  class ComboBoxClass2(object):     """Implementation for QuickTableEdit_addin.combobox_1 (ComboBox)"""     def __init__(self):         self.items = [1,2]         self.editable = True         self.enabled = True         self.dropdownWidth = 'WWWWWW'         self.width = 'WWWWWW'     def onSelChange(self, selection):         global cb1         cb1 = self.value         pass     def onEditChange(self, text):         pass     def onFocus(self, focused):         pass     def onEnter(self):         pass     def refresh(self):         pass