本文整理汇总了Python中dtk.ui.label.Label.set_can_focus方法的典型用法代码示例。如果您正苦于以下问题:Python Label.set_can_focus方法的具体用法?Python Label.set_can_focus怎么用?Python Label.set_can_focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtk.ui.label.Label
的用法示例。
在下文中一共展示了Label.set_can_focus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __label
# 需要导入模块: from dtk.ui.label import Label [as 别名]
# 或者: from dtk.ui.label.Label import set_can_focus [as 别名]
def __label(self, label_name):
label = Label(label_name,
text_x_align = ALIGN_END,
text_size=CONTENT_FONT_SIZE,
enable_select=False,
enable_double_click=False,
fixed_width = STANDARD_LINE)
label.set_can_focus(False)
return label
示例2: __set_row
# 需要导入模块: from dtk.ui.label import Label [as 别名]
# 或者: from dtk.ui.label.Label import set_can_focus [as 别名]
def __set_row(self, name, arg, types="ip"):
label = Label(name, text_size=CONTENT_FONT_SIZE,
enable_select=False,
enable_double_click=False)
label.set_can_focus(False)
entry = IPV4Entry()
if types == "ip":
entry.connect("changed", self.set_ip_address, arg)
else:
entry.connect("changed", self.set_dns_address, arg)
return (label, entry)
示例3: __row_entry_spin
# 需要导入模块: from dtk.ui.label import Label [as 别名]
# 或者: from dtk.ui.label.Label import set_can_focus [as 别名]
def __row_entry_spin(self, label_name, table, types):
label = Label(label_name,
text_size=CONTENT_FONT_SIZE,
enable_select=False,
enable_double_click=False)
label.set_can_focus(False)
label_align = style.wrap_with_align(label, width = 260)
entry = InputEntry()
entry.set_size(self.ENTRY_WIDTH, 22)
spin = SpinBox(0, 0, 49151, 1, 60)
spin.value_entry.connect("changed", lambda w, v: spin.update_and_emit(int(v)))
hbox = gtk.HBox(spacing=10)
hbox.set_size_request(-1 ,22)
hbox_align = style.wrap_with_align(hbox, align="left")
hbox.pack_start(entry)
hbox.pack_start(spin)
table.row_attach((label_align, hbox_align))
return [entry, spin]
示例4: add_new_box
# 需要导入模块: from dtk.ui.label import Label [as 别名]
# 或者: from dtk.ui.label.Label import set_can_focus [as 别名]
def add_new_box(self):
table = gtk.Table()
#hbox.set_size_request(-1, 30)
name_label = Label(_("Name:"), enable_select=False)
name_label.set_can_focus(False)
exec_label = Label(_("Exec:"), enable_select=False)
exec_label.set_can_focus(False)
desc_label = Label(_("Comment:"), enable_select=False)
desc_label.set_can_focus(False)
self.name_entry = InputEntry()
self.exec_entry = InputEntry()
self.desc_entry = InputEntry()
self.name_entry.set_size(200, 22)
self.exec_entry.set_size(200, 22)
self.desc_entry.set_size(200, 22)
name_label_align = self.wrap_with_align(name_label)
exec_label_align = self.wrap_with_align(exec_label)
desc_label_align = self.wrap_with_align(desc_label)
name_align = style.wrap_with_align(self.name_entry)
exec_align = style.wrap_with_align(self.exec_entry)
desc_align = style.wrap_with_align(self.desc_entry)
table = gtk.Table(3, 4)
self.table_add(table, [name_label_align, exec_label_align, desc_label_align], 0)
self.table_add(table, [name_align, exec_align, desc_align], 1)
open_folder = ImageButton(self.icon_pixbuf, self.icon_pixbuf, self.icon_pixbuf)
open_folder.connect("clicked", lambda w: OpenFileDialog("Choose file", self, ok_callback=self.ok_callback))
table.attach(style.wrap_with_align(open_folder), 2, 3, 1, 2)
align = gtk.Alignment(0.5, 0, 0, 0)
style.set_table(table)
align.add(table)
return align
示例5: __init__
# 需要导入模块: from dtk.ui.label import Label [as 别名]
# 或者: from dtk.ui.label.Label import set_can_focus [as 别名]
def __init__(self, connection, set_button_callback=None, settings_obj=None):
gtk.VBox.__init__(self)
self.tab_name = _("DSL")
self.connection = connection
self.set_button = set_button_callback
# 新增settings_obj变量,用于访问shared_methods.Settings对象
self.settings_obj = settings_obj
self.dsl_setting = self.connection.get_setting("pppoe")
# UI
dsl_table = gtk.Table(5, 3, False)
ssid_label = Label(_("Connection Name:"),
text_size=CONTENT_FONT_SIZE,
enable_select=False,
enable_double_click=False)
ssid_label.set_can_focus(False)
username_label = Label(_("Username:"),
text_size=CONTENT_FONT_SIZE,
enable_select=False,
enable_double_click=False)
username_label.set_can_focus(False)
service_label = Label(_("Service:"),
text_size=CONTENT_FONT_SIZE,
enable_select=False,
enable_double_click=False)
service_label.set_can_focus(False)
password_label = Label(_("Password:"),
text_size=CONTENT_FONT_SIZE,
enable_select=False,
enable_double_click=False)
password_label.set_can_focus(False)
#pack labels
dsl_table.attach(style.wrap_with_align(ssid_label, width=self.LEFT_PADDING), 0, 1 , 0, 1)
dsl_table.attach(style.wrap_with_align(username_label, width=self.LEFT_PADDING), 0, 1 , 1, 2)
dsl_table.attach(style.wrap_with_align(service_label, width=self.LEFT_PADDING), 0, 1, 2, 3)
dsl_table.attach(style.wrap_with_align(password_label, width=self.LEFT_PADDING), 0, 1, 3, 4)
# entries
self.ssid_entry = InputEntry()
self.ssid_entry.set_size(220 ,22)
self.username_entry = InputEntry()
self.username_entry.set_size(220 ,22)
self.service_entry = InputEntry()
self.service_entry.set_size(220 ,22)
self.password_entry = PasswordEntry()
self.password_entry.set_size(220 ,22)
self.show_password = CheckButton(_("Show Password"), font_size=CONTENT_FONT_SIZE, padding_x=0)
def show_password(widget):
if widget.get_active():
self.password_entry.show_password(True)
else:
self.password_entry.show_password(False)
self.show_password.connect("toggled", show_password)
#pack entries
dsl_table.attach(style.wrap_with_align(self.ssid_entry, align="left"), 1, 3, 0, 1)
dsl_table.attach(style.wrap_with_align(self.username_entry, align="left"), 1, 3, 1, 2)
dsl_table.attach(style.wrap_with_align(self.service_entry, align="left"), 1, 3, 2, 3)
dsl_table.attach(style.wrap_with_align(self.password_entry, align="left"), 1, 3, 3, 4)
dsl_table.attach(style.wrap_with_align(self.show_password, align="left"), 1, 3, 4, 5)
style.draw_background_color(self)
style.set_table(dsl_table)
# just make table postion looks right
table_align = gtk.Alignment(0, 0, 0, 0)
table_align.add(dsl_table)
self.pack_start(table_align, False, False)
#self.add(align)
self.show_all()
self.refresh()
self.ssid_entry.entry.connect("changed", self.save_changes, "ssid")
self.username_entry.entry.connect("changed", self.save_changes, "username")
self.service_entry.entry.connect("changed", self.save_changes, "service")
self.password_entry.entry.connect("changed", self.save_changes, "password")
示例6: __init__
# 需要导入模块: from dtk.ui.label import Label [as 别名]
# 或者: from dtk.ui.label.Label import set_can_focus [as 别名]
def __init__(self, connection, module_frame, set_button_callback=None, settings_obj=None):
gtk.VBox.__init__(self)
self.connection = connection
self.tab_name = _("PPTP")
self.module_frame = module_frame
self.set_button = set_button_callback
# 新增settings_obj变量,用于访问shared_methods.Settings对象
self.settings_obj = settings_obj
self.vpn_setting = self.connection.get_setting("vpn")
# UI
pptp_table = gtk.Table(7, 4, False)
name_label = Label(_("Connection Name:"),
enable_select=False,
enable_double_click=False)
name_label.set_can_focus(False)
gateway_label = Label(_("Gateway:"),
enable_select=False,
enable_double_click=False)
gateway_label.set_can_focus(False)
user_label = Label(_("Username:"),
enable_select=False,
enable_double_click=False)
user_label.set_can_focus(False)
password_label = Label(_("Password:"),
enable_select=False,
enable_double_click=False)
password_label.set_can_focus(False)
nt_domain_label = Label(_("NT Domain:"),
enable_select=False,
enable_double_click=False)
nt_domain_label.set_can_focus(False)
# Radio Button
self.pptp_radio = RadioButton(_("PPTP"))
self.l2tp_radio = RadioButton(_("L2TP"))
radio_box = gtk.HBox(spacing=30)
radio_box.pack_start(self.pptp_radio, True, True)
radio_box.pack_start(self.l2tp_radio, True, True)
#pack labels
pptp_table.attach(style.wrap_with_align(radio_box, align="left"), 2,4, 0, 1)
pptp_table.attach(style.wrap_with_align(name_label, width=self.LEFT_PADDING), 0, 2, 1, 2)
pptp_table.attach(style.wrap_with_align(gateway_label, width=self.LEFT_PADDING), 0, 2 , 2, 3)
pptp_table.attach(style.wrap_with_align(user_label, width=self.LEFT_PADDING), 0, 2, 3, 4)
pptp_table.attach(style.wrap_with_align(password_label, width=self.LEFT_PADDING), 0, 2, 4, 5)
#pptp_table.attach(style.wrap_with_align(nt_domain_label), 0, 2, 5, 6)
# entries
self.name_entry = InputEntry()
self.name_entry.set_size(self.ENTRY_WIDTH, 22)
self.gateway_entry = InputEntry()
self.gateway_entry.set_size(self.ENTRY_WIDTH,22)
self.user_entry = InputEntry()
self.user_entry.set_size(self.ENTRY_WIDTH, 22)
# FIXME should change to new_entry PasswordEntry
self.password_entry = PasswordEntry()
self.password_entry.set_size(self.ENTRY_WIDTH, 22)
self.password_show = CheckButton(_("Show Password"), padding_x=0)
self.password_show.set_active(False)
self.password_show.connect("toggled", self.show_password)
self.nt_domain_entry = InputEntry()
self.nt_domain_entry.set_size(self.ENTRY_WIDTH, 22)
#pack entries
pptp_table.attach(style.wrap_with_align(self.name_entry, align="left"), 2, 4, 1, 2)
pptp_table.attach(style.wrap_with_align(self.gateway_entry, align="left"), 2, 4, 2, 3)
pptp_table.attach(style.wrap_with_align(self.user_entry, align="left"), 2, 4, 3, 4)
pptp_table.attach(style.wrap_with_align(self.password_entry, align="left"), 2, 4, 4, 5)
pptp_table.attach(style.wrap_with_align(self.password_show, align="left"), 2, 4, 5, 6)
#pptp_table.attach(style.wrap_with_align(self.nt_domain_entry), 2, 4, 5, 6)
# Advance setting button
#advanced_button = Button(_("Advanced Setting"))
#advanced_button.connect("clicked", self.advanced_button_click)
#pptp_table.attach(style.wrap_with_align(advanced_button), 3, 4, 6, 7)
self.service_type = self.vpn_setting.service_type.split(".")[-1]
if self.service_type == "l2tp":
self.l2tp_radio.set_active(True)
else:
self.pptp_radio.set_active(True)
self.pptp_radio.connect("toggled",self.radio_toggled, "pptp")
self.l2tp_radio.connect("toggled",self.radio_toggled, "l2tp")
# set signals
#align = style.set_box_with_align(pptp_table, "text")
table_align = gtk.Alignment(0, 0, 0, 0)
table_align.add(pptp_table)
#style.set_table_items(pptp_table, "entry")
style.draw_background_color(self)
style.set_table(pptp_table)
self.add(table_align)
self.show_all()
self.refresh()
self.name_entry.entry.connect("changed", self.entry_changed, "name")
self.gateway_entry.entry.connect("changed", self.entry_changed, "gateway")
self.user_entry.entry.connect("changed", self.entry_changed, "user")
self.password_entry.entry.connect("changed", self.entry_changed, "password")
#.........这里部分代码省略.........