我有这个设置,我想在单击项目时在对话框中显示项目详细信息。我正在使用下面的代码,但是当单击该项目时没有显示对话框,我没有收到任何错误。
class Car():
def __init__(self,model,year):
self.model = model
self.year = year
def getInfo(self):
print(self.model, self.year)
class ElectricCar(Car):
def __init__(self, model, year, battery_size):
super().__init__(model, year)
self.battery = Battery(battery_size)
class Battery():
def __init__(self, battery_size=70):
self.battery_size = battery_size
def describe_battery(self):
print("Battery size is", self.battery_size)
my_tesla = ElectricCar('TeslaX', 2016)
my_tesla.getInfo()
print(my_tesla.battery)
my_tesla.battery.describe_battery()
my_big_tesla = ElectricCar('TeslaY', 2016, 90)
my_big_tesla.battery.describe_battery()
答案 0 :(得分:1)
致电<?php
// save input values
$title = $_POST['var1'];
$email = $_POST['var2'];
$msg = $_POST['var3'];
// setup email info
$to = "wersastudio@gmail.com";
$subject = $title;
$txt = $msg;
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
// send email
$send = mail($to,$subject,$txt,$headers);
// check if email is send or not
if ( $send ) {
echo 'success';
}else {
echo 'error';
}
?>
后致电builder.create().show()
。如果您不拨打builder.setView()
答案 1 :(得分:1)
我注意到你只创建了对话框,但你没有告诉它显示。
使用builder.create().show();