ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Alexey Morsov <samurai@ricom.ru>
To: community@altlinux.ru
Subject: Re: [Comm] Re: [OFF] Win32 soft to Mysql
Date: Tue, 13 Apr 2004 16:39:38 +0400
Message-ID: <407BDF8A.6080107@ricom.ru> (raw)
In-Reply-To: <407BDB50.9010403@vzljot.ru>

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]


Vitaly Ostanin wrote:
> Alexey Morsov пишет:
> 
> <skipped/>
> 
>>> Честно говоря, я так и не понял, зачем нужен именно wxpython. Из 
>>> визуалок, повторюсь, есть glade2, очень несырое и бесплатно. Главное, 
>>> использовать только интерфейс, который он генерит, но не код.
>>
>>
>> А разве wxpython сырой?
> 
> 
> Не знаю, я его не использую, т.к. мне не нужны wxwidgets. Хотя их и 
> хвалили в этой рассылке.
> 
>> А не могли бы вы мне ссылку на то место где Glade2 для python живет - 
>> а то что-то рыл - для си нашел для python - как-то невразумительно
> 
> 
> См. выше - не нужно использовать код, который создаёт glade, для любого 
> языка. Вам нужен визуальный построитель интерфейса, верно?
> 
> Для gtk такой построитель - glade. Описание интерфейса хранится в 
> XML-формате в файле с расширением .glade.
> 
> Интерфейс подключается с использованием libglade, в аттаче пример из 
> поставки pygtk2.
пробовал - он ругаеться что

