Seite 2 von 2

Verfasst: 05.02.2006 20:05
von Pinhead
Hier mal der Code vom VisualDesigner:

common.pb:

Code: Alles auswählen


Enumeration
  #Window_0
EndEnumeration


Enumeration
  #Button_0
  #String_0
EndEnumeration

Global FontID1
FontID1 = LoadFont(1, "@MingLiU", 10,#PB_Font_HighQuality)

Procedure Open_Window_0()
  If OpenWindow(#Window_0, 216, 0, 600, 300,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "New window ( 0 )")
    If CreateGadgetList(WindowID(#Window_0))
      ButtonGadget(#Button_0, 80, 60, 60, 30, "す")
      SetGadgetFont(#Button_0, FontID1)
      StringGadget(#String_0, 310, 60, 190, 40, "す")
      SetGadgetFont(#String_0, FontID1)
      
    EndIf
  EndIf
EndProcedure
test.pb:

Code: Alles auswählen

IncludeFile "Common.pb"

Open_Window_0()

Repeat 
  
  Event = WaitWindowEvent() 
  
  WindowID = EventWindow() 
  
  GadgetID = EventGadget() 
  
  EventType = EventType() 
  
  If Event = #PB_Event_Gadget
    
    If GadgetID = #Button_0
      
    ElseIf GadgetID = #String_0
      
    EndIf
    
  EndIf
  
Until Event = #PB_Event_CloseWindow 

End

Verfasst: 05.02.2006 20:26
von Pinhead
Habs gefunden!!!
Mit dem Font geht was schief. Wenn man keinen
Font angibt funktionierts...

Verfasst: 05.02.2006 20:27
von Eric
Mit dem Code liegt das 'su' bei mir auch auf der Seite,
wenn ich allerdings das LoadFont und SetGadgetFont auskommentiere,
funktioniert es.