Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.
	Moderators:  Víctor Paredes , Belgarath , slowtiger 
			
		
		
			
				
								davoodice2 							 
									
		Posts:  397  		Joined:  Tue Jun 15, 2021 5:14 am 		
		
						
						
		 
		
						
						
													
							
						
									
						Post 
					 
								by davoodice2   »  Tue Aug 10, 2021 4:20 am 
			
			
			
			
			hello.
I am newbie in moho scripting.
Is there a way to build a floating window in Moho? So that he had access to the main window of Moho. 
 
			
			
									
									خیام اگر ز باده مستی خوش باش  
با ماهرخی اگر نشستی خوش باش  
چون عاقبت کار جهان نیستی است 
انگار که نیستی چو هستی خوش باش 
						 
		 
		 
				
			 
				
		
		
			
				
								Lukas 							 
									
		Posts:  1337  		Joined:  Fri Apr 09, 2010 1:00 am 		
		
																Location:  Netherlands 
							
							
				Contact: 
				
			 
				
		 
		
						
						
													
							
						
									
						Post 
					 
								by Lukas   »  Tue Aug 10, 2021 4:37 am 
			
			
			
			
			I've been experimenting and was able to create a floating window that has access Moho but it's unstable at the moment: 
ExperimentDialWindow.gif 
More info in 
this thread .
 
			
			
									
									
						 
		 
		 
				
			 
				
				
		
		
			
				
								davoodice2 							 
									
		Posts:  397  		Joined:  Tue Jun 15, 2021 5:14 am 		
		
						
						
		 
		
						
						
													
							
						
									
						Post 
					 
								by davoodice2   »  Tue Aug 10, 2021 11:10 am 
			
			
			
			
			Lukas  wrote: ↑ Tue Aug 10, 2021 4:37 am 
I've been experimenting and was able to create a floating window that has access Moho but it's unstable at the moment: 
ExperimentDialWindow.gif 
More info in 
this thread .
amazing job ! this with moho's api?
 
			
			
									
									خیام اگر ز باده مستی خوش باش  
با ماهرخی اگر نشستی خوش باش  
چون عاقبت کار جهان نیستی است 
انگار که نیستی چو هستی خوش باش 
						 
		 
		 
				
			 
				
		
		
			
				
								Lukas 							 
									
		Posts:  1337  		Joined:  Fri Apr 09, 2010 1:00 am 		
		
																Location:  Netherlands 
							
							
				Contact: 
				
			 
				
		 
		
						
						
													
							
						
									
						Post 
					 
								by Lukas   »  Wed Aug 11, 2021 12:45 am 
			
			
			
			
			davoodice2  wrote: ↑ Tue Aug 10, 2021 11:10 am amazing job ! this with moho's api?
Yes Moho's API and some undocumented stuff mentioned in the thread I linked in my first reply.
gilcartunista  wrote: ↑ Tue Aug 10, 2021 5:28 am 
Great Lukas!! If possible I would like to try it! Grateful!
It'll just crash...
 
			
			
									
									
						 
		 
		 
				
			 
				
		
		
			
				
								gilcartunista 							 
									
		Posts:  55  		Joined:  Mon Mar 14, 2016 11:13 am 		
		
																Location:  https://www.facebook.com/gil.cartunista  
							
							
				Contact: 
				
			 
				
		 
		
						
						
													
							
						
									
						Post 
					 
								by gilcartunista   »  Wed Aug 11, 2021 7:27 am 
			
			
			
			
			Lukas  wrote: ↑ Wed Aug 11, 2021 12:45 am  
davoodice2  wrote: ↑ Tue Aug 10, 2021 11:10 am amazing job ! this with moho's api?
Yes Moho's API and some undocumented stuff mentioned in the thread I linked in my first reply.
gilcartunista  wrote: ↑ Tue Aug 10, 2021 5:28 am 
Great Lukas!! If possible I would like to try it! Grateful!
It'll just crash...
OK Lukas! No problem, I test it anyway! Grateful.
 
			
			
									
									
						 
		 
		 
				
			 
				
		
		
			
				
								hayasidist 							 
									
		Posts:  3907  		Joined:  Wed Feb 16, 2011 11:12 am 		
		
											Location:  Kent, England 
							
						
		 
		
						
						
													
							
						
									
						Post 
					 
								by hayasidist   »  Wed Aug 11, 2021 7:41 am 
			
			
			
			
			the challenge (why it crashes) is, I think, to do with how the "moho" table is passed through to the "update" function (and I'm also guessing that the functions in that table are expected to be written in C / C++; so the "moho" that they get is C-friendly, and not LUA friendly.) Specifically, I haven't yet figured out how to invoke the functions that return properties that the "usual LUA moho" would give you using such as moho.layer
More here: 
viewtopic.php?f=12&t=33793&start=30#p198597 
so if anyone can figure that out ...
 
			
			
									
									
						 
		 
		 
				
			 
				
		
		
			
				
								davoodice2 							 
									
		Posts:  397  		Joined:  Tue Jun 15, 2021 5:14 am 		
		
						
						
		 
		
						
						
													
							
						
									
						Post 
					 
								by davoodice2   »  Wed Aug 11, 2021 8:33 am 
			
			
			
			
			can you share how to create a floating window? please 
  
just interface.
 
			
			
									
									خیام اگر ز باده مستی خوش باش  
با ماهرخی اگر نشستی خوش باش  
چون عاقبت کار جهان نیستی است 
انگار که نیستی چو هستی خوش باش 
						 
		 
		 
				
			 
				
		
		
			
				
								Lukas 							 
									
		Posts:  1337  		Joined:  Fri Apr 09, 2010 1:00 am 		
		
																Location:  Netherlands 
							
							
				Contact: 
				
			 
				
		 
		
						
						
													
							
						
									
						Post 
					 
								by Lukas   »  Wed Aug 11, 2021 8:59 am 
			
			
			
			
			
			
			
									
									
						 
		 
		 
				
			 
				
		
		
			
				
								davoodice2 							 
									
		Posts:  397  		Joined:  Tue Jun 15, 2021 5:14 am 		
		
						
						
		 
		
						
						
													
							
						
									
						Post 
					 
								by davoodice2   »  Thu Aug 12, 2021 12:17 am 
			
			
			
			
			
			
			
									
									خیام اگر ز باده مستی خوش باش  
با ماهرخی اگر نشستی خوش باش  
چون عاقبت کار جهان نیستی است 
انگار که نیستی چو هستی خوش باش 
						 
		 
		 
				
			 
				
		
		
			
				
								davoodice2 							 
									
		Posts:  397  		Joined:  Tue Jun 15, 2021 5:14 am 		
		
						
						
		 
		
						
						
													
							
						
									
						Post 
					 
								by davoodice2   »  Thu Aug 12, 2021 12:19 am 
			
			
			
			
			davoodice2  wrote: ↑ Thu Aug 12, 2021 12:17 am  
thanks you.
 
			
			
									
									خیام اگر ز باده مستی خوش باش  
با ماهرخی اگر نشستی خوش باش  
چون عاقبت کار جهان نیستی است 
انگار که نیستی چو هستی خوش باش