0
$\begingroup$

How can I set a width maximum or fixed value for a button?

I have an UI looking like this: enter image description here

The text field would be full path of a file and the 'Set' button is openning a dialog box. How can I go about increasing the text field's width and reducing the button's width? Thanks Kaveh

$\endgroup$
4
  • 1
    $\begingroup$ FYI: When using a StringProperty set to FILE_PATH, a button (to call the file browser) is going to be added automatically -> How to create a Folder Dialog?. This also would make it consistent with the rest of the UI so the question is: Do you really want to have an extra extra operator to call that dialog? $\endgroup$
    – brockmann
    Commented Jun 1, 2020 at 17:23
  • 1
    $\begingroup$ Great!This actually makes it so much easier and the code much simpler. In gerneral though is there a way, other than row and column definition to control the size of button? $\endgroup$
    – kaveh Alla
    Commented Jun 1, 2020 at 17:57
  • $\begingroup$ There is split and flow: docs.blender.org/api/current/… Also have a look into the python templates that comes with blender. Can we close this one as a duplicate or the linked question? $\endgroup$
    – brockmann
    Commented Jun 1, 2020 at 18:15
  • $\begingroup$ sure. thanks a lot! $\endgroup$
    – kaveh Alla
    Commented Jun 1, 2020 at 18:19

0

Browse other questions tagged .