button

In swiftui, How do I increase the height of a button?

三世轮回 提交于 2020-01-21 06:51:11
问题 As you can see in the screenshot, the button height does not adjust to fit the text size, making it look ugly. How can I increase the hight of the buttons, so it does not look stupid. My question is, how do I increase the height of buttons in swiftui. I am trying to make the titlescreen of my minecraft like game. struct ContentView: View { var body: some View { GeometryReader { geometry in VStack (spacing: 8) { Text("[Name not disclosed]Craft").font(.system(size: geometry.size.width/8))

How to retrieve the row and column information of a button and use this to alter its settings in python

牧云@^-^@ 提交于 2020-01-21 05:47:25
问题 I am creating a game and trying to make it in python and tkinter. I have already completed it in word-based python and want to make it graphical. I have created a grid of buttons to be used as a grid and these buttons currently have the letter "O" on them to show an empty space. However, what I would like is the button to show text of where a pirate is and then eventually the player and chests. The text cannot be hard coded as the positions are randomly selected. while len(treasure)

Python Tkinter one callback function for two buttons

帅比萌擦擦* 提交于 2020-01-21 05:23:24
问题 I have been looking around for a long time for answers to this question but still hasn't find anything. I am creating a GUI using Tkinter, and I have two buttons that do mostly the same thing except they receive information from different widgets. One button is for an Entry widget and the other is for a Listbox widget. The callback function for these two buttons is long (about 200 lines), so I don't want to have separate functions for each button. I have if-statements in the beginning of this

Python Tkinter one callback function for two buttons

元气小坏坏 提交于 2020-01-21 05:23:05
问题 I have been looking around for a long time for answers to this question but still hasn't find anything. I am creating a GUI using Tkinter, and I have two buttons that do mostly the same thing except they receive information from different widgets. One button is for an Entry widget and the other is for a Listbox widget. The callback function for these two buttons is long (about 200 lines), so I don't want to have separate functions for each button. I have if-statements in the beginning of this

UIDatePicker with “done” button

女生的网名这么多〃 提交于 2020-01-21 02:49:05
问题 I need to add a "done" button to my date picker like in this image: This is my code: -(IBAction)chooseDate:(id)sender{ self.datepicker= [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, 320, 216)]; self.datepicker.datePickerMode = UIDatePickerModeDate; datepicker.backgroundColor = Rgb2UIColor(52, 170, 220); [self.btnDone addTarget:self action:@selector(SetDatePickerTime:) forControlEvents:UIControlEventTouchDown]; [self.view addSubview:self.datepicker]; } 回答1: Create a date picker, then

How to modify the default button state in Android without affecting the pressed and selected states?

ぃ、小莉子 提交于 2020-01-20 08:37:29
问题 I am trying to remove an ImageButton's background in only the default state. I'd like the pressed and selected states to behave as usual so that they look correct on different devices, which use different colors for the pressed and selected states. Is there any way to set an ImageButton's background default state's drawable without affecting the pressed and selected states? I've tried to do this with a selector, but it does not appear to allow you to use the default drawables for some states

How to modify the default button state in Android without affecting the pressed and selected states?

烂漫一生 提交于 2020-01-20 08:37:28
问题 I am trying to remove an ImageButton's background in only the default state. I'd like the pressed and selected states to behave as usual so that they look correct on different devices, which use different colors for the pressed and selected states. Is there any way to set an ImageButton's background default state's drawable without affecting the pressed and selected states? I've tried to do this with a selector, but it does not appear to allow you to use the default drawables for some states

How do I put a Bootstrap Glyphicon inside an asp:Button in ASP.Net?

我的未来我决定 提交于 2020-01-18 21:38:45
问题 I'm using Bootstrap 3 in my project, and I want to use Bootstrap Glyphicons in ASP.net buttons. Here is the code I used, though it didn't work out (I got a sample which uses Twitter Bootstrap <span> tags instead of <i> tags): <asp:Button ID="btnRandom" runat="server" Text="<span aria-hidden='true' class='glyphicon glyphicon-refresh'> </span>" onclick="btnRandom_Click" /> Maybe something extra should be done. How can I get it to work? Thanks in advance for the replies. 回答1: You have to use asp

How do I put a Bootstrap Glyphicon inside an asp:Button in ASP.Net?

让人想犯罪 __ 提交于 2020-01-18 21:37:46
问题 I'm using Bootstrap 3 in my project, and I want to use Bootstrap Glyphicons in ASP.net buttons. Here is the code I used, though it didn't work out (I got a sample which uses Twitter Bootstrap <span> tags instead of <i> tags): <asp:Button ID="btnRandom" runat="server" Text="<span aria-hidden='true' class='glyphicon glyphicon-refresh'> </span>" onclick="btnRandom_Click" /> Maybe something extra should be done. How can I get it to work? Thanks in advance for the replies. 回答1: You have to use asp

DataGridViewButtonCell button color change on click

*爱你&永不变心* 提交于 2020-01-17 14:17:45
问题 I have a DataGridViewRow that I add to a DataGridView "table" programatically. I want one of the cells to be a DataGridViewButtonCell so I can click on it. (I realize I can have a handler on the datagridview for on_click but I'd like to keep this way for simplicity of code). I want to be able to set the forecolor/backcolor of a DataGridViewButtonCell. DataGridViewRow dgvRow = new DataGridViewRow(); dgvRow = (DataGridViewRow)dgv.Rows[0].Clone(); dgvRow.Cells[0].Value = filename; dgvRow.Cells[0