WideStudio/MWT Logo
WideStudio/MWT
Programming Guide
WideStudio/MWT Index
Table of contents


°´Ã¼ÀÇ ¼Ó¼ºÁö¸¦ Ãëµæ/ ¼³Á¤Çϱ⿡´Â

À̺¥Æ® ÇÁ·Î½ÃÀú¿¡À־, °´Ã¼ÀÇ ¼Ó¼º¿¡´ëÇÏ¿© Á¢±Ù(access) ÇÒ¼ö ÀÖ½À´Ï´Ù. ´ÙÀ½ÀÇ API¸¦ »ç¿ëÇÕ´Ï´Ù.

Á¢±Ù(access) ÇÔ¼ö ±â´É
mwt.WSCvariant getProperty() ¼Ó¼ºÁöÀÇ Ãëµæ
mwt.WSCvariant setProperty() ¼Ó¼ºÁöÀÇ ¼³Á¤



¼Ó¼ºÁöÀÇ Ãëµæ

°´Ã¼ÀÇ ¼Ó¼ºÀ» ÃëµæÇϱ⿡´Â,WSCbase Ŭ·¡½ºÀÇ ¸â¹ö ÇÔ¼öÀÎ getProperty() ÀÇ »ç¿ëÇÕ´Ï´Ù.

#----------------------------------------------------------
#Function for the event procedure
#----------------------------------------------------------
import mwt

def event_procedure(object):
	# "x" (X ÁÂÇ¥) ¼Ó¼º°ªÀÇ ¹®ÀÚ¿­¿¡ ÀÇÇÑ Ãëµæ
	x = object.getProperty("x"); 
	print "x=%s\n" % (x.getCharPtr()); # ¹®ÀÚ¿­ Ãëµæ

	# "y" (Y ÁÂÇ¥) ¼Ó¼º°ªÀÇ Ãëµæ
	y =  object.getProperty("y"); 
	print "y=%d\n" % (y.getLong()); # longÇü º¯¼öÀÇ °ªÀ» Ãëµæ 

	return;
mwt.WSGFfunctionRegister("event_procedure",event_procedure)

"x" ÀÇ ¿¹·Î´Â, ¹®ÀÚ¿­À¸·Î °ªÀ» ÃëµæÇÏ°í, "y" ÀÇ ¿¹·Î´Â, longÇüÀ¸·Î ¹Þ¾Ò½À´Ï´Ù. ÇÔ¼ö getProperty()´Â WSCvariantÇüÀ¸·Î °ªÀ» µ¹·ÁÁÝ´Ï´Ù. WSCvariantÇüÀº °¢°¢ ÇüÀÇ °ªÀ» ¾òÀ» ¼ö ÀÖ½À´Ï´Ù.

mwt.WSCvariant °ªÀ» ÃëµæÇÒ ÇÔ¼ö ±â´É
getChar() char ÇüÀÇ °ªÀ» Ãëµæ
getUnsignedChar() unsigned char ÇüÀÇ °ªÀ» Ãëµæ
getShort() short ÇüÀÇ °ªÀ» Ãëµæ
getUnsignedShort() unsigned short ÇüÀÇ °ªÀ» Ãëµæ
getLong() long ÇüÀÇ °ªÀ» Ãëµæ
getUnsignedLong() unsigned long ÇüÀÇ °ªÀ» Ãëµæ
getInt() int ÇüÀÇ °ªÀ» Ãëµæ
getUnsignedInt() unsigned int ÇüÀÇ °ªÀ» Ãëµæ
getFloat() float ÇüÀÇ °ªÀ» Ãëµæ
getDouble() double ÇüÀÇ °ªÀ» Ãëµæ
getCharPtr() char* Çü(¹®ÀÚ¿ª)ÀÇ °ªÀ» Ãëµæ



¼Ó¼ºÁöÀÇ ¼³Á¤

°´Ã¼ÀÇ ¼Ó¼ºÀ» ¼³Á¤Çϱ⿡´Â WSCbase Ŭ·¡½ºÀÇ ¸â¹ö ÇÔ¼öÀÎ setProperty() ¸¦ »ç¿ëÇÕ´Ï´Ù.

#----------------------------------------------------------
#Function for the event procedure
#----------------------------------------------------------
import mwt

def event_procedure(object):

	# "x" (X ÁÂÇ¥) ¼Ó¼ºÀÇ ¹®ÀÚ¿­¿¡ÀÇÇÑ ¼³Á¤
	x="100";
	object.setProperty("x",x); 

	# "y" (Y ÁÂÇ¥) ¼Ó¼ºÀÇ ¼³Á¤
	y=100; 
	object.setProperty("y",y); 
	return;

mwt.WSGFfunctionRegister("event_procedure",event_procedure)

"x" ÀÇ ¿¹·Î´Â ¹®ÀÚ¿­·Î °ªÀ» ¼³Á¤ÇÏ°íÀÖ½À´Ï´Ù."y" ÀÇ ¿¹·Î´Â Á¤¼öÇüÀ¸·Î °ªÀ» ¼³Á¤ÇÏ°íÀÖ½À´Ï´Ù.



¼Ó¼ºÁöÀÇ ¹¦È­¿¡ÀÇ ¹Ý¿µ

º¸Åë, À̺¥Æ® ÇÁ·Î½ÃÀúÀÇ ½ÇÇàÁ÷ÈÄ¿¡ ¹Ý¿µµÇ³ª, º¯°æÈÄ, ¼Ó¼ºÀÇ °ªÀ» Áï½Ã ¹Ý¿µÇÒ °æ¿ì,update(),draw(),redraw() ¸¦ È£ÃâÇÕ´Ï´Ù.

À©µµ¿ì ½Ã½ºÅÛ¿¡ µû¶ó¼­´Â ( ¿¹ÄÁµ¥ X11 ½Ã½ºÅÛÀÇ °æ¿ìµî) ¹¦È­ ¸¦ ÇѶ§, Áï½Ã´Â À©µµ¿ì ½Ã½ºÅÛ¿¡ ¹Ý¿µ¾ÈµÉ °æ¿ì°¡ ÀÖ½À´Ï´Ù. ±×·² °æ¿ì´Â WSDappDev Ŭ·¡½ºÀÇ update() ¸¦ È£ÃâÇØÁֽʽÿÀ.

#----------------------------------------------------------
#Function for the event procedure
#----------------------------------------------------------
import mwt
import newwin000

def event_procedure(WSCbase* object):

  newwin000.obj1.setProperty("labelString","ÅýºÆ®");
  newwin000.obj1.update();  # Áï½Ã °´Ã¼¸¦ °»½Å.
  mwt.WSGIappDev().update(); # À©µµ¿ì ½Ã½ºÅÛ¿¡·Î ¹¦È­¿ä±¸¸¦ ¹Ý¿µÇÕ´Ï´Ù.

  newwin000.obj2.setProperty("labelString","ÅýºÆ®");
  newwin000.obj2.update();  # Áï½Ã ¹¦È­µÈ´Ù.
  mwt.WSGIappDev().update(); # À©µµ¿ì ½Ã½ºÅÛ¿¡·Î ¹¦È­¿ä±¸¸¦ ¹Ý¿µÇÕ´Ï´Ù.
  return;
mwt.WSGFfunctionRegister("event_procedure",event_procedure)


Document Release 3.90 for WideStudio/MWT ver 3.90, Jul 2005


WideStudio/MWT documents index | Table of contents

Copyright(C) WideStudio/MWT Development Team, 1999-2005 Last modified: Jul 31, 2005