button

click on the button to run php code and echo result

社会主义新天地 提交于 2020-01-24 00:47:12
问题 I want to implement this script: http://www.daniloaz.com/en/560/programming/backup-de-bases-de-datos-mysql-con-php/ on my website to backup all the database at the end of the day. May I know is it possible for me to put a button to click and run the script and echo the status after it finish without refreshing the page or bring me to a new page. as at the moment i everyday need to go to the link: www.example.com/backup.php to do daily backup, I want this to ease my job :) any idea how to do

change value of a variable without a function using a tkinter button

徘徊边缘 提交于 2020-01-24 00:28:06
问题 I am new to programming and I want to know If there is any way to change the value of a variable with a Tkinter button out calling a function. As I have to give a function as command to change the value of any variable. Like this: import tkinter as tk a = 1 def test(): global a a = 2 return root = tk.Tk() b = tk.Button(root, text="Click", command=test) b.pack() root.mainloop() But I want to know if there is a way to do it directly without using any function. Something that might look like

How to change the background image of a button using JavaScript?

Deadly 提交于 2020-01-24 00:04:48
问题 I want to change the background image of a button using Javascript. Here is what I am currently trying, but it is failing. HTML code - <tr id="Rank1"> <td><button class="darkSquare"></button></td> <td><button class="lightSquare" ></button></td> <td><button class="darkSquare" ></button></td> <td><button class="lightSquare" ></button></td> <td><button id="e1" class="darkSquare" ></button></td> <td><button class="lightSquare" ></button></td> <td><button class="darkSquare" ></button></td> <td>

Use custom widgets kivy

旧街凉风 提交于 2020-01-23 19:43:44
问题 I'm trying to build a kivy app using some custom widgets. However whenever I try to use them they never work with my layout. Using a normal button: import kivy kivy.require('1.8.0') from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import ListProperty class RootWidget(Widget):pass class myApp(App): def build(self): global rw rw = RootWidget() return rw if __name__ == '__main__': myApp().run() #:kivy 1.8.0 <RootWidget>: BoxLayout: size: root.size orientation:

Android button loses text alignment after setText

假如想象 提交于 2020-01-23 12:53:10
问题 I'm using xml to draw a spinning progress indicator along with some text. In the bottom of the screen I have a TableLayout with two buttons, which are centered in the page with each text also centered. <RelativeLayout android:id="@+id/progresscontainer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal"> <ProgressBar android:id="@+id/progress_bar" style="?android:attr/progressBarStyleSmall" android:layout_width="wrap_content" android

Android button loses text alignment after setText

风格不统一 提交于 2020-01-23 12:52:31
问题 I'm using xml to draw a spinning progress indicator along with some text. In the bottom of the screen I have a TableLayout with two buttons, which are centered in the page with each text also centered. <RelativeLayout android:id="@+id/progresscontainer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal"> <ProgressBar android:id="@+id/progress_bar" style="?android:attr/progressBarStyleSmall" android:layout_width="wrap_content" android

Android button loses text alignment after setText

余生颓废 提交于 2020-01-23 12:52:13
问题 I'm using xml to draw a spinning progress indicator along with some text. In the bottom of the screen I have a TableLayout with two buttons, which are centered in the page with each text also centered. <RelativeLayout android:id="@+id/progresscontainer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal"> <ProgressBar android:id="@+id/progress_bar" style="?android:attr/progressBarStyleSmall" android:layout_width="wrap_content" android

Cancel button press if user moves finger off button

血红的双手。 提交于 2020-01-23 12:25:55
问题 Here is my very standard button onTouchListener: b.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) { b.setPressed(true); } if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) { b.setPressed(false); // Do the button action stuff here } return true; } }); When the user presses down on the button I set the button to "pressed". When the

JqGrid Add custom button to Row

痴心易碎 提交于 2020-01-23 12:10:16
问题 I am trying to add a custom button to a JqGrid that implements a 'Check Out' process. Basically, every row has a 'Check Out' button that if clicked should be able to send a post back to the server and update a shopping cart and then change the button text to 'Undo Check Out'. So far I have: colNames: ['Id', ... , 'Action' ], colModel: [ { name: 'Id', sortable: false, width: 1, hidden: true}, ... { name: 'action', index: 'action', width: 75, sortable: false } ], ... gridComplete: function() {

Sonata Admin Action Button to Pre Filtered List

别来无恙 提交于 2020-01-23 07:56:03
问题 I am rather new to Symfony (2 weeks) so forgive my ignorance. I am trying to add a custom action button that will link to a pre filtered list of a RELATED entity. I have done a lot of research but can't quite seem to find what I need. Currently I have two entities Books and Authors with a manyToOne relation ship. I have these set up in Sonata Admin in the usual way and all works well. I even have an author filter on the book list page which I am hoping can be leveraged to accomplish my goal.