(pinger.py:1700): libglade-CRITICAL **: file glade-xml.c: line 
1177 (glade_xml_b
uild_interface): assertion `wid != NULL' failed

py и glade файлы в аттаче


-- 
С наилучшими пожеланиями,
Алексей.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pinger.glade --]
[-- Type: text/xml; name="pinger.glade", Size: 7314 bytes --]

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">

<glade-interface>

<widget class="GtkWindow" id="main_window">
  <property name="border_width">1</property>
  <property name="visible">True</property>
  <property name="title" translatable="yes">PInger</property>
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
  <property name="window_position">GTK_WIN_POS_NONE</property>
  <property name="modal">False</property>
  <property name="resizable">True</property>
  <property name="destroy_with_parent">False</property>

  <child>
    <widget class="GtkVBox" id="vbox1">
      <property name="visible">True</property>
      <property name="homogeneous">False</property>
      <property name="spacing">0</property>

      <child>
	<widget class="GtkHBox" id="hbox1">
	  <property name="visible">True</property>
	  <property name="homogeneous">False</property>
	  <property name="spacing">0</property>

	  <child>
	    <widget class="GtkLabel" id="label1">
	      <property name="visible">True</property>
	      <property name="label" translatable="yes">Адрес:</property>
	      <property name="use_underline">False</property>
	      <property name="use_markup">False</property>
	      <property name="justify">GTK_JUSTIFY_LEFT</property>
	      <property name="wrap">False</property>
	      <property name="selectable">False</property>
	      <property name="xalign">0.5</property>
	      <property name="yalign">0.5</property>
	      <property name="xpad">0</property>
	      <property name="ypad">0</property>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">False</property>
	      <property name="fill">False</property>
	    </packing>
	  </child>

	  <child>
	    <widget class="GtkEntry" id="entry1">
	      <property name="visible">True</property>
	      <property name="can_focus">True</property>
	      <property name="editable">True</property>
	      <property name="visibility">True</property>
	      <property name="max_length">0</property>
	      <property name="text" translatable="yes"></property>
	      <property name="has_frame">True</property>
	      <property name="invisible_char" translatable="yes">*</property>
	      <property name="activates_default">False</property>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">True</property>
	      <property name="fill">True</property>
	    </packing>
	  </child>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">True</property>
	  <property name="fill">True</property>
	</packing>
      </child>

      <child>
	<widget class="GtkHBox" id="hbox2">
	  <property name="visible">True</property>
	  <property name="homogeneous">False</property>
	  <property name="spacing">0</property>

	  <child>
	    <widget class="GtkLabel" id="label2">
	      <property name="visible">True</property>
	      <property name="label" translatable="yes">Порт:</property>
	      <property name="use_underline">False</property>
	      <property name="use_markup">False</property>
	      <property name="justify">GTK_JUSTIFY_LEFT</property>
	      <property name="wrap">False</property>
	      <property name="selectable">False</property>
	      <property name="xalign">0.5</property>
	      <property name="yalign">0.5</property>
	      <property name="xpad">0</property>
	      <property name="ypad">0</property>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">False</property>
	      <property name="fill">False</property>
	    </packing>
	  </child>

	  <child>
	    <widget class="GtkSpinButton" id="spinbutton1">
	      <property name="visible">True</property>
	      <property name="can_focus">True</property>
	      <property name="climb_rate">1</property>
	      <property name="digits">0</property>
	      <property name="numeric">False</property>
	      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
	      <property name="snap_to_ticks">False</property>
	      <property name="wrap">False</property>
	      <property name="adjustment">1 1 1024 1 10 10</property>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">True</property>
	      <property name="fill">True</property>
	    </packing>
	  </child>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">True</property>
	  <property name="fill">True</property>
	</packing>
      </child>

      <child>
	<widget class="GtkButton" id="button1">
	  <property name="visible">True</property>
	  <property name="can_focus">True</property>
	  <property name="relief">GTK_RELIEF_NORMAL</property>
	  <signal name="clicked" handler="on_button1_clicked" last_modification_time="Tue, 13 Apr 2004 08:37:11 GMT"/>

	  <child>
	    <widget class="GtkAlignment" id="alignment1">
	      <property name="border_width">1</property>
	      <property name="visible">True</property>
	      <property name="can_default">True</property>
	      <property name="has_default">True</property>
	      <property name="can_focus">True</property>
	      <property name="xalign">0.5</property>
	      <property name="yalign">0.5</property>
	      <property name="xscale">0</property>
	      <property name="yscale">0</property>

	      <child>
		<widget class="GtkHBox" id="hbox3">
		  <property name="visible">True</property>
		  <property name="homogeneous">False</property>
		  <property name="spacing">2</property>

		  <child>
		    <widget class="GtkImage" id="image1">
		      <property name="visible">True</property>
		      <property name="stock">gtk-apply</property>
		      <property name="icon_size">4</property>
		      <property name="xalign">0.5</property>
		      <property name="yalign">0.5</property>
		      <property name="xpad">0</property>
		      <property name="ypad">0</property>
		    </widget>
		    <packing>
		      <property name="padding">0</property>
		      <property name="expand">False</property>
		      <property name="fill">False</property>
		    </packing>
		  </child>

		  <child>
		    <widget class="GtkLabel" id="label3">
		      <property name="visible">True</property>
		      <property name="label" translatable="yes">Ping</property>
		      <property name="use_underline">True</property>
		      <property name="use_markup">False</property>
		      <property name="justify">GTK_JUSTIFY_LEFT</property>
		      <property name="wrap">False</property>
		      <property name="selectable">False</property>
		      <property name="xalign">0.5</property>
		      <property name="yalign">0.5</property>
		      <property name="xpad">0</property>
		      <property name="ypad">0</property>
		    </widget>
		    <packing>
		      <property name="padding">0</property>
		      <property name="expand">False</property>
		      <property name="fill">False</property>
		    </packing>
		  </child>
		</widget>
	      </child>
	    </widget>
	  </child>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">False</property>
	  <property name="fill">False</property>
	</packing>
      </child>
    </widget>
  </child>
</widget>

</glade-interface>

[-- Attachment #3: pinger.py --]
[-- Type: text/plain, Size: 1240 bytes --]

#!/usr/bin/env python
#-*- coding: cp1251 -*-
"""
Ýòî ãëàâíûé ôàéë òèïà ïðîãðàììû
"""
import sys

try:
        import pygtk
        # tell pyGTK, if possible, that we want GTK2
        pygtk.require("2.0")
except:
        pass

try:
        import gtk
        import gtk.glade
except:
        print "You need to install pyGTK or GTKv2",
        print "or set your PYTHONPATH correctly."
        print "/usr/local/bin/python2.3/site-packager/"
        sys.exit(1)
        
class appgui:
        def __init__(self):
                """
                Here we display the main serverinfo
                window
                """
                gladefile="pinger.glade"
                windowname="serverinfo"
                self.wTree=gtk.glade.XML (gladefile,windowname)
                
                dic = {"on_button1_clicked" :
                       self.button1_clicked,
                       "on_serverinfo_destroy":
                       (gtk.mainquit) }
                
                self.wTree.signal_autoconnect (dic)
                return
        
        #####CALLBACKS
        def button1_clicked(self, widget):
                print "button clicked"
                
# start application
app=appgui()
gtk.mainloop()

  reply	other threads:[~2004-04-13 12:39 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-08 14:58 [Comm] " Alexey Morsov
2004-04-08 15:12 ` Alexey Morozov
2004-04-08 16:01   ` Alexey Morsov
2004-04-08 16:27     ` Vladimir Alyekhin
2004-04-09  6:10       ` Alexey Morsov
2004-04-09  6:52         ` Maxim Tyurin
2004-04-09  7:03           ` Alexey Morsov
2004-04-09  7:35             ` Maxim Tyurin
2004-04-09  8:41               ` Alexey Morsov
2004-04-09  9:16                 ` Alexey Morozov
2004-04-09  9:25                   ` Alexey Morsov
2004-04-09  9:47                     ` Alexey Morozov
2004-04-09  9:54                       ` Alexey Morsov
2004-04-09  9:58                         ` Mike Lykov
2004-04-09 10:19                         ` Alexey Morozov
2004-04-09 10:42                           ` Alexey Morsov
2004-04-10  9:51         ` [Comm] " Vitaly Ostanin
2004-04-12  6:35           ` Alexey Morsov
2004-04-12 10:06             ` Vitaly Ostanin
2004-04-12 11:20               ` Alexey Morsov
2004-04-12 11:41                 ` Alexey Novikov
2004-04-12 11:58                   ` Alexey Morsov
2004-04-12 12:43                     ` Alexey Novikov
2004-04-13 12:21                 ` Vitaly Ostanin
2004-04-13 12:39                   ` Alexey Morsov [this message]
2004-04-13 14:51                     ` Vitaly Ostanin
2004-04-13 15:00                       ` Alexey Morsov
2004-04-13 15:04                         ` Vitaly Ostanin
2004-04-12 12:57               ` Alexey Morsov
2004-04-12 13:00                 ` Alexey Morsov
2004-04-12 13:41                   ` Alexey Novikov
2004-04-08 16:30     ` [Comm] " Maxim Tyurin
2004-04-09 11:47       ` Alexey Morsov
2004-04-09 12:12         ` Alexey Morsov
2004-04-09 12:15           ` Genix
2004-04-09 12:57             ` Alexey Morsov
2004-04-09 23:10               ` Aleksey Korotkov
2004-04-10  7:54                 ` Shur
2004-04-09 12:43           ` Maxim Tyurin
2004-04-08 18:32     ` Alexey Morozov
2004-04-09  6:45       ` Alexey Morsov
2004-04-09  6:51         ` Alexey Morozov
2004-04-10  9:54         ` [Comm] " Vitaly Ostanin
2004-04-10 10:44           ` Mike Lykov
2004-04-12  6:43             ` Alexey Morsov
2004-04-12  6:49               ` Petrichev Roman
2004-04-12  8:41                 ` Alexey Morsov
2004-04-12 12:41               ` Vitaly Lugovsky
2004-04-12 11:59                 ` Alexey Morsov
2004-04-12  6:39           ` Alexey Morsov
2004-04-12  8:13             ` Shur
2004-04-08 20:38 ` [Comm] " Anatoly A. Yakushin
2004-04-09  9:18   ` Alexey Morsov
2004-04-09  9:34     ` Anatoly A. Yakushin
2004-04-09  1:04 ` Aleksey Korotkov
2004-04-09  6:46   ` Alexey Morsov
2004-04-09 23:04     ` Aleksey Korotkov
2004-04-12  6:44       ` Alexey Morsov
2004-04-09  3:37 ` Mike Lykov
2004-04-09  6:48   ` Alexey Morsov
2004-04-09  7:07     ` Mike Lykov
2004-04-09  4:12 ` iceb
2004-04-09  4:36   ` Mike Lykov
2004-04-09  6:50   ` Alexey Morsov
2004-04-09 11:58 ` Eugene Prokopiev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=407BDF8A.6080107@ricom.ru \
    --to=samurai@ricom.ru \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